Can not use {{BaseURL}} in contains() function when use dsl matcher #5666
-
Is there an existing issue for this?
Current BehaviorWhen I use Expected BehaviorNuclei can replace conresponding baseURL to the function Steps To ReproduceWhen I use Relevant log outputNo response Environment- OS: ubuntu 20.04
- Nuclei: v3.3.2
- Go: go1.20.7 linux/amd64 Anything else?No response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You don’t actually need to use Here’s a simple workaround: Instead of writing it like how you originally did, you can try: This format should properly substitute the Alternatively, you could also leverage the This should solve your issue and make the condition work as expected! Let me know how it goes |
Beta Was this translation helpful? Give feedback.
-
That works. Thanks you @dwisiswant0 |
Beta Was this translation helpful? Give feedback.
You don’t actually need to use
{{
and}}
for variable substitution when writing within the DSL. The{{}}
format is mainly used in template request definitions, but in DSL expressions, the vars are directly accessible.Here’s a simple workaround:
Instead of writing it like how you originally did, you can try:
status_code == 302 && !contains(header, 'Location: ' + BaseURL + '/login/google')
This format should properly substitute the
BaseURL
var and make your condition function correctly.Alternatively, you could also leverage the
concat
helper func, which allows you to concatenate literal strings & variables. Example:!contains(header, concat('Location: ', BaseURL, '/login/google'))
This sh…