How to allow assig extractors to specific requests and enable global cookie reuse? #1270
-
Is your feature request related to a problem? Please describe. Describe the solution you'd like cookie-reuse: true # Global cookie reuse
requests:
- raw:
- |
GET /test-nuclei.php HTTP/1.1
Host: {{Hostname}}
extractors:
- type: regex
internal: true # Global extraction
name: output1
regex:
- '.*'
- raw:
- |
GET /test-nuclei.php?param={{output1}} HTTP/1.1
Host: {{Hostname}}
extractors:
- type: regex
name: output2
regex:
- '.*' Results into: GET /test-nuclei.php HTTP/1.1
Host: 0.0.0.0
User-Agent: Nuclei - Open-source project (github.com/projectdiscovery/nuclei)
Connection: close
Accept-Encoding: gzip, deflate
HTTP/1.1 200 OK
Date: Wed, 24 Mar 2021 17:48:55 GMT
Server: Apache
Strict-Transport-Security: max-age=15552000; includeSubDomains
Set-Cookie: test-cookie=289
Content-Length: 9
Connection: close
Content-Type: text/html; charset=UTF-8
Cookieset
GET /test-nuclei.php?param=Cookieset HTTP/1.1
Host: 0.0.0.0
User-Agent: Nuclei - Open-source project (github.com/projectdiscovery/nuclei)
Connection: close
Cookie: test-cookie=289
Accept-Encoding: gzip, deflate
HTTP/1.1 200 OK
Date: Wed, 24 Mar 2021 17:48:55 GMT
Server: Apache
Strict-Transport-Security: max-age=15552000; includeSubDomains
Content-Length: 4
Connection: close
Content-Type: text/html; charset=UTF-8
Done Extracted: Done |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@dawid-czarnecki both features are already supported, I'm adding a valid template example below, more info about using request condition in the template - https://nuclei.projectdiscovery.io/templating-guide/protocols/http/#request-condition requests:
- raw:
- |
GET /test-nuclei.php HTTP/1.1
Host: {{Hostname}}
- |
GET /test-nuclei.php?param={{output1}} HTTP/1.1
Host: {{Hostname}}
cookie-reuse: true
req-condition: true
extractors:
- type: regex
internal: true
part: body_1
name: output1
regex:
- '.*'
- type: regex
name: output2
part: body_2
regex:
- '.*' |
Beta Was this translation helpful? Give feedback.
@dawid-czarnecki both features are already supported, I'm adding a valid template example below, more info about using request condition in the template - https://nuclei.projectdiscovery.io/templating-guide/protocols/http/#request-condition