Matchers deep dive
Matchers evaluate responses against defined conditions to determine if a vulnerability exists.Matcher type reference
Status matcher
Matches HTTP status codes:- Detecting accessible admin panels (200)
- Finding redirect chains (301, 302)
- Identifying server errors (500, 502, 503)
- Checking authorization bypass (403 → 200)
Word matcher
Matches exact strings in responses:condition:andoror(default:or)case-insensitive: Boolean (default:false)part: Which part to match againstencoding:hexfor hex-encoded strings
- Technology detection
- Error message identification
- Content presence validation
Regex matcher
Matches using regular expressions:- Go regex engine doesn’t support lookaheads/lookbehinds
- Use
(?i)for case-insensitive matching - Use
(?m)for multiline mode - Escape backslashes in YAML (
\\becomes\)
- Pattern-based vulnerability detection
- Flexible string matching
- Email/URL extraction validation
Binary matcher
Matches binary patterns (hex-encoded):- File type detection
- Binary protocol responses
- Magic byte validation
- Heap dump detection
Size matcher
Matches response size:- Detecting empty responses
- Finding default error pages (same size)
- Identifying specific file sizes
DSL matcher
Matches using Domain Specific Language expressions:String functions
String functions
contains(str, substr)- Check if string contains substringcontains_any(str, ...substrs)- Check if contains any substringcontains_all(str, ...substrs)- Check if contains all substringsstarts_with(str, prefix)- Check if starts with prefixends_with(str, suffix)- Check if ends with suffixlen(str)- Get string lengthto_upper(str)- Convert to uppercaseto_lower(str)- Convert to lowercasetrim(str)- Remove whitespaceregex(pattern, str)- Regex match
Response variables
Response variables
status_code- HTTP status codebody- Response bodyheader- Response headers (map)all_headers- All headers as stringcontent_length- Response lengthcontent_type- Content-Type headerduration- Response time in msrequest- Full requestresponse- Full response
Logical operators
Logical operators
&&- Logical AND||- Logical OR!- Logical NOT==- Equality!=- Inequality>,<,>=,<=- Comparison
- Complex conditional logic
- Combining multiple checks
- Performance-based detection
- Advanced response validation
XPath matcher
Matches using XPath queries on HTML/XML:- HTML structure validation
- Element presence checking
- Attribute-based matching
- XML response validation
Matcher conditions
Control how multiple values within a matcher are evaluated:- OR condition
- AND condition
Matchers-condition
Control how multiple matchers relate to each other:Negative matchers
Invert matcher logic to match when conditions are NOT met:- Detecting missing security headers
- Finding unprotected endpoints
- Validating absence of error messages
Internal matchers
Hide matchers from output (useful in workflows):Part specification
Different protocols expose different parts for matching:- HTTP
- DNS
- Network
Extractors deep dive
Extractors pull specific data from responses for reporting or use in subsequent requests.Extractor type reference
Regex extractor
Extract using regular expressions:group: 0- Entire match (default)group: 1- First capture groupgroup: 2- Second capture group, etc.
KVal extractor
Extract key-value pairs from headers and cookies:- Keys are case-insensitive
- Replace hyphens with underscores:
Content-Type→content_type - Works with headers and cookies
JSON extractor
Extract from JSON using jq-style syntax:.key- Access object key.[]- Array iteration| .key- Pipe to next operationselect()- Filter elements.[]?- Optional iteration (won’t fail if not array)
XPath extractor
Extract from HTML/XML using XPath:DSL extractor
Extract using DSL expressions:Internal vs external extractors
Case-insensitive extraction
Advanced patterns
Multi-step extraction and matching
http-matcher-extractor-dy-extractor.yaml
Conditional extraction
Extract only when certain conditions are met:Multiple extractors with different types
Chaining templates with extractors
Matcher and extractor examples
Authentication bypass detection
API key exposure
Version fingerprinting
Performance considerations
Optimization tips:
- Use specific
partspecifications to reduce processing - Prefer
wordmatchers overregexwhen possible - Use
internal: truefor intermediate extractors - Combine conditions with
matchers-condition: andto fail fast - Use DSL matchers for complex logic instead of multiple matchers
Troubleshooting
Matcher not matching expected content
Matcher not matching expected content
- Check
partspecification (body, header, all) - Enable case-insensitive if needed
- Verify escaping in regex patterns
- Use
-debugflag to see actual responses
Extractor not extracting
Extractor not extracting
- Verify regex group number is correct
- Check if
partis specified correctly - Ensure JSON/XPath syntax is valid
- Test regex patterns with online tools first
Too many false positives
Too many false positives
- Use
matchers-condition: and - Add more specific matchers
- Use negative matchers for common false patterns
- Increase specificity of word/regex patterns
Extractors not passing to next request
Extractors not passing to next request
- Ensure extractor has a
name - Set
internal: truefor chaining - Verify template order in workflow
- Check variable reference syntax:
{{var_name}}
Related topics
Operators
Operators overview
Templates
Template structure
Workflows
Multi-step templates