DouglasRao/Claude-Pentest-Skills
GitHub: DouglasRao/Claude-Pentest-Skills
为Claude Code提供结构化的AD和Web渗透测试工作流技能包,包含侦察、利用、后渗透、报告完整链路及跨平台工具链集成。
Stars: 0 | Forks: 0
# Claude 渗透测试技能
[Claude Code](https://claude.ai/code) 的专业渗透测试技能。可直接使用的技能包,为 Claude 提供结构化的、工具感知的攻击工作流程——无幻觉、无猜测,仅使用有据可查的攻击技术的真实流水线。
## 概述
Claude Code 支持 **skills** — 加载到 LLM 上下文中的 Markdown 文件,用于定义专业化行为。本项目将经过实战验证的渗透测试工作流程打包为技能,包含:
- **Bash 脚本** 执行实际工作(而非提示中的一行命令)
- **检查点/恢复** — 重新运行而无需重复已完成阶段
- **并行执行** — 后台作业由 PID 数组跟踪
- **跨平台** — macOS(pdtm 工具链)+ Kali Linux
- **优雅降级** — 跳过缺失的工具并发出警告,永不崩溃
- **JSON 摘要** — 输出到 stdout 供 Claude 解析和操作
- **证据捕获** — 每个阶段自动截图和会话日志
- **MCP 集成** — Burp、Postman、Notion,以及可选的 Kali/hexstrike MCP 支持
- **Notion 报告** — 所有技能在 MCP 可用时向 Notion 发布结构化发现
- **结构化报告** — web-report 和 ad-report 生成包含 CVSS 评分、攻击路径叙述和 Notion 发布的发现
## 技能
### `ad-recon`
Active Directory 侦察 — 主机发现和完整域枚举。假设攻击机是 macOS 或 Linux。输出直接馈送到 `ad-exploitation`。
| 阶段 | 功能 |
|-------|-------------|
| 1 | 主机发现 — nmap 服务扫描 DC(端口 88、389、445、5985 等)、/24 ping 扫描、rustscan |
| 2 | 未认证枚举 — enum4linux-ng 空会话、rpcclient、smbclient 共享列表、LDAP 匿名绑定、kerbrute 用户枚举 |
| 2auth | 认证枚举 — crackmapexec/netexec 凭据验证、ldapdomaindump、bloodhound-python(所有对象,--zip)、AS-REP 可 Roast 账户、可 Kerberoast 的 SPN |
| 3 | 报告 — 攻击面摘要、利用候选、交接给 ad-exploitation 的后续步骤 |
**输出:** `users.txt`、`live_hosts.txt`、`asrep_hashes.txt`、`kerberoast_hashes.txt`、`bloodhound/*.zip`、ldapdomaindump HTML 文件。
### `ad-exploitation`
Active Directory 利用 — 从 `ad-recon` 停止的地方继续。专注于凭据攻击和域控制。
| 阶段 | 功能 |
|-------|-------------|
| 1 | 凭据攻击 — AS-REP Roasting(无凭据,使用 recon 的 `users.txt`)、Kerberoasting、密码喷洒(含锁定检查)、hashcat/john 破解 |
| 2 | 凭据验证扫描 — crackmapexec/netexec SMB + WinRM 跨子网扫描,识别 `(Pwn3d!)` 主机 |
| 3 | 域控制 — DCSync(impacket-secretsdump)、krbtgt 哈希、黄金票据、白银票据 |
| 4 | 交接 — 将 DA 凭据 + admin_hosts.txt + krbtgt 哈希传递给 ad-postexploitation |
| 5 | 报告 — 获取的凭据、完整攻击路径叙述、修复建议 |
**工具链:** impacket 套件、crackmapexec/netexec、kerbrute、evil-winrm、hashcat/john。所有工具都是可选的 — 缺失的工具会被优雅跳过。
### `ad-postexploitation`
在 Active Directory 环境中获得有效域凭据或 Windows 主机 shell 后的后渗透阶段。
| 阶段 | 功能 |
|-------|-------------|
| 1 | 态势感知 — whoami /all、AV/EDR 检测、AMSI 状态、AppLocker 检查 |
| 2 | 凭据收集 — Mimikatz、procdump + pypykatz、CME lsassy、SAM/DPAPI 转储 |
| 3 | 横向移动 — 传递哈希(impacket-psexec/smbexec/wmiexec)、传递票据、evil-winrm、RDP |
| 4 | 域权限提升 — BloodHound Cypher 查询、ACL 滥用、委派攻击(无约束/约束/RBCD)、本地提权 |
| 5 | 域持久化 — 黄金票据、钻石票据、白银票据、Skeleton Key、AdminSDHolder |
| 6 | 渗透与枢纽 — chisel SOCKS、SSH 隧道、SMB 传输 |
| 7 | 清理清单 — 移除痕迹、撤销创建的账户、恢复修改的 ACL |
### `ad-report`
Active Directory 评估的渗透测试报告生成。读取 `ad-recon`、`ad-exploitation` 和 `ad-postexploitation` 的输出。
| 阶段 | 功能 |
|-------|-------------|
| 1 | 分类 — 整合所有先前输出(哈希、CME 扫描、BloodHound 压缩包、战利品) |
| 2 | 证据整理 — 截图、hashcat 证明、CME Pwn3d 输出、BloodHound 图表 |
| 3 | 报告编写 — 生成包含 CVSS 3.1 评分、攻击路径叙述和修复建议的发现 |
| 4 | 审核 #1 — 检查完整性、CVSS 准确性、证据链接 |
| 5 | 审核 #2 — 发布前的最终编辑审核 |
| 6 | Notion 发布 — 通过 MCP 创建父页面 + 每个发现的子页面 |
**默认:** 综合技术 + 执行模式。获得 DA 后,攻击路径叙述部分为必填项。
### `web-recon`
针对 bug bounty 和 Web 渗透测试的完整攻击侦察链路。
| 阶段 | 功能 |
|-------|-------------|
| 1 | 被动子域名枚举(assetfinder、subfinder、findomain、amass、JLDC)+ 可选 DNS 暴力破解(puredns) |
| 2 | DNS 解析 + 存活检测 + 截图(httpx、dnsx、gowitness)+ WAF 检测(wafw00f)+ CVE 查询(sdlookup) |
| 2.2 | CMS 检测 + 扫描 — WordPress(wpscan/备用)、Drupal(droopescan)、Joomla(joomscan.py) |
| 3 | URL/参数发现(waybackurls、gau、katana、hakrawler、paramspider)+ gf 模式 |
| 4 | JS 分析 — 源码映射、密钥扫描器、暴露的 git(goop)、敏感文件暴露 |
| 5 | 内容发现(使用自动选择的 SecLists 词表的 feroxbuster) |
| 6 | Nuclei 扫描 — 存活主机 + 带参数端点 |
| 7 | 开放重定向确认(qsreplace + httpx) |
| 8 | S3 存储桶 / 云资产发现(meg + gf) |
**捆绑的 Python 脚本:** `js_secret_scanner.py`、`wpscan_lite.py`、`joomscan.py`
### `web-exploitation`
Web 应用利用 — 从 `web-recon` 停止的地方继续。涵盖完整的 OWASP Top 10 2021,具有工具感知的优雅降级工作流程。
| 阶段 | 功能 |
|-------|-------------|
| 1 | 侦察分类 — 加载先前的 web-recon 输出(gf 列表、nuclei 发现、JS 密钥) |
| 2 | 注入攻击 — SQLi(sqlmap)、NoSQLi、SSTI、LDAP 注入 |
| 3 | XSS — 反射型、存储型、DOM(dalfox、airixss、手动 curl) |
| 4 | 文件与路径攻击 — LFI/RFI 使用 PHP 包装器链、文件上传绕过序列 |
| 5 | 服务器端攻击 — SSRF(内部/云元数据)、XXE、XSLT |
| 6 | 认证与会话 — JWT(none/HS256 混淆/弱密钥)、OAuth 滥用、破坏的认证 |
| 7 | 逻辑与客户端 — IDOR、CSRF PoC、竞态条件、反序列化、点击劫持、主机头注入 |
| 8 | RCE 确认(通过 interactsh/Burp Collaborator 的 OOB) |
**无缝衔接 `web-recon` 输出** — 无重复枚举。专用工具缺失时回退到 curl。Burp 用于证据捕获;Postman MCP 用于 API 目标。
### `web-postexploitation`
在 Web 服务器(Linux 或 Windows)上获得 RCE 后的后渗透阶段。涵盖完整的提权和持久化链路 — 独立于任何 AD 环境。
| 阶段 | 功能 |
|-------|-------------|
| 1 | Shell 稳定化 — Python PTY 升级、socat TTY、pwncat-cs 处理程序 |
| 2 | 本地枚举 — 操作系统、用户、网络、服务、SUID、计划任务、Docker 逃逸检查 |
| 3 | 权限提升 — sudo 错误配置、SUID GTFOBins、内核 CVE、SeImpersonatePrivilege、PHP disable_functions 绕过 |
| 4 | 凭据与数据收集 — 配置文件、.env、SSH 密钥、/etc/shadow、数据库转储、渗透方法 |
| 5 | 横向移动 — 内部主机发现、端口转发、SSH 隧道、chisel SOCKS 代理 |
| 6 | 持久化 — authorized_keys、后门用户、计划任务反向 shell、注册表运行键 |
| 7 | Webshell 参考 — PHP、Python Flask、Node.js、Redis 注入;用于 WAF 绕过的混淆变体 |
| 8 | 报告 — 带证据和清理清单的结构化输出 |
### `web-report`
Web 评估的渗透测试报告生成。读取 `web-recon`、`web-exploitation` 和 `web-postexploitation` 的输出。
| 阶段 | 功能 |
|-------|-------------|
| 1 | 分类 — 整合所有先前输出(nuclei 发现、已确认漏洞、JS 密钥、截图) |
| 2 | 证据整理 — 分类截图、PoC 命令、每个发现的 Burp 导出 |
| 3 | 报告编写 — 生成包含 CVSS 3.1 评分、影响和修复建议的发现 |
| 4 | 审核 #1 — 检查完整性、CVSS 准确性、证据链接 |
| 5 | 审核 #2 — 发布前的最终编辑审核 |
| 6 | Notion 发布 — 通过 MCP 创建父页面 + 每个发现的子页面 |
**默认:** 综合技术 + 执行模式,发布前经过双重审核。
## 安装
将技能复制到您的 Claude Code 技能目录:
```
# macOS / Linux
cp -r skills/ad-recon ~/.claude/skills/
cp -r skills/ad-exploitation ~/.claude/skills/
cp -r skills/ad-postexploitation ~/.claude/skills/
cp -r skills/ad-report ~/.claude/skills/
cp -r skills/web-recon ~/.claude/skills/
cp -r skills/web-exploitation ~/.claude/skills/
cp -r skills/web-postexploitation ~/.claude/skills/
cp -r skills/web-report ~/.claude/skills/
# Make scripts executable
chmod +x ~/.claude/skills/*/scripts/*.sh
```
然后在 Claude Code 中加载技能:
```
/skills load ad-recon
/skills load ad-exploitation
/skills load ad-postexploitation
/skills load ad-report
/skills load web-recon
/skills load web-exploitation
/skills load web-postexploitation
/skills load web-report
```
或者只需描述您的需求 — 技能会根据其描述自动触发。
## 技能链
技能形成两条**独立的并行路径**。Web 路径涵盖 Linux/Web 目标;AD 路径涵盖 Windows/Active Directory 环境。任一路径都可以独立运行。
```
AD TRACK
─────────────────────────────────────────────────────────
ad-recon ──→ ad-exploitation ──→ ad-postexploitation ──→ ad-report
WEB TRACK
─────────────────────────────────────────────────────────
web-recon ──→ web-exploitation ──→ web-postexploitation ──→ web-report
```
每个技能读取前一个技能的输出 — 无重复枚举:
**AD 路径:**
- `ad-exploitation` 读取 `ad-recon` 输出(`users.txt`、`asrep_hashes.txt`、bloodhound 压缩包)
- `ad-postexploitation` 在 `ad-exploitation` 凭据验证后继续
- `ad-report` 整合所有 AD 路径发现以生成最终报告
**Web 路径:**
- `web-exploitation` 读取 `web-recon` 输出(gf URL 列表、nuclei 发现、JS 密钥)
- `web-postexploitation` 在 `web-exploitation` 确认 RCE 后继续
- `web-report` 整合所有 Web 路径发现以生成最终报告
## 需求
### ad-recon
**核心:** `nmap`
**推荐:** `enum4linux-ng`、`rpcclient`、`smbclient`、`ldapsearch`、`kerbrute`、`crackmapexec` 或 `netexec`、`ldapdomaindump`、`bloodhound-python`、`impacket`(GetNPUsers、GetUserSPNs)
### ad-exploitation
**核心:** `impacket`(套件)
**推荐:** `crackmapexec` 或 `netexec`、`kerbrute`、`evil-winrm`、`hashcat` 或 `john`
### ad-postexploitation
**在 Windows 目标上:** PowerShell,可选 Mimikatz / Rubeus / SharpHound
**攻击机:** `impacket` 套件、`evil-winrm`、`chisel`
### ad-report
**必需:** Notion MCP(用于发布)或任何文本编辑器用于本地导出
**证据工具:** `screencapture`(macOS)或 `scrot`(Linux)、BloodHound GUI(图表导出)
### web-recon
**核心:** `httpx`(Go/ProjectDiscovery)、`dnsx`、`subfinder`
**推荐:** `assetfinder`、`findomain`、`amass`、`katana`、`hakrawler`、`waybackurls`、`gau`、`feroxbuster`、`nuclei`、`anew`、`uro`、`qsreplace`、`gf`、`wafw00f`、`gowitness`、`puredns`
### web-exploitation
**核心:** `curl`(始终可用)
**推荐:** `sqlmap`、`dalfox`、`gf`、`qsreplace`、`nuclei`、`ffuf`、`uro`、`waybackurls`、`gau`
**可选:** `jwt_tool`、`airixss`、`interactsh-client`
### web-postexploitation
**攻击机:** `nc`/`ncat`、`python3`、`rlwrap`
**首选:** `pwncat-cs`、`socat`、`chisel`
### web-report
**必需:** Notion MCP(用于发布)或任何文本编辑器用于本地导出
**证据工具:** `screencapture`(macOS)或 `scrot`(Linux)、web-recon 的 `gowitness` 输出
### 在 macOS 上安装(pdtm)
```
pdtm -i httpx dnsx subfinder katana nuclei anew uro
go install github.com/tomnomnom/gf@latest
go install github.com/tomnomnom/qsreplace@latest
go install github.com/hahwul/dalfox/v2@latest
pip3 install impacket bloodhound ldapdomaindump
```
### 在 Kali Linux 上安装
```
apt install nmap enum4linux smbclient crackmapexec evil-winrm
pip3 install impacket bloodhound ldapdomaindump
go install github.com/ropnop/kerbrute@latest
```
## 输出结构
### ad-recon
```
$DOMAIN/
├── enum/ # nmap_dc.txt, live_hosts.txt, enum4linux, rpcclient, ldap_anon, users.txt, ldap/ (ldapdomaindump)
├── hashes/ # asrep_hashes.txt, kerberoast_hashes.txt
├── bloodhound/ # *.zip (import into BloodHound GUI)
└── evidence/ # Screenshots of nmap output, ldapdomaindump HTML, BloodHound graphs
```
### ad-exploitation
```
$DOMAIN-exploit/
├── enum/ # cme_sweep.txt, admin_hosts.txt, cme_winrm.txt
├── hashes/ # cracked passwords (asrep_cracked.txt, kerberoast_cracked.txt)
├── tickets/ # Kerberos .ccache files (pass-the-ticket, Golden Ticket)
├── loot/ # dcsync_hashes.txt, krbtgt_hash.txt, admin_hash.txt
└── evidence/ # Screenshots of CME Pwn3d, hashcat cracked, DCSync success
```
### ad-postexploitation
```
$DOMAIN-postex/
├── loot/ # Mimikatz output, SAM dump, DPAPI decrypted
├── tickets/ # Kerberos tickets (.ccache)
├── pivoting/ # Chisel configs, port forwards
└── evidence/ # Shell screenshots, BloodHound attack paths, session logs
```
### web-recon
```
$PROJECT/
├── subs/ # Subdomain lists
├── dns/ # Live hosts, URLs, WAF, CVEs
├── urls/ # Historical URLs, params, gf_*.txt patterns
├── js/ # Source maps, secrets.json, git exposed
├── content/ # feroxbuster output
├── vulns/ # nuclei.txt, CMS results, open redirects
├── screenshots/ # gowitness screenshots
└── evidence/ # Manual screenshots, session logs
```
### web-exploitation
```
$PROJECT-exploit/
├── sqli/ # sqlmap results, confirmed SQLi
├── xss/ # dalfox results
├── lfi/ # LFI confirmed findings
├── ssrf/ # SSRF confirmed findings
├── auth/ # JWKS, OAuth endpoints, security headers
├── logic/ # CSRF PoC, clickjacking PoC, IDOR results
├── findings/ # Consolidated confirmed vulnerabilities
└── evidence/ # Screenshots per vulnerability type
```
### web-postexploitation
```
$PROJECT-postex/
├── loot/ # Harvested credentials, keys, DB dumps
├── pivoting/ # Chisel configs, SSH tunnel notes
└── evidence/ # Shell screenshots, session logs
```
## 许可证
本项目根据 [MIT 许可证](LICENSE) 获得许可。
## 免责声明
本项目仅用于**授权的安全测试、bug bounty 研究、CTF 竞赛和教育目的**。请勿用于您没有明确测试权限的系统。在进行渗透测试活动之前,请务必获取书面授权。
标签:Active Directory, AD-recon, AI安全助手, BloodHound, Burp Suite, CISA项目, Claude Code, macOS安全, MCP集成, Modbus, Notion集成, offensive-security, pentest, PE 加载器, Plaso, red-team, SNMP, StruQ, T1003, T1006, T1018, T1021, T1033, T1046, T1059, T1068, T1078, T1082, T1083, T1087, T1106, T1110, T1190, T1210, T1482, T1484, T1550, T1552, T1566, web-testing, Web报告查看器, Web渗透测试, XXE攻击, 凭证获取, 协议分析, 域渗透, 安全测试, 应用安全, 插件系统, 攻击性安全, 攻击链, 数据展示, 无线安全, 日志审计, 权限提升, 横向移动, 渗透测试框架, 电子数据取证, 红队, 编程规范, 网络安全, 网络安全审计, 网络枚举, 自动化渗透, 逆向工具, 防御, 隐私保护