🔍 Pentest Skill

May 29, 2026 · View on GitHub

中文 | EN

License: MIT Python 3.9+ Platform Version

一套可被任何 AI Agent(Claude Code、Codex、Cursor、WorkBuddy 等)直接调用的黑盒 Web 渗透测试框架。通过标准化的 CLI 接口,支持从侦察到报告的完整渗透测试流程。


⚠️ 免责声明

本工具仅供授权的安全测试和研究使用。 使用前必须获得目标系统所有者的明确书面授权。未经授权的渗透测试属于违法行为。作者对任何滥用不承担任何责任。


🚀 快速开始

# 1. 克隆仓库
git clone https://github.com/wudidike/pentest_skill.git
cd pentest_skill

# 2. 一键安装(自动下载 Go 工具 + Python 依赖 + Payload 同步)
bash setup.sh

# 3. 环境检查
python scripts/health_check.py

# 4. 开始渗透测试
python scripts/phase0_fingerprint.py --target https://example.com --output-dir ./output

可选安装

bash setup.sh --with-playwright   # 安装 Playwright(Phase 4 深度渲染)
bash setup.sh --with-sqlmap       # 安装 sqlmap(Phase 7D SQL注入验证)
bash setup.sh --update            # 更新所有工具到最新版本

📋 功能概览

Phase功能描述
0指纹识别技术栈/WAF/安全头/Cookie安全
1子域名枚举subfinder/crt.sh/DNS爆破
2DNS解析CNAME链/IP归属/云厂商
3端口扫描nmap/socket 服务识别
4深度渲染Playwright JS渲染/API发现
4BSessionCookie/JWT/Auth Headers
5目录枚举ffuf 路径发现/SPA过滤
6JS分析端点验证/密钥检测
7漏洞扫描nuclei + VulnOrchestrator
7A自动验证误报排除/基线对比
7B认证漏洞IDOR/越权/JWT
7DSQL注入sqlmap 自动化验证
7E证据汇总Burp风格数据包+HTML报告
7F-7N专项检测框架/CMDI/SSRF/SSTI/XXE/反序列化/上传/逻辑
7OJWT漏洞alg=none/弱算法/敏感claims
7PGraphQLintrospection/批量查询/隐藏字段
7QHTTP走私CL.TE/TE.CL 差异检测
7M参数FuzzXSS/SQLi/SSTI/SSRF/Path/Command
8报告生成HTML报告(CVSS+MITRE+NIST+D3FEND)

🏗️ 架构

pentest_skill/
├── SKILL.md              # Agent 指令(AI 读这个文件)
├── config.yaml           # 配置文件
├── requirements.txt      # Python 依赖
├── setup.sh              # 一键安装脚本
├── Makefile              # 自动化入口
├── phases/               # 详细 Phase 指令
├── references/payloads/  # 本地 Payload (自动同步自 PATT)
├── wordlists/            # 目录枚举字典
├── scripts/              # Python 脚本
│   ├── core/             # 核心基础设施
│   ├── vuln/             # 漏洞模块化体系
│   ├── phase*.py         # 各 Phase 入口
│   ├── health_check.py   # 环境检查
│   ├── sync_payloads.py  # Payload 同步
│   └── run_benchmark.py  # 基准测试
├── tests/                # 回归测试
└── tools/                # 外部工具(setup.sh 自动下载)

🛠️ 外部工具依赖

工具用途安装方式
nmap端口扫描系统包管理器 (apt/brew/winget)
ffuf目录枚举setup.sh 自动下载
nuclei漏洞扫描setup.sh 自动下载
subfinder子域名枚举setup.sh 自动下载
sqlmapSQL注入验证pip install sqlmap
playwrightJS渲染pip install playwright

🧪 测试

# 回归测试
make test
# 或
python tests/test_core.py

# 基准测试
make benchmark
# 或
python scripts/run_benchmark.py

# 环境检查
python scripts/health_check.py

📖 使用方式

AI Agent 使用(推荐)

  1. SKILL.md 加载到你的 AI Agent(Claude Code / Cursor / WorkBuddy)
  2. 告诉 Agent:"对 https://target.com 进行渗透测试"
  3. Agent 会自动执行完整管道

CLI 直接使用

# 完整管道
python scripts/cli.py --target https://example.com --mode url

# 单独运行某个 Phase
python scripts/phase0_fingerprint.py --target https://example.com --output-dir ./output

# 只做侦察
python scripts/phase0_fingerprint.py --target URL --output-dir ./output
python scripts/phase4_render.py --target URL --output-dir ./output --deep
python scripts/phase5_dir_enum.py --target URL --output-dir ./output

⚙️ 配置

编辑 config.yaml 自定义行为:

validation:
  report_language: "zh-CN"  # 报告语言 (zh-CN / en)
network:
  proxy: ""                 # HTTP 代理
  timeout: 15               # 超时秒数
tools:
  nuclei:
    path: ""                # 留空自动检测

📄 License

MIT License. 仅供授权安全测试使用。


🔗 链接