-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix negative matching #1521 #1522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -44,3 +44,6 @@ payloads: | |||||||||||||
| status_code: | ||||||||||||||
| regex: 200|403|401 | ||||||||||||||
| reverse: false | ||||||||||||||
| content: | ||||||||||||||
| regex: (?i)(Cloudflare|Incapsula|Sucuri|Access Denied|Webroot|Error 403 Forbidden) | ||||||||||||||
| reverse: true | ||||||||||||||
|
Comment on lines
+47
to
+49
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Overly broad negative content regex may hide legitimate directory hits. With
Prefer anchoring to strong block-page phrases, e.g. 🔧 Suggested tightening content:
- regex: (?i)(Cloudflare|Incapsula|Sucuri|Access Denied|Webroot|Error 403 Forbidden)
+ regex: (?i)(Attention Required!\s*\|\s*Cloudflare|Incapsula incident ID|Sucuri WebSite Firewall|Access Denied.*reference\s*#)
reverse: true📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,11 +36,11 @@ payloads: | |
| conditions: | ||
| headers: | ||
| x-frame-options: | ||
| regex: ^((?!SAMEORIGIN|DENY).)+$ | ||
| reverse: false | ||
| regex: SAMEORIGIN|DENY | ||
| reverse: true | ||
| Content-Security-Policy: | ||
| regex: ^((?!frame-ancestors|frame-src).)+$ | ||
| reverse: false | ||
| regex: frame-ancestors|frame-src | ||
| reverse: true | ||
| content: | ||
| regex: ^((?!http-equiv=.*Content-Security-Policy.*content=.*(DENY|SAMEORIGIN)).)+$ | ||
| reverse: false | ||
| regex: http-equiv=.*Content-Security-Policy.*content=.*(DENY|SAMEORIGIN) | ||
| reverse: true | ||
|
Comment on lines
37
to
+46
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Confirm the except-TypeError path in response_conditions_matched and how missing headers are treated.
rg -nP -C8 'def response_conditions_matched' nettacker/core/lib/http.pyRepository: OWASP/Nettacker Length of output: 803 🏁 Script executed: sed -n '45,100p' nettacker/core/lib/http.pyRepository: OWASP/Nettacker Length of output: 2710 🏁 Script executed: sed -n '45,130p' nettacker/core/lib/http.pyRepository: OWASP/Nettacker Length of output: 3975 🏁 Script executed: sed -n '37,46p' nettacker/modules/vuln/clickjacking.yamlRepository: OWASP/Nettacker Length of output: 433 Two issues with the inverted clickjacking matching.
🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,8 +33,14 @@ payloads: | |
| - 80 | ||
| - 443 | ||
| response: | ||
| condition_type: or | ||
| condition_type: and | ||
| conditions: | ||
| status_code: | ||
| regex: "403" | ||
| reverse: true | ||
| content: | ||
| regex: (?i)(Cloudflare|Incapsula|Sucuri|Access Denied|Webroot|Error 403 Forbidden) | ||
| reverse: true | ||
|
Comment on lines
+36
to
+43
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Confirm iterative_response_match handling path and any pre-filtering contract.
rg -nP -C5 'iterative_response_match'Repository: OWASP/Nettacker Length of output: 10968 🏁 Script executed: #!/bin/bash
# Read the subdomain_takeover.yaml file around the relevant section
head -50 nettacker/modules/vuln/subdomain_takeover.yamlRepository: OWASP/Nettacker Length of output: 1969 🏁 Script executed: #!/bin/bash
# Search for AWS bucket takeover to understand if 403 is a legitimate concern
rg -A 20 -B 5 'AWS Bucket Takeover|AWS S3' nettacker/modules/vuln/subdomain_takeover.yamlRepository: OWASP/Nettacker Length of output: 1182 🏁 Script executed: #!/bin/bash
# Check the response_conditions_matched function to understand what fields it evaluates
rg -A 30 'def response_conditions_matched' nettacker/core/lib/http.pyRepository: OWASP/Nettacker Length of output: 1613 Top-level With
The Recommended fixes:
🤖 Prompt for AI Agents |
||
| iterative_response_match: | ||
| Aftership Takeover: | ||
| response: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overly generic WAF regex risks filtering out legitimate admin endpoints.
With
condition_type: and, this condition (withreverse: true) causes the admin finder to silently drop any response whose body matches these strings. Two concerns worth reconsidering:Access DeniedandError 403 Forbiddenare generic phrases that appear on many real admin/authentication pages (e.g., Tomcat Manager, Jenkins, custom admin panels after failed auth). Since the scan also treats403as a hit, many legitimate protected admin endpoints will now be silently hidden.Webrootis not a common WAF/CDN block-page marker (Webroot is primarily an endpoint AV vendor). Please confirm this was intentional, or replace with more typical WAF signatures (e.g.,Akamai,AWS WAF,F5 BIG-IP,ModSecurity,Imperva).Consider anchoring patterns to phrases that strongly indicate a block page rather than substrings that appear in legitimate responses (e.g.,
Attention Required! \| Cloudflare,Incapsula incident ID,Sucuri WebSite Firewall,Access Denied.*reference\s*#).🤖 Prompt for AI Agents