rmjohnson12/CTF_Agents
GitHub: rmjohnson12/CTF_Agents
一个模仿人类团队协作模式的 AI 驱动多 Agent 系统,用于自主解决 CTF 各类挑战。
Stars: 1 | Forks: 0
本仓库是我对 TonyZeroArch 最初创建的 CTF_Agents 项目的 fork。
我的贡献:
- 构建了模块化 Python 工具,以支持自动化 CTF 题目分析
- 实现了密码学 Agent,具备凯撒密码检测和暴力破解工作流
- 开发了可复用的网络工具模块(Nmap 集成、结构化结果流水线)
- 使用 pytest 创建了工具执行层和测试框架
- 为 Agent 驱动的解题和结构化输出处理贡献了架构设计
- 添加了最小化执行入口
# CTF_Agents
一个使用 AI 驱动自主性来解决夺旗赛 (CTF) 挑战的分层多 Agent 系统。该系统模仿人类 CTF 团队结构,由专门的 Agent 协同工作,解决跨多个类别的各种挑战。
## 🎯 概述
[](https://deepwiki.com/TonyZeroArch/CTF_Agents)
CTF_Agents 是一个模块化的多 Agent 系统,旨在自主解决各类 CTF 挑战,包括:
- **Web Exploitation**: XSS, SQLi, CSRF, SSRF 等
- **Cryptography**: 古典和现代密码、哈希、编码
- **Reverse Engineering**: 二进制分析、反编译、调试
- **Forensics**: 内存分析、磁盘取证、隐写术
- **Binary Exploitation**: 缓冲区溢出、ROP、shellcode
- **OSINT**: 开源情报收集
- **PWN**: 漏洞利用和 exploit 开发
- **Miscellaneous**: 不符合标准类别的挑战
- **Networking**: 协议分析、数据包操作
## 🏗️ 架构
该系统遵循分层多 Agent 架构:
```
┌─────────────────┐
│ Coordinator │
│ Agent │
└────────┬────────┘
│
┌────────────┼────────────┐
│ │ │
┌───────▼─────┐ ┌───▼──────┐ ┌──▼────────┐
│ Specialist │ │Specialist│ │ Support │
│ Agents │ │ Agents │ │ Agents │
└─────────────┘ └──────────┘ └───────────┘
```
### 核心组件
- **Coordinator Agent**: 中央决策者,负责分析挑战、分配任务并编排系统
- **Specialist Agents**: 针对特定 CTF 类别的领域专家
- **Support Agents**: 辅助服务,如侦察和漏洞扫描
- **Communication Layer**: 消息路由和事件处理
- **Knowledge Base**: 共享情报和历史数据
- **Decision Engine**: 战略规划和 Agent 协调
## 📁 项目结构
```
CTF_Agents/
├── agents/ # All agent implementations
│ ├── coordinator/ # Central coordinator agent
│ ├── specialists/ # Category-specific specialist agents
│ │ ├── web_exploitation/
│ │ ├── cryptography/
│ │ ├── reverse_engineering/
│ │ ├── forensics/
│ │ ├── binary_exploitation/
│ │ ├── osint/
│ │ ├── pwn/
│ │ ├── misc/
│ │ └── networking/
│ └── support/ # Support and auxiliary agents
│ ├── reconnaissance/
│ ├── exploit_development/
│ └── vulnerability_scanner/
│
├── core/ # Core system components
│ ├── communication/ # Inter-agent communication
│ ├── task_manager/ # Task queue and assignment
│ ├── knowledge_base/ # Shared knowledge storage
│ └── decision_engine/ # Strategic decision-making
│
├── tools/ # CTF tools and utilities
│ ├── web/ # Web exploitation tools
│ ├── crypto/ # Cryptography tools
│ ├── reversing/ # Reverse engineering tools
│ ├── forensics/ # Forensics tools
│ ├── binary/ # Binary exploitation tools
│ ├── network/ # Network analysis tools
│ └── common/ # Common utilities
│
├── shared/ # Shared resources
│ ├── payloads/ # Exploit payloads
│ ├── wordlists/ # Attack dictionaries
│ ├── exploits/ # Reusable exploits
│ ├── scripts/ # Utility scripts
│ └── models/ # AI/ML models
│
├── challenges/ # Challenge management
│ ├── active/ # Currently active challenges
│ ├── completed/ # Solved challenges
│ └── templates/ # Challenge templates
│
├── config/ # Configuration files
│ └── README.md # Configuration documentation
│
├── logs/ # System logs
│ ├── agents/ # Agent-specific logs
│ ├── challenges/ # Challenge logs
│ └── system/ # System-wide logs
│
├── results/ # Challenge results
│ ├── reports/ # Solution reports
│ ├── flags/ # Captured flags
│ └── artifacts/ # Challenge artifacts
│
├── tests/ # Test suite
│ ├── unit/ # Unit tests
│ ├── integration/ # Integration tests
│ └── mocks/ # Mock objects and fixtures
│
└── docs/ # Documentation
├── architecture/ # Architecture documentation
├── agents/ # Agent documentation
├── guides/ # User and developer guides
└── api/ # API documentation
```
## 🚀 快速开始
### 前置条件
- Python 3.8+
- Docker(用于容器化工具)
- Git
### 安装
```
# Clone 仓库
git clone https://github.com/TonyZeroArch/CTF_Agents.git
cd CTF_Agents
# 创建虚拟环境
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# 安装依赖
pip install -r requirements.txt
# 配置系统
cp config/config.example.yaml config/config.yaml
# 使用你的设置编辑 config.yaml
```
### 快速入门
```
# 启动系统
python main.py
# 提交 challenge
python submit_challenge.py --file challenge.zip --category web
# 查看结果
python view_results.py --challenge-id
```
## 🔧 配置
系统配置通过 `config/` 目录下的 YAML 文件进行管理:
- `system_config.yaml`: 主系统设置
- `agents_config.yaml`: Agent 特定配置
- `tools_config.yaml`: 工具设置和路径
- `communication_config.yaml`: 消息路由配置
有关详细的配置选项,请参阅 `config/README.md`。
## 🤖 Agent 开发
创建一个新的专门 Agent:
1. 在 `agents/specialists/` 下创建 Agent 目录
2. 实现 Agent 接口
3. 在配置中注册 Agent
4. 添加 Agent 专用工具
5. 编写测试
有关详细说明,请参阅 `docs/agents/development_guide.md`。
## 🧪 测试
```
# 运行所有测试
pytest
# 运行特定测试类别
pytest tests/unit/
pytest tests/integration/
# 运行 coverage
pytest --cov=agents --cov=core --cov=tools
```
## 📊 监控
系统提供全面的日志记录和监控:
- Agent 活动日志位于 `logs/agents/`
- 挑战进度位于 `logs/challenges/`
- 系统指标位于 `logs/system/`
## 🔒 安全与道德
本系统设计用于:
- 经授权的 CTF 竞赛
- 经许可的安全研究
- 教育目的
**切勿在未经明确授权的情况下用于真实系统。**
## 📚 文档
`docs/` 目录中提供了详尽的文档:
- [架构概述](docs/architecture/system_overview.md)
- [Agent 开发指南](docs/agents/development_guide.md)
- [配置指南](docs/guides/configuration.md)
- [API 文档](docs/api/)
## 📝 许可证
本项目根据 LICENSE 文件中指定的条款进行许可。
## 📧 联系方式
如有问题或反馈,请在 GitHub 上提出 issue。
**注意**:这是一个用于自主 CTF 解题的框架。其有效性取决于 Agent 实现、工具集成以及从挑战中持续学习的能力。
标签:CTI, DLL 劫持, ESC4, HTTP工具, LLM, Nmap, OSINT, PoC, PyRIT, Pytest, Python, SecList, Unmanaged PE, Web安全, XSS, 二进制漏洞利用, 云存储安全, 云资产清单, 人工智能, 内存取证, 凯撒密码, 协议分析, 协调器模式, 单元测试, 后端开发, 后端开发, 域环境安全, 多智能体系统, 大语言模型, 安全竞赛, 安全规则引擎, 密码学, 密码管理, 手动系统调用, 插件系统, 无后门, 无线安全, 暴力破解, 权限提升, 模块化设计, 漏洞分析, 漏洞情报, 用户模式Hook绕过, 网络安全, 网络安全审计, 网络安全研究, 网络扫描, 自主代理, 自动化修复, 自动化攻防, 蓝队分析, 虚拟驱动器, 请求拦截, 路径探测, 逆向工具, 逆向工程, 隐写术, 隐私保护