How to write complex processing logic using YAML, such as implementing specific logic? #7293
-
|
I want to implement a complex vulnerability verification using nuclei, and this does not limit itself to the use of external scripts. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Nuclei has a few built-in mechanisms for complex logic without external scripts: 1. flow: |
let r1 = http(1);
if (r1) {
http(2);
}2. Internal extractors — pass data between requests extractors:
- type: regex
name: csrf_token
internal: true
regex:
- 'name="_token" value="([^"]+)"'Then reference with 3. javascript:
- code: |
let resp = template['response'];
let parsed = JSON.parse(resp);
return parsed.role === 'admin' && parsed.id > 0;
matchers:
- type: dsl
dsl:
- response == true4. DSL helper functions in matchers 5. req-condition: true
matchers:
- type: dsl
dsl:
- 'admin' in body_1
- status_code_2 == 200
condition: andFor most complex scenarios, |
Beta Was this translation helpful? Give feedback.
Nuclei has a few built-in mechanisms for complex logic without external scripts:
1.
flow— JavaScript-based execution controlControls which requests run and in what order, with full JS logic between them:
2. Internal extractors — pass data between requests
Then reference with
{{csrf_token}}in the next request body/header.3.
javascriptprotocol — full processing logicFor truly complex verification (custom crypto, multi-step chains, conditional parsing):