tyx-git/ctf-agents-team
GitHub: tyx-git/ctf-agents-team
一个为Claude Code设计的CTF自动化解题系统,提供从侦察到报告的全流程支持。
Stars: 1 | Forks: 0
# CTF 代理团队
一个为 [Claude Code](https://docs.anthropic.com/en/docs/claude-code) 设计的统一 CTF 解题编排系统。提供侦察、分类、专家分派、flag 验证及详细的解题报告生成——所有这些均由一个斜杠命令驱动。
## 功能
- **7 阶段工作流**:会话恢复 → 比赛接入 → 题目分类 → 环境检查 → 解题 → 验证 → 撰写报告
- **7 位专家代理**:Pwn、Web、逆向、移动、密码学、杂项、取证——每位都配备技术速查表和即用模板
- **12 份深度知识文件**:Python/Bash 沙箱、编码、游戏/虚拟机、Linux 权限提升、CTFd API、RF/SDR、DNS 利用(约 196KB)
- **结构化跟踪**:`wp.process` 包含阶段编号,`flag.log` 索引,比赛级别规划文件
- **规划纪律**:2-行动规则、3-打击协议、5-问题重启测试(源自 planning-with-files / Manus 模式)
- **自动解题快速检查**:robots.txt、.git 泄露、默认凭据、已知 CVE——在深度分析前快速通道
- **CTFd 集成**:基于 API 的题目列表、附件下载、flag 提交
## 安装
### 作为项目级技能(推荐)
```
cd your-ctf-workspace
mkdir -p .skills
git clone https://github.com/YOUR_USERNAME/ctf-agents-team .skills/ctf-agents-team
```
### 作为全局技能(在所有项目中可用)
```
mkdir -p ~/.claude/skills
git clone https://github.com/YOUR_USERNAME/ctf-agents-team ~/.claude/skills/ctf-agents-team
```
## 使用方法
在 Claude Code 中使用斜杠命令调用。支持两种主要模式:
### 单人模式 —— 并行解决所有题目
```
/ctf-agents-team BugKu
/ctf-agents-team BugKu/ # trailing slash OK
```
扫描比赛目录,按类别(Web、Pwn、逆向、杂项……)发现所有题目,然后为每个类别并行启动一个代理。每个类别代理按顺序处理其题目。适合希望最大吞吐量的比赛场景。
### 单题模式 —— 专注于一道题目
```
/ctf-agents-team BugKu/Web/one things
```
直接跳转到特定题目并运行完整的解题流程(分类 → 环境检查 → 解题 → 验证 → 撰写报告)。
### 其他调用方式
```
# 来自描述的新挑战
/ctf-agents-team ISCC 新题 Web 叫 A bridge so far,地址 http://x.x.x.x:8080
# 恢复上一次会话(无参数)
/ctf-agents-team
```
### 流程说明
**单题模式:**
1. **题目分类** —— 识别文件类型,搜索经验库,归入 7 个类别之一
2. **环境检查** —— 验证所需工具是否可用,安装缺失的 pip 包
3. **解题** —— 加载相关专家参考,应用技术,在 `wp.process` 中跟踪进度
4. **验证** —— 按置信度级别确认 flag(猜测 → 证据 → 已验证)
5. **撰写报告** —— 生成详细的 `题目名称.md`,包含可复现步骤 + 独立的 `exploit.py`
**单人模式:**
1. **比赛接入** —— 扫描比赛目录,创建 `task_plan.md`、`findings.md`、`progress.md`
2. **单人分派** —— 按类别分组题目,设定优先级,启动并行代理
3. **并行解题** —— 每个类别代理对每道题运行完整的分类→解题→撰写报告流程
4. **收集** —— 主代理将所有 flag 收集到 `flag.log`,更新进度
### 创建的目录结构
```
ISCC/ ← Competition root
├── limit.md ← Competition constraints (rate limits, timeouts)
├── task_plan.md ← All challenges overview + progress
├── findings.md ← Cross-challenge discoveries
├── progress.md ← Session timeline
├── flag.log ← Verified flags index (Lead Agent only)
├── web/
│ └── Oracle's Whisper/
│ ├── (challenge files)
│ ├── wp.process ← Stage-by-stage solving log
│ ├── flag.found ← Flag intermediate file
│ └── Oracle's Whisper.md ← Final detailed writeup
├── pwn/
├── re/
├── mobile/
├── misc/
├── crypto/
└── forensics/
```
## 项目结构
```
ctf-agents-team/
├── SKILL.md ← Main orchestrator (auto-loaded by Claude Code)
├── references/ ← Specialist technique cheatsheets
│ ├── pwn-agent.md ← ROP, heap, fmt string, SROP, one_gadget, pwndbg
│ ├── web-agent.md ← SQLi, SSTI, XXE, GraphQL, race condition, file upload
│ ├── reverse-agent.md ← r2, Ghidra headless, angr, rizin, pycdc, UPX
│ ├── mobile-agent.md ← APK, smali, Frida, Flutter/RN, root detection
│ ├── crypto-agent.md ← RSA, AES, ECC, DSA nonce, padding oracle, LLL
│ ├── misc-agent.md ← Stego, encodings, jails, PDF, Office, QR
│ ├── forensics-agent.md ← PCAP, memory, disk, USB, registry, timeline
│ ├── orchestrator-playbook.md ← Dispatch rules, auto-solve patterns, CTFd integration
│ ├── environment-baseline.md ← Tool requirements + installation guide
│ └── wp-format.md ← wp.process + final WP format specification
├── knowledge/ ← Deep technical references (loaded on demand)
│ ├── pyjails.md ← Python jail escapes (671 lines)
│ ├── bashjails.md ← Bash jail escapes
│ ├── encodings.md ← Encodings, QR, esoteric languages
│ ├── encodings-advanced.md ← Verilog, Gray code, SMS PDU, MaxiCode
│ ├── games-and-vms.md ← WASM, VM, Z3, K8s (4 parts)
│ ├── games-and-vms-2.md
│ ├── games-and-vms-3.md
│ ├── games-and-vms-4.md
│ ├── linux-privesc.md ← sudo, cron, SUID, NFS, kernel exploits
│ ├── ctfd-navigation.md ← CTFd API navigation
│ ├── rf-sdr.md ← RF/SDR/IQ signal processing
│ └── dns.md ← DNS exploitation
└── scripts/
├── bootstrap-linux.sh ← Tool installation script (pyenv + full baseline)
├── AddExp.py ← Unified exp append — syncs ~/.claude and ~/.codex stores
├── ClearExp.py ← Clean exp_candidate.jsonl + credential scan
└── CheckFiles.py ← Strong file existence check + engineering validation
```
## 前置条件
- **Claude Code** CLI 或 IDE 扩展
- **Linux** 环境(Kali / Ubuntu / Debian / WSL2)
- **Python 3.8+** 及 pip
- 常用 CTF 工具(本技能会检查并帮助安装缺失的工具)
### 推荐工具
引导脚本会安装 [references/environment-baseline.md](references/environment-baseline.md) 中定义的完整基线工具集:
```
bash .skills/ctf-agents-team/scripts/bootstrap-linux.sh
```
或手动安装——完整列表见 [references/environment-baseline.md](references/environment-baseline.md)。
## 经验库
本技能与 `exp/` 目录集成,用于跨比赛知识复用:
```
exp/
├── web/web.jsonl
├── pwn/pwn.jsonl
├── re/re.jsonl ← includes Mobile (distinguished by field)
├── misc/misc.jsonl
├── crypto/crypto.jsonl
└── forensics/forensics.jsonl
```
每一行都是一个 JSON 记录(模式定义见 [exp/README.md](exp/README.md)):
```
{"challenge":"Web","name":"SSTI Bypass","technique":"Jinja2 SSTI + config.__class__ chain","status":"solved","experience":["SSTI 检测先用 {{7*7}} 确认模板引擎类型","Jinja2 用 __class__.__mro__[1].__subclasses__() 遍历可用类","WAF 过滤双花括号时尝试 {% print %} 替代"]}
```
本技能在侦察期间搜索此库,并在解题后追加新条目。
## 自定义
### 添加新知识
将 `.md` 文件放入 `knowledge/`,然后更新以下位置的索引:
- `SKILL.md` 第 8 节(参考文档索引)
- `references/orchestrator-playbook.md`(知识加载指南)
### 添加新类别
1. 按照现有模式创建 `references/new-agent.md`
2. 在 `SKILL.md` 的分类矩阵中添加该类别
3. 在 `references/orchestrator-playbook.md` 的专家选择矩阵中添加该类别
## 许可证
MIT
标签:AI辅助, CTFd集成, CTF竞赛, Python编程, Ruby, 专家调度, 代理系统, 侦察技术, 安全测试, 工作流管理, 并行处理, 应用安全, 挑战分类, 攻击性安全, 斜杠命令, 旗帜验证, 知识库, 网络安全, 规划策略, 逆向工具, 隐私保护