theoffsecgirl/bb-copilot
GitHub: theoffsecgirl/bb-copilot
一款基于大语言模型的漏洞赏金辅助工具,以结构化方式引导分析并生成报告。
Stars: 0 | Forks: 0
# bb-copilot
**AI 驱动的 Bug Bounty 助手 — 方法论知识库 + 向导式 CLI**





*由 [theoffsecgirl](https://github.com/theoffsecgirl) 提供*
```
bbcopilot ask "api.target.com uses JWT and org_id in every request"
bbcopilot plan --target api.target.com --type api
bbcopilot vuln idor --context notes.txt
bbcopilot triage --finding "IDOR on /api/v1/invoices/{id}"
bbcopilot report --finding "IDOR on /api/v1/invoices/{id}" --target api.target.com -o report.md
```
## 它的功能
- 读取本地知识库(按漏洞类型和阶段分类的 Markdown playbook)
- 将正确的上下文 + 你的输入发送到配置的模型
- 返回结构化、可操作的输出:假设 → 步骤 → 证据 → 影响
- 生成准备提交至 HackerOne、Bugcrowd 或 YesWeHack 的完整报告
- 将所有会话的本地历史记录保存在 `~/.bbcopilot/history/`
- 不会自动化攻击。而是引导你的推理过程。
## 技术栈
- Python 3.12+
- [Typer](https://typer.tiangolo.com/) + [Rich](https://github.com/Textualize/rich)
- 任何兼容 OpenAI 的 LLM API:**Ollama, Groq, OpenAI, Anthropic**
- Markdown 知识库(本地,由 Git 进行版本控制)
- 本地 JSON 历史记录(`~/.bbcopilot/history/`)
## 安装
```
git clone https://github.com/theoffsecgirl/bb-copilot
cd bb-copilot
make setup
```
然后根据你选择的提供商修改 `.env`(参见 **LLM Providers** 部分)。
## LLM Providers
| Provider | 费用 | 隐私 | 设置 |
|---|---|---|---|
| **Ollama**(默认) | 免费 | 本地 — 100% 私有 | `brew install ollama` |
| Groq | 免费(有限层级) | 云端 | 在 console.groq.com 获取 API key |
| OpenAI | 付费 | 云端 | 在 platform.openai.com 获取 API key |
| Anthropic | 付费 | 云端 | 在 console.anthropic.com 获取 API key |
### Ollama(默认)
```
brew install ollama
ollama pull llama3.1 # ~4GB, one-time
ollama serve # run in background
```
`.env`:
```
OPENAI_API_KEY=ollama
OPENAI_BASE_URL=http://localhost:11434/v1
OPENAI_MODEL=llama3.1
```
### Groq(免费,云端)
注意:免费层级有约 6000 token 的上下文限制。请添加到 `.env`:
```
BBCOPILOT_MAX_CONTEXT_TOKENS=5000
```
### OpenAI
```
OPENAI_API_KEY=sk-proj-...
OPENAI_BASE_URL=https://api.openai.com/v1
OPENAI_MODEL=gpt-4o
```
## 用法
```
# 以整个 vault 为上下文的自由提问
bbcopilot ask "target has GraphQL with user_id in mutations"
# 针对特定目标的优先攻击计划
bbcopilot plan --target example.com --type web
bbcopilot plan --target api.example.com --type api
# 针对特定漏洞的 playbook
bbcopilot vuln ssrf
bbcopilot vuln idor --context my-notes.txt
# 对 finding 进行分类并提供后续步骤
bbcopilot triage --finding "open redirect on /redirect?url="
# 生成可直接提交的完整报告
bbcopilot report --finding "IDOR on /api/v1/invoices/{id} exposes other users' invoices"
bbcopilot report --finding "..." --target api.example.com --context requests.txt --output report.md
# 会话历史
bbcopilot history
bbcopilot history --last 5
bbcopilot history --clear
# 列出所有可用的 playbook
bbcopilot vault-list
```
## 输出示例
### `bbcopilot ask`
```
$ bbcopilot ask "api.target.com uses JWT and org_id in every request"
╭─ bb-copilot ─────────────────────────────────────────────────────────╮
│ Context loaded: 8 playbooks (idor, auth, jwt, api, cors, ssrf, biz) │
╰───────────────────────────────────────────────────────────────────────╯
📌 Hypotheses (prioritized)
1. IDOR via org_id manipulation
→ Replace org_id in requests with another org's ID
→ Test: GET /api/v1/invoices?org_id=标签:AI助手, Python, 命令行工具, 安全测试, 攻击性安全, 无后门, 漏洞报告, 漏洞赏金