Tooluck logoTooluck
SKILL.md

ghost-bits-cast-attack

Agent skill fromyaklang/hack-skills

Java "Ghost Bits" / Cast Attack playbook (Black Hat Asia 2026). Use when attacking Java services where 16-bit char is silently narrowed to 8-bit byte to bypass WAF/IDS for SQL injection, deserialization RCE, file upload (Webshell), path traversal, CRLF injection, request smuggling, and SMTP injection. Affects Tomcat, Spring, Jetty, Undertow, Vert.x, Jackson, Fastjson, Apache Commons BCEL, Apache HttpClient, Angus Mail, JDK HttpServer, Lettuce, Jodd, XMLWriter and re-enables many "patched" CVEs through WAF bypass.

How to install ghost-bits-cast-attack

install ghost-bits-cast-attack
# install the hack-skills pack with the skills CLI
npx skills add yaklang/hack-skills

# or add only this skill to Claude Code: copy the folder

skills/ghost-bits-cast-attack/

# into

~/.claude/skills/ghost-bits-cast-attack/ (all projects)

.claude/skills/ghost-bits-cast-attack/ (one project)

skills/ghost-bits-cast-attack/SKILL.md

MITFull file
1# SKILL: Ghost Bits / Cast Attack — Java char to byte Narrowing Playbook
2
3> **AI LOAD INSTRUCTION**: This is a Java-only injection-enabling primitive,
4> not a standalone vulnerability class. Whenever you see (1) a Java backend,
5> (2) a WAF/IDS in front of it, and (3) any of {SQLi, deser RCE, file upload,
6> path traversal, CRLF, request smuggling, SMTP injection} on the menu, ALWAYS
7> try Ghost Bits variants of the payload before declaring it "blocked". The
8> root cause is the silent loss of the high 8 bits when Java code narrows a
9> 16-bit `char` to an 8-bit `byte` — the WAF sees a harmless Unicode
10> character, the backend reconstructs the original ASCII attack byte. Base
11> models almost never reach for this primitive.
12>
13> Source: Black Hat Asia 2026 talk *Cast Attack: A New Threat Posed by Ghost
14> Bits in Java* by Xinyu Bai (@b1u3r), Zhihui Chen (@1ue), with contributor
15> Zongzheng Zheng (@chun_springX).
16
17## 0. RELATED ROUTING
18
19Ghost Bits is a *bypass* primitive that re-enables payloads from many other
20playbooks. Pair it with whichever attack family applies:
21
22- [waf-bypass-techniques](../waf-bypass-techniques/SKILL.md) — when a Java
23 backend is suspected and WAF rules block the literal payload, this is the
24 first technique to try beyond classic encoding.
25- [deserialization-insecure](../deserialization-insecure/SKILL.md) — for
26 Apache Commons BCEL ClassLoader and Fastjson `\u`/`\x` escape variants.
27- [path-traversal-lfi](../path-traversal-lfi/SKILL.md) — Spring, Jetty,
28…

Excerpt shown under the repository's MIT license.

More skills in hack-skills

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

pbakaus /

impeccable
107k

The design vocabulary for your coding agent. Steer with polish and bolder, review with critique and audit, catch AI slop before it ships.

2 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates