waybarrios/cyber-agent

GitHub: waybarrios/cyber-agent

一款结合 Claude Code 智能代理的 AI 驱动渗透测试工具,遵循 PTES 标准自动完成安全评估并生成专业报告。

Stars: 18 | Forks: 3

# Cyber Agent - 结合 Claude Code 的 AI 驱动渗透测试 RedTeam Barranquilla [![RedTeam Barranquilla](https://img.shields.io/badge/RedTeam-Barranquilla-black)](https://redteambq.co/) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![Claude Code](https://img.shields.io/badge/Claude%20Code-Powered-blueviolet?logo=anthropic)](https://claude.ai/code) [![HackTheBox](https://img.shields.io/badge/HackTheBox-Ready-brightgreen?logo=hackthebox)](https://www.hackthebox.com/) [![Platform](https://img.shields.io/badge/Platform-Kali%20Linux-557C94?logo=kalilinux)](https://www.kali.org/) [![Status](https://img.shields.io/badge/Status-Active-success.svg)](https://github.com/waybarrios/cyber-agent) [![GitHub](https://img.shields.io/badge/GitHub-waybarrios%2Fcyber--agent-blue?logo=github)](https://github.com/waybarrios/cyber-agent) [![PTES](https://img.shields.io/badge/Methodology-PTES-orange.svg)](http://www.pentest-standard.org/) [![MITRE ATT&CK](https://img.shields.io/badge/MITRE-ATT%26CK-red.svg)](https://attack.mitre.org/) 结合 Claude Code agents 的 AI 驱动渗透测试系统。专为 HackTheBox 挑战和授权安全评估而设计。 ## 功能 - **自动化攻击执行** - AI agent 执行侦察、枚举、利用和权限提升 - **专业报告生成** - 生成高管和技术安全报告 - **基于发现的方法** - Agent 在执行过程中发现凭据和漏洞 - **PTES 方法论** - 遵循渗透测试执行标准 - **MITRE ATT&CK 映射** - 将技术映射到 ATT&CK 框架 ## Agents | Agent | 描述 | 用例 | |-------|-------------|----------| | `redteam-agent` | 执行渗透测试攻击 | 侦察、利用、权限提升 | | `report-agent` | 生成安全报告 | 高管摘要、技术文档 | ## 快速开始 ### 前置条件 ``` # 在 Kali Linux / Parrot OS 上 sudo apt update sudo apt install nmap ike-scan hashcat gcc build-essential # 安装 Claude Code CLI # 参见:https://claude.com/claude-code ``` ### 1. 克隆仓库 ``` git clone https://github.com/waybarrios/cyber-agent.git cd cyber-agent ``` ### 2. 连接到目标网络 ``` # 用于 HackTheBox sudo openvpn your_htb_vpn.ovpn ``` ### 3. 启动 Claude Code ``` claude ``` ### 4. 查看可用 agents ``` /agents ``` 这将显示所有可用的 agents,包括 `redteam-agent` 和 `report-agent`。 ## 使用 Agents ### Red Team Agent **目的**:针对目标执行渗透测试攻击。 **如何调用**: ``` Attack the target machine at {TARGET_IP} ``` 或显式调用: ``` Use the redteam-agent to pentest {TARGET_IP} ``` **执行操作**: 1. 展示攻击计划并等待确认 2. 执行 TCP 和 UDP 端口扫描 3. 枚举发现的服务(IKE/IPsec、SSH 等) 4. 使用发现的哈希破解凭据 5. 通过 SSH 获取初始访问权限 6. 提升权限(CVE 利用) 7. 捕获 flag(user.txt、root.txt) 8. 记录所有发现 **重要提示**: - agent 会要求您手动运行 sudo 命令(例如 UDP 扫描) - agent 在攻击过程中动态发现信息 - 没有任何内容是硬编码的 ### Report Agent **目的**:根据攻击发现生成专业的安全报告。 **如何调用**: ``` Generate the security report ``` 或显式调用: ``` Use the report-agent to create the penetration testing report ``` **生成内容**: - `PTR-{DATE}_executive.md` - 面向管理层的高管摘要(非技术性) - `PTR-{DATE}_technical.md` - 包含证据的完整技术报告 ## 攻击方法论(PTES) | 阶段 | 目标 | 工具 | |-------|-----------|-------| | 1. 侦察 | 端口扫描 | nmap | | 2. 枚举 | 服务分析 | ike-scan | | 3. 凭据攻击 | 哈希破解 | psk-crack, hashcat | | 4. 初始访问 | 远程 shell | ssh | | 5. 权限提升 | Root 访问权限 | gcc, exploits | | 6. 后渗透 | 证据收集 | - | ## 项目结构 ``` cyber-agent/ ├── README.md # This file ├── CLAUDE.md # Claude Code instructions │ ├── .claude/agents/ # Agent definitions │ ├── redteam-agent.md # Red Team Agent │ └── report-agent.md # Report Writer Agent │ ├── agents/ │ ├── redteam_agent/ # Red Team documentation │ │ ├── CONTEXT.md # Quick start guide │ │ ├── SKILLS.md # Attack procedures │ │ ├── TODO.md # Attack plan │ │ ├── output/ # Command outputs │ │ └── sessions/ # Session data │ │ │ └── report_agent/ # Report Writer documentation │ ├── CONTEXT.md # Quick start guide │ ├── SKILLS.md # Report procedures │ └── TODO.md # Report tasks │ └── reports/ # Generated reports ``` ## 阅读 Agent 技能 查看每个 agent 的功能: ``` # 在 Claude Code 中 Read agents/redteam_agent/SKILLS.md Read agents/report_agent/SKILLS.md ``` ## 会话历史 每个 agent 都会保存会话进度以保持连续性。阅读之前的会话以了解已完成的工作: ``` # Red Team Agent 会话 Read agents/redteam_agent/sessions/000_20251229_setup_session.md # Report Agent 会话 Read agents/report_agent/sessions/000_20251229_setup_session.md ``` **会话格式**:`{NNN}_{YYYYMMDD}_{target}_session.md` 会话内容包括: - 已完成的阶段/任务 - 发现的信息 - 执行的命令 - 下一步操作 ## Sudo 命令 agent 无法直接运行 sudo 命令。当命令需要提升权限时: 1. agent 会向您展示确切的命令 2. 您在终端中手动运行它 3. 您将输出粘贴回给 agent 4. agent 继续执行攻击 **示例**: ``` Agent: "I need to run a UDP scan. Please execute: sudo nmap -sU -sV -p 500,4500 {TARGET_IP}" You: [run command and paste output] Agent: [analyzes results and continues] ``` ## 涵盖的漏洞 | ID | 标题 | 严重程度 | CVSS | CVE | |----|-------|----------|------|-----| | VULN-001 | IKE 服务暴露 | MEDIUM | 5.3 | - | | VULN-002 | IKE Aggressive Mode | HIGH | 7.5 | - | | VULN-003 | Sudo 权限提升 | CRITICAL | 8.1 | CVE-2025-32463 | ## 标准与框架 - **PTES** - 渗透测试执行标准 - **OWASP OPTRS** - 渗透测试报告标准 - **MITRE ATT&CK** - 对抗战术与技术 - **CVSS v3.1** - 漏洞评分系统 ## 示例工作流 ``` ┌─────────────────────────────────────────────────────────────┐ │ ATTACK WORKFLOW │ ├─────────────────────────────────────────────────────────────┤ │ │ │ User: "Attack the machine at 10.10.11.X" │ │ │ │ │ ▼ │ │ ┌─────────────────────────────────────┐ │ │ │ redteam-agent │ │ │ │ • Shows attack plan │ │ │ │ • Waits for confirmation │ │ │ │ • Executes 6 PTES phases │ │ │ │ • Discovers credentials │ │ │ │ • Captures both flags │ │ │ └─────────────────┬───────────────────┘ │ │ │ │ │ │ attack_complete.json │ │ ▼ │ │ ┌─────────────────────────────────────┐ │ │ │ report-agent │ │ │ │ • Reads attack findings │ │ │ │ • Generates executive summary │ │ │ │ • Generates technical report │ │ │ └─────────────────┬───────────────────┘ │ │ │ │ │ ▼ │ │ reports/*.md │ │ │ └─────────────────────────────────────────────────────────────┘ ``` ## 免责声明 ⚠️ **仅供授权使用** 此工具专为以下场景设计: - HackTheBox 实验环境 - 授权的渗透测试项目 - 安全研究与教育 **严禁在未经明确书面许可的系统上使用。** ## 许可证 MIT 许可证 - 详情请参阅 [LICENSE](LICENSE)。 ## 关键词 `penetration-testing` `red-team` `claude-code` `ai-agents` `hackthebox` `cybersecurity` `ethical-hacking` `ptes` `mitre-attack` `vulnerability-assessment` `security-automation` `kali-linux` `ctf` `infosec`
标签:Claude Code, CTI, Web报告查看器, 人工智能, 实时处理, 密码管理, 用户模式Hook绕过, 网络安全评估, 网络调试, 自动化, 逆向工具, 防御加固