TarzEH/RedWeaver
GitHub: TarzEH/RedWeaver
一个基于 OpenAI Agents SDK 的多 Agent 协作自主漏洞评估平台,将 LLM 推理能力与真实安全工具结合,实现从信息收集到报告生成的全流程自动化。
Stars: 0 | Forks: 0
快速开始 •
截图 •
架构 •
Agents •
工具 •
LLM 提供商 •
许可证
## 什么是 RedWeaver?
RedWeaver 是一个自主漏洞评估平台,它将 LLM 推理与真实的安全工具相结合。您只需描述一个目标,一组 AI agents 就会协作执行侦察、爬取、模糊测试、漏洞扫描、漏洞利用分析和报告生成——所有内容都会实时流式传输到您的浏览器。
**零工具安装。** 一切都在 Docker 内部运行。您只需要一个 LLM API 密钥。
## 截图
| Dashboard |
Hunt Chat |
 |
 |
| Report |
Findings |
 |
 |
| Agent Activity |
Settings |
 |
 |
## 快速开始
```
# Clone the repo
git clone https://github.com/TarzEH/RedWeaver.git
cd RedWeaver
# 配置 API keys
cp .env.example .env
# 编辑 .env — 至少添加一个 LLM key (OpenAI, Anthropic, 或 Google)
# Build and run
docker compose up --build
# 打开 UI
open http://localhost:5173
```
在 Hunt 聊天框中输入目标 URL,agents 就会开始搜寻。
## 架构
```
┌──────────────────────────────────────────────────────────────────┐
│ Frontend (React 18 + TypeScript) │
│ Dashboard │ Hunt Chat │ Agents │ Huntflow │ Report │ Findings │
│ ▲ SSE Stream │
└─────────────────────┼────────────────────────────────────────────┘
│
┌─────────────────────┼────────────────────────────────────────────┐
│ Backend (FastAPI + OpenAI Agents SDK) │
│ │
│ ┌───────────────────────────────────────────────────────────┐ │
│ │ OpenAI Agents SDK — Runner.run() + Handoffs │ │
│ │ │ │
│ │ Orchestrator ─┬─► Recon Agent ──────► CLI Tools │ │
│ │ (handoffs) ├─► Fuzzer Agent ─────► CLI Tools │ │
│ │ ├─► Crawler Agent ────► CLI Tools │ │
│ │ ├─► Vuln Scanner ─────► Nuclei │ │
│ │ ├─► Web Search ───────► DuckDuckGo │ │
│ │ ├─► Exploit Analyst │ │
│ │ └─► Report Writer │ │
│ └───────────────────────────────────────────────────────────┘ │
│ │
│ LLM Factory ─── EventBus (pub/sub) ─── Redis Persistence │
│ OpenAI │ Anthropic │ Google │ Ollama │
└───────────────────────────────────────────────────────────────────┘
│
┌─────────────────────┼────────────────────────────────────────────┐
│ Docker (Security Tools) │
│ nmap · subfinder · httpx · nuclei · nikto · ffuf │
│ gobuster · katana · whatweb · theHarvester │
└───────────────────────────────────────────────────────────────────┘
```
### 工作原理
1. **您描述一个目标** — "Scan example.com for vulnerabilities"(扫描 example.com 的漏洞)
2. **Orchestrator(编排者)规划搜寻** — 决定通过 handoffs 调用哪些 agents 以及调用顺序
3. **Agents 并行/顺序执行** — 第一阶段并行运行 recon + fuzzer(agent-as-tool 模式),然后通过顺序 handoffs 链接 crawler → scanner → search → analyst → reporter
4. **发现结果实时流式传入** — SSE 将每个工具调用、思考和发现推送到 UI
5. **生成报告** — 包含严重等级和修复建议的专业漏洞评估
## Agent 流水线
| 阶段 | Agent | 模式 | 功能 |
|:-----:|-------|------|-------------|
| 0 | **Orchestrator** | Manager | 规划搜寻任务,调度所有 agents |
| 1 | **Recon** | Parallel | 子域名枚举、端口扫描、技术指纹识别 |
| 1 | **Fuzzer** | Parallel | 目录暴力破解、路径发现 |
| 2 | **Crawler** | Sequential | 端点发现、JS 分析、表单提取 |
| 3 | **Vuln Scanner** | Sequential | 针对已知 CVE 的 Nuclei 模板扫描 |
| 4 | **Web Search** | Sequential | OSINT — CVE 查询、漏洞利用数据库、公开披露信息 |
| 5 | **Exploit Analyst** | Sequential | 攻击链关联、风险评估 |
| 6 | **Report Writer** | Sequential | 包含修复建议的 Markdown 漏洞报告 |
## 工具
所有工具均在 Docker 容器内作为 CLI 二进制文件运行——无需外部账户或付费 API。
| 工具 | 类别 | 用途 |
|------|----------|---------|
| [nmap](https://nmap.org/) | Recon | 端口扫描、服务检测 |
| [subfinder](https://github.com/projectdiscovery/subfinder) | Recon | 子域名枚举 |
| [httpx](https://github.com/projectdiscovery/httpx) | Recon | HTTP 探测、技术检测 |
| [whatweb](https://github.com/urbanadventurer/WhatWeb) | Recon | Web 技术指纹识别 |
| [theHarvester](https://github.com/laramies/theHarvester) | OSINT | 邮箱、子域名、IP 收集 |
| [nuclei](https://github.com/projectdiscovery/nuclei) | Scanning | 基于模板的漏洞扫描 |
| [nikto](https://github.com/sullo/nikto) | Scanning | Web 服务器错误配置扫描器 |
| [ffuf](https://github.com/ffuf/ffuf) | Fuzzing | 用于目录和参数的 Web fuzzer |
| [gobuster](https://github.com/OJ/gobuster) | Fuzzing | 目录/DNS 暴力破解 |
| [katana](https://github.com/projectdiscovery/katana) | Crawling | 用于端点发现的 Web 爬虫 |
## LLM 提供商
RedWeaver 支持多种 LLM 提供商。可通过 `.env` 或运行时的 **Settings** UI 进行配置。
| 提供商 | 模型 | 密钥变量 |
|----------|--------|-------------|
| **OpenAI** | GPT-5.4, GPT-4.1, GPT-4o, GPT-4o-mini | `OPENAI_API_KEY` |
| **Anthropic** | Claude Opus 4.6, Sonnet 4.6, Haiku | `ANTHROPIC_API_KEY` |
| **Google** | Gemini 3.1, Gemini 3, Gemini 2.5 | `GOOGLE_API_KEY` |
| **Ollama** | Llama 3.3, Mistral, Qwen (local) | `OLLAMA_BASE_URL` |
## 环境变量
| 变量 | 必需 | 描述 |
|----------|:--------:|-------------|
| `OPENAI_API_KEY` | * | OpenAI API 密钥 |
| `ANTHROPIC_API_KEY` | * | Anthropic API 密钥 |
| `GOOGLE_API_KEY` | * | Google Gemini API 密钥 |
| `OLLAMA_BASE_URL` | No | Ollama 服务器 URL (默认: `http://host.docker.internal:11434`) |
| `REDIS_URL` | No | Redis 连接 (默认: `redis://redis:6379/0`) |
| `CORS_ORIGINS` | No | 允许的 CORS 来源 (默认: `*`) |
## 项目结构
```
RedWeaver/
├── backend/
│ └── app/
│ ├── agents/ # 8 agent definitions + orchestrator
│ ├── api/ # FastAPI routes (chat, stream, runs, reports, settings)
│ ├── core/ # Config, EventBus, LLM factory, dependency injection
│ ├── graph/ # Static agent topology for frontend visualization
│ ├── models/ # Pydantic models (Run, Finding, GraphState)
│ ├── reports/ # Report data generation
│ ├── repositories/ # Redis-persisted data stores
│ ├── services/ # Hunt execution, chat, keys management
│ └── tools/
│ └── cli/ # BaseCLITool ABC + 10 tool wrappers
├── frontend/
│ └── src/
│ ├── components/
│ │ └── report/ # 7 report sub-components
│ ├── config/ # Provider/model definitions
│ ├── contexts/ # HuntProvider (shared SSE state)
│ ├── hooks/ # useSSE, useRunStream, useHuntflowTree
│ └── types/ # TypeScript interfaces (API, events)
├── docker-compose.yml # Redis + backend + frontend + Redis Insight
├── Dockerfile # Backend with all security tools
└── .env.example # Environment configuration template
```
## 关键设计决策
- **OpenAI Agents SDK** — 使用带有 handoffs 的 `Runner.run()` 编排 8-agent 流水线,以实现顺序委托,并通过 agent-as-tool 实现并行执行(recon + fuzzer 并行运行,然后通过 handoffs 链接 crawler → scanner → search → analyst → reporter 链)。
- **多提供商 LLM 工厂** — 自动检测可用的 API 密钥,支持 OpenAI、Anthropic、Google Gemini 和 Ollama,并支持运行时模型选择。
- **BaseCLITool ABC** — 每个安全工具都实现 `build_command()` + `parse_output()`。带有超时处理的异步子进程执行。
- **EventBus** — 具有每次运行队列的异步发布/订阅单例。支持在尚无 SSE 订阅者连接时进行缓冲。
- **Redis 持久化** — 运行记录、发现结果、图状态和 API 密钥在容器重启后依然保留。
- **基于组件的报告** — 7 个专用 React 组件渲染专业的渗透测试报告,包含风险徽章、严重程度甜甜圈图、攻击面表格和 agent 活动可视化。
## 开发
```
# Backend (需要 Python 3.11+)
cd backend
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000
# Frontend (需要 Node 20+)
cd frontend
npm install
npm run dev
```
或者全部使用 Docker:
```
docker compose up --build
```
## 免责声明
RedWeaver 是一个安全研究和教育工具。**仅对您拥有或明确获得测试授权的目标使用它。** 在大多数司法管辖区,未经授权的漏洞扫描是非法的。作者不对任何滥用行为负责。
## 许可证
[MIT](LICENSE) © 2025-2026 Ori Ashkenazi
标签:AES-256, AI安全, AutoGPT类工具, Bug Bounty, Chat Copilot, CISA项目, Docker容器化, LLM推理, OpenAI Agents SDK, PyRIT, Python, React, Syscalls, Web安全, 可自定义解析器, 域名收集, 多智能体系统, 安全侦察, 实时流传输, 密码管理, 开源安全项目, 插件系统, 搜索引擎查询, 无后门, 漏洞评估, 网络安全, 网络安全审计, 自动化渗透测试, 蓝队分析, 请求拦截, 逆向工具, 隐私保护