theoffsecgirl/bb-copilot

GitHub: theoffsecgirl/bb-copilot

一款基于大语言模型的漏洞赏金辅助工具,以结构化方式引导分析并生成报告。

Stars: 0 | Forks: 0

# bb-copilot **AI-powered bug bounty assistant — methodology vault + guided CLI** ![Language](https://img.shields.io/badge/Python-3.12+-9E4AFF?style=flat-square&logo=python&logoColor=white) ![Version](https://img.shields.io/badge/version-0.1.0-9E4AFF?style=flat-square) ![License](https://img-shields.com/badge/License-MIT-9E4AFF?style=flat-square) ![LLM](https://img-shields.com/badge/LLM-Ollama%20%7C%20Groq%20%7C%20OpenAI%20%7C%20Anthropic-111111?style=flat-square) ![Category](https://img-shields.com/badge/Category-Bug%20Bounty%20%7C%20AI%20Tooling-111111?style=flat-square) *by [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 ``` ## 它做什么 - Reads your local vault (Markdown playbooks by vuln type and phase) - Sends the right context + your input to the configured model - Returns structured, actionable output: hypotheses → steps → evidence → impact - Generates complete reports ready to submit to HackerOne, Bugcrowd or YesWeHack - Saves local history of all sessions in `~/.bbcopilot/history/` - Does NOT automate attacks. Guides your reasoning. ## 堆栈 - Python 3.12+ - [Typer](https://typer.tiangolo.com/) + [Rich](https://github.com/Textualize/rich) - Any OpenAI-compatible LLM API: **Ollama, Groq, OpenAI, Anthropic** - Markdown vault (local, Git-versioned) - Local JSON history (`~/.bbcopilot/history/`) ## 安装 ``` git clone https://github.com/theoffsecgirl/bb-copilot cd bb-copilot make setup ``` Then edit `.env` according to your chosen provider (see **LLM Providers** section). ## LLM 提供商 | Provider | Cost | Privacy | Setup | |---|---|---|---| | **Ollama** (default) | Free | Local — 100% private | `brew install ollama` | | Groq | Free (limited tier) | Cloud | API key at console.groq.com | | OpenAI | Paid | Cloud | API key at platform.openai.com | | Anthropic | Paid | Cloud | API key at console.anthropic.com | ### 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(免费,云端) Note: free tier has ~6000 token context limit. Add to `.env`: ``` BBCOPILOT_MAX_CONTEXT_TOKENS=5000 ``` ### OpenAI ``` OPENAI_API_KEY=sk-proj-... OPENAI_BASE_URL=https://api.openai.com/v1 OPENAI_MODEL=gpt-4o ``` ## 用法 ``` # 使用完整保险库作为上下文提出自由形式问题 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 # 特定漏洞的剧本 bbcopilot vuln ssrf bbcopilot vuln idor --context my-notes.txt # 对发现进行分步处理并给出后续步骤 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 # 列出所有可用剧本 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= Confidence: HIGH 2. JWT algorithm confusion (RS256 → HS256) → Decode JWT, modify alg header, re-sign with public key as secret Confidence: MEDIUM 3. Missing org_id validation on bulk endpoints → POST /api/v1/export — does it check org_id ownership? Confidence: MEDIUM 🔎 Next steps 1. Enumerate all endpoints accepting org_id 2. Create two test accounts in different orgs 3. Cross-org request matrix 💾 Session saved → ~/.bbcopilot/history/2026-04-17_ask_001.json ``` ### `bbcopilot report` ``` $ bbcopilot report --finding "IDOR on /api/v1/invoices/{id} exposes other users invoices" --target api.target.com ╭─ Generating report ──────────────────────────────────────────────────╮ │ Vuln: IDOR │ Target: api.target.com │ Format: HackerOne Markdown │ ╰───────────────────────────────────────────────────────────────────────╯ ## 总结 Insecure Direct Object Reference on `/api/v1/invoices/{id}` allows authenticated users to access invoices belonging to other accounts by incrementing the `id` parameter. ## 重现步骤 1. Log in as user A, create an invoice → note ID (e.g. 1042) 2. Log in as user B 3. Send: GET /api/v1/invoices/1041 4. Observe: invoice data from user A is returned ## 影响 Full read access to all invoices across all accounts. Estimated severity: **High** (CVSS 8.1) [+] Report saved → report.md ``` ## 命令 | Command | Input | Output | |---|---|---| | `ask` | Free-form observation | Prioritized hypotheses + steps | | `plan` | Target + type | Full attack plan | | `vuln` | Vuln class + optional context | Playbook + what to test | | `triage` | Finding description | Severity + evidence + next steps | | `report` | Finding + optional context | Full report (Markdown) | | `history` | — | Last sessions in table | | `vault-list` | — | List of available playbooks | ## 保险库结构 ``` vault/ ├── methodology/ # Recon, asset triage, JS analysis, API hunting, reporting ├── vulns/ # Playbook per vulnerability class ├── patterns/ # Auth bypass, multi-tenant, role confusion, race conditions └── prompts/ # System prompt and model rules ``` ## 涵盖的漏洞 `IDOR` · `SSRF` · `XSS` · `SQLi` · `Open Redirect` · `File Upload` · `Subdomain Takeover` · `Business Logic` · `CORS` · `XXE` · `SSTI` · `OAuth` ## Makefile ``` make setup # Full initial setup make install # Dependencies only make dev # Dependencies + dev (pytest, ruff) make test # Run tests make lint # Linter make format # Format code make vault # List vault make ask Q="your question" # Quick query make clean # Clean caches ``` ## 历史 All sessions are automatically saved to `~/.bbcopilot/history/` in JSON format. Disable with `--no-save` on any command. ## 哲学 - Result over explanation - Always structured: hypotheses → checks → evidence → impact - The vault is the brain. The model is the engine. - No black boxes. The knowledge is yours. By [@theoffsecgirl](https://github.com/theoffsecgirl)
标签:AI风险缓解, Anthropic, Bugcrowd, CIS基准, DLL 劫持, HackerOne, Homebrew安装, JSON存储, LLM, LLM评估, Markdown, Ollama, OpenAI, Python, Rich, Ruby, Typer, Unmanaged PE, YesWeHack, 二进制发布, 内存规避, 大语言模型, 安全辅助, 开源工具, 无后门, 本地历史, 漏洞方法论, 环境配置, 知识库, 自动化辅助, 逆向工具, 防御加固