BugHound MCP
MCP-Based Security Automation Framework
Black Hat Arsenal Asia 2026 | 45 Techniques | 35 Vuln Classes | 3 Modes
______________________________________________________________________
BugHound是一个模型上下文协议(MCP)服务器,为web应用程序安全侦察和漏洞评估提供了一个完整的管道。它将结构化安全工具作为MCP端点公开,使AI客户端(Claude、Gemini、Codex)能够编排从目标输入到验证漏洞报告的7级管道。BugHound附带了45种测试技术,其中29种是纯Python,不需要任何外部工具,涵盖了注入、访问控制、服务器端、配置和数据泄漏漏洞类。
特性
- 7级管道 --初始化、枚举、发现、分析、测试、验证、报告——阶段根据目标类型折叠
- 45测试技术 --纯Python在每个类别中都有回退;启动时不需要外部工具
- 3种执行模式 --MCP服务器(用于AI客户端)、CLI(用于终端工作流)、AI代理(自主扫描)
- 专业HTML报告 --带有过滤、导出和执行摘要的深青色仪表板
- 身份验证测试 --JWT在所有测试技术中的自动传播
- 实时反射探头 --发现过程中实时XSS反射检测
- 攻击链检测 --多步综合评分开发路径
- 范围执行 --在任何主动测试之前进行强制性范围验证
- 自适应工具覆盖范围 --当外部工具不可用时,优雅地适应
快速开始
git clone https://github.com/binderlabs/BugHound-MCP.git
cd BugHound
pip install -r requirements.txt
./scripts/install-tools.sh # Optional: install Go/external tools
# Mode 1: MCP Server
python -m bughound.server
# Mode 2: CLI
./bhound scan https://target.com
./bhound scan https://target.com -v
./bhound scan https://target.com --profile client # quick wins only
./bhound recon https://target.com
./bhound list
# Mode 3: AI Agent
./bhound agent https://target.com --provider openrouter --api-key sk-or-...安装
Python依赖关系
pip install -r requirements.txt核心依赖关系: mcp, pydantic, aiohttp, aiofiles, structlog
可选(用于代理模式): anthropic, openai
外部安全工具(可选)
BugHound使用29种纯Python技术,不使用任何外部工具。要获得完整覆盖(43种技术),请安装以下内容:
| 工具 | 用途 | 安装 |
|---|---|---|
| 细胞核 | 基于模板的扫描 | go install github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest |
| httpx | HTTP探测 | go install github.com/projectdiscovery/httpx/cmd/httpx@latest |
| katana | 网络爬行 | go install github.com/projectdiscovery/katana/cmd/katana@latest |
| subinder | 子域发现 | go install github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest |
| gau | URL发现 | go install github.com/lc/gau/v2/cmd/gau@latest |
| waybackurls | 存档URL | go install github.com/tomnomnom/waybackurls@latest |
| sqlmap | SQLi验证 | apt install sqlmap 或 pip install sqlmap |
| dalfox | XSS验证 | go install github.com/hahwul/dalfox/v2@latest |
| ffuf | 目录模糊 | go install github.com/ffuf/ffuf/v2@latest |
| arjun | 参数发现 | pip install arjun |
| wafw00f | WAF检测 | pip install wafw00f |
| 剧作家 | DOM XSS检测(无头浏览器) | pip install playwright && playwright install chromium |
| assetfinder | 子域发现 | go install github.com/tomnomnom/assetfinder@latest |
| findomain | 子域发现 | 从下载 |
| gotator | 子域置换 | go install github.com/Josue87/gotator@latest |
| puredns | DNS解析 | go install github.com/d3mondev/puredns/v2@latest |
自动安装:
./scripts/install-tools.sh # Core + recon + python + seclists (recommended)
./scripts/install-tools.sh --minimal # Core Go tools only (httpx/nuclei/katana/subfinder/ffuf/dnsx)
./scripts/install-tools.sh --full # Everything + assetnote wordlists (~1GB download)安装程序是幂等的,可以安全地重新运行。每个工具在安装后都经过验证;最后一个清晰的摘要显示了安装/跳过/失败的数量。如果任何工具发生故障,脚本将继续(与旧版本不同),并仅打印故障工具的诊断。
如果你的朋友(或你)点击“脚本已运行,但工具未实际安装”,请重新运行 ./scripts/install-tools.sh --新版本显式检查 command -v 安装和报告后的每个工具 [x] 真正的失败。不再沉默PEP-668/ set -e 中止问题。
用于更好的子域覆盖的API密钥(可选)
BugHound的子域枚举使用 subfinder,支持通过API密钥的被动数据源。如果没有密钥,您仍然可以从免费来源(crtsh、HackerTarget、CertSpotter)获得结果。使用密钥,您可以获得更多的子域。
在中配置 ~/.config/subfinder/provider-config.yaml:
chaos:
- your-chaos-api-key
virustotal:
- your-virustotal-api-key
securitytrails:
- your-securitytrails-api-key
shodan:
- your-shodan-api-key
censys:
- your-censys-api-key| 来源 | 注册 | 免费? |
|---|---|---|
| 混沌(项目发现) | chaos.projectdiscovery.io | 是的 |
| 病毒总数 | virustotal.com | 是的 |
| 安全追踪 | securitytrails.com | 是(50个查询/月) |
| 人口普查 | search.censys.io | 是(250次查询/月) |
| Shodan 。 shodan.io | 付费(终身49美元) |
Chaos还需要一个环境变量:
echo 'export CHAOS_API_KEY="your-key"' >> ~/.zshrc && source ~/.zshrcBugHound-native API密钥(~/.gau.toml)
BugHound自己的侦察模块(混沌子域源、GitHub侦察、URLScan、AlienVault OTX)从 ~/.gau.toml 因此,它们在工具之间共享:
[urlscan]
apikey = "..."
[otx]
apikey = "..."
[chaos]
apikey = "..."
[github]
apikey = "ghp_..." # read:public_repo is enough环境变量(CHAOS_API_KEY, PDCP_API_KEY, GITHUB_TOKEN, GH_TOKEN)被视为后备方案。如果找不到令牌,则会自动跳过GitHub recon和混沌子域查找。
MCP配置
克劳德代码
创建 .mcp.json 在项目根目录中:
{
"mcpServers": {
"bughound": {
"type": "stdio",
"command": "python3",
"args": ["-m", "bughound.server"],
"cwd": "/path/to/BugHound",
"env": {
"PYTHONPATH": "/path/to/BugHound",
"BUGHOUND_WORKSPACE_DIR": "/path/to/workspaces"
}
}
}
}或者通过CLI添加: claude mcp add --transport stdio --scope project bughound -- python3 -m bughound.server
Gemini CLI
添加 ~/.gemini/settings.json 或 .gemini/settings.json 在您的项目中:
{
"mcpServers": {
"bughound": {
"command": "python3",
"args": ["-m", "bughound.server"],
"cwd": "/path/to/BugHound",
"env": {
"PYTHONPATH": "/path/to/BugHound",
"BUGHOUND_WORKSPACE_DIR": "/path/to/workspaces"
},
"timeout": 600000
}
}
}OpenAI 代码专家
添加 ~/.codex/config.toml 或 .codex/config.toml 在您的项目中:
[mcp_servers.bughound]
command = "python3"
args = ["-m", "bughound.server"]
cwd = "/path/to/BugHound"
startup_timeout_sec = 30
tool_timeout_sec = 300
[mcp_servers.bughound.env]
PYTHONPATH = "/path/to/BugHound"
BUGHOUND_WORKSPACE_DIR = "/path/to/workspaces"MCP工具参考
BugHound公开了约30个按功能组织的MCP工具(加上6个仅用于反FP/工作流探索的代理模式原语):
| 工具 | 说明 |
|---|---|
bughound_init | 初始化工作区——分类目标,创建工作区 |
bughound_enumerate | 第一阶段:子域发现(子查找器、资产查找器、crtsh、被动API) |
bughound_enumerate_deep | 第1阶段深度:主动枚举+DNS暴力(后台作业) |
bughound_discover | 第二阶段:全面发现——探测、抓取、JS分析、目录扫描、参数分类 |
bughound_get_attack_surface | 第三阶段:使用链进行攻击面分析,立即获胜,推理提示 |
bughound_submit_scan_plan | 提交测试策略(目标+测试类) |
bughound_execute_tests | 第四阶段:根据扫描计划运行所有技术(后台作业) |
bughound_test_single | 一种技术在一个终点上的手术测试 |
bughound_nuclei_scan | 具有自定义选项的直接细胞核扫描 |
bughound_list_techniques | 列出所有48种可用技术(可选 test_profile 过滤器) |
bughound_list_pipelines | 表17单线管道 |
bughound_run_pipeline | 运行单线管道(gf+qsreplace+kxss等) |
bughound_validate_all | 第5阶段:批量验证所有发现(后台作业) |
bughound_validate_finding | 验证一个特定的发现 |
bughound_validate_immediate_wins | 验证第三阶段的即时胜利 |
bughound_generate_report | 第6阶段:生成HTML+降价报告 |
bughound_analyze_host | 对特定主机的深入分析 |
bughound_enrich_target | 主机的情报档案 |
bughound_get_immediate_wins | 无需测试即可准备好报告结果 |
bughound_scope_check | 验证目标是否在范围内 |
bughound_check_tool_coverage | 检查已安装的安全工具 |
bughound_workspace_list | 列出所有工作区 |
bughound_workspace_get | 获取工作区详细信息 |
bughound_workspace_results | 查看工作区结果仪表板 |
bughound_workspace_delete | 删除工作区 |
bughound_job_status | 检查后台作业进度 |
bughound_job_results | 获取已完成的作业结果 |
bughound_job_cancel | 取消正在运行的作业 |
AI客户端使用提示
通过AI客户端(Claude、Gemini、Codex)使用BugHound时,请使用自然语言提示:
基本扫描:
Scan https://target.com for vulnerabilities using BugHound一步一步地:
1. Initialize BugHound for https://target.com
2. Run discovery
3. Show me the attack surface
4. Create a scan plan focused on SQLi and XSS
5. Execute the tests
6. Validate the findings
7. Generate a report快速侦察:
Run BugHound recon on example.com and show me what you find目标测试:
Test https://target.com/api/search?q=test for SQL injection using BugHoundCLI 参考
./bhound scan # Full pipeline (Stages 0-6)
./bhound scan -v # Verbose mode (show all activity)
./bhound scan --depth deep # Deep scan
./bhound scan --profile client # Client-side bugs only (XSS, CORS, redirect, CSP)
./bhound scan --profile server # Server-side bugs only (SQLi, SSRF, RCE, LFI, XXE, auth)
./bhound scan --profile both # Full coverage (default; also prompts interactively if omitted)
./bhound scan --skip-validate # Skip validation stage
./bhound scan --skip-nuclei # Skip nuclei scanning
./bhound scan --resume # Resume crashed scan
./bhound scan --output json # JSON output for CI/CD
./bhound scan --max-hosts 5 # Auto-select top 5 hosts (broad domains)
./bhound scan --no-color # No terminal colors
./bhound scan -q # Quiet mode (summary only)
./bhound recon # Discovery only (Stages 0-2)
./bhound recon --max-hosts 3 # Recon top 3 hosts only
./bhound analyze # Attack surface analysis
./bhound test # Run tests on existing recon
./bhound test --profile client # Test only client-side classes
./bhound validate # Validate findings
./bhound report # Generate reports
./bhound list # List workspaces
./bhound agent --provider ... # AI agent mode
./bhound agent --profile server # Agent mode restricted to server-side tests
./bhound serve # Start MCP server测试剖面
在浏览器端和服务器端错误之间进行分割测试,以减少扫描时间:
| 配置文件 | 类 | 使用时 |
|---|---|---|
client | XSS(所有变体)、开放重定向、CORS、CSTI、原型污染、CSP/安全标头、点击劫持 | 速赢、漏洞赏金分类、生产安全扫描 |
server | SQLi、SSRF、RCE、LFI、XXE、SSTI、IDOR、BAC、JWT、反序列化、认证旁路、CMS、速率限制 | 深度认证/注入工作,速度较慢,但涵盖了基于盲/时间的错误 |
both | 全部(默认) | 全面评估 |
第0-3阶段(侦察+攻击面)始终以相同的方式运行——配置文件仅过滤第4阶段的测试。混合检查(核心、易受攻击的组件、安全标头)在每个配置文件中运行。
从MCP调用时:
bughound_execute_tests(workspace_id, test_profile="client")
bughound_list_techniques(test_profile="server")
# or inside the scan plan:
bughound_submit_scan_plan(workspace_id, {
"targets": [...],
"global_settings": {"test_profile": "client"}
})速度模式
调整目标WAF配置文件的并发性:
| 模式 | 标志 | 使用时 |
|---|---|---|
stealth | --stealth | Cloudflare/Akamai背后的真正漏洞赏金目标——钳核率≤10,每种技术并发5,低并行性 |
normal | (默认) | 大多数目标--平衡:核速率100,每种技术并发15 |
fast | --fast | 实验室目标/拥有的基础设施-曲柄核率250+,每种技术并发30,4个重型插槽 |
工作在 scan, test,以及 agent 命令。相互排斥。自由组合 --profile:
./bhound scan --profile client --fast # 5-10× faster than default on labs
./bhound scan --stealth # slow + safe for bounty
./bhound agent --profile server --stealth # AI agent, server-only, stealth rate扩展侦察源
第二阶段的发现现在包括亚探测器+高斯以外的其他被动/主动源:
- 混沌数据集 (ProjectDiscovery)——精心策划的BB子域语料库。免费套餐。需求
[chaos]钥匙。 - GitHub侦察 --在GitHub代码中搜索
"" extension:env,password,api_key等等。使用内联正则表达式从结果片段中提取秘密。可选的深度模式克隆org repos并运行trufflehog。需求[github]令牌。 - 云桶发现 --S3/AAzure Blob/GCS/DO空间置换+探测。从域+发现的子域生成桶名称候选。将可公开列出的存储桶报告为严重级别高。
- 扩展灵敏路径探头 --172条路径涵盖env变体(
.env.dev,.env.staging),框架配置(appsettings.json,application.yml),凭证(.aws/credentials,.ssh/id_rsa),git/svn暴露,备份模式(backup.7z,database.sql.gz)、弹簧执行器、Next.js泄漏、CI/CD工件(Jenkinsfile,.gitlab-ci.yml). - 分层单词表选择 --自动选择资产注释/秒列表筏介质
--depth light,木筏大--depth deep当未安装SecLists时,会回退到dirbuster介质(86k)。
SPA(单页应用程序)处理
现代网络应用程序提供了一个空的HTML框架,比如:
传统的爬虫什么也看不见——零表单、零链接、零内容。第二阶段现在检测到这一点并旋转:
- SPA检测 --通过体空+脚本模式+框架签名识别React/Vue/Angular/Next/Vite/CRA/Nuxt/Gatsby/Remix/Svelte Kit骨架。
- 路由器配置提取 --从下载的JS包中解析React Router/Vue Router/Angular Router定义,显示如下路由
/users/:id,/admin/dashboard静态爬行会错过。 - GraphQL操作提取 --抢夺
gql\查询。.. \`/突变。..\`捆绑包中的操作名称。 - 通用后端探测器 -尝试30多个典型的SPA API路径(
/api/health,/api/me,/graphql,/graphiql,/api/config,/.well-known/openid-configuration,/actuator/*通过内容类型+主体信号滤波来躲避SPA回退200秒。
结果输入 all_urls因此,下游阶段(参数发现、核、测试)可以看到真正的攻击面。产出土地:
hosts/spa_detection.json--哪些主机是SPA+框架+信任urls/spa_routes.json--提取客户端路由urls/spa_backends.json--发现后端端点urls/graphql_operations.json--GraphQL操作名称
代理模式高级图元
./bhound agent 现在,AI可以调用反FP和工作流探索工具:
| 工具 | 目的 |
|---|---|
verify_not_honeytoken | 使用安全与注射有效载荷回放URL;在“vuln”是静态模拟响应的情况下杀死FP(在故意易受攻击的实验室中很常见)。在确认SQLi/LFI/RCE/SSTI之前使用。 |
detect_url_auth | 在URL反模式中标记身份验证(?UserName=, ?token=)--严重性高,凭据通过历史记录/引用者/日志泄漏。 |
test_viewstate_binding | ASP。NET WebForms--捕获 __VIEWSTATE 在一个会话中回放另一个会话。如果接受→ CSRF令牌可以回放。 |
capture_workflow | 剧作家浏览器+网络录制。执行点击/输入/导航操作序列,返回所有捕获的请求(方法、URL、帖子正文,包括隐藏的 __VIEWSTATE/CSRF令牌、设置Cookie)。对于理解多步骤流程至关重要。 |
submit_form | 解析表单,保留隐藏字段,提交覆盖。返回完整的往返行程,包括会话cookie检测和重定向标记中的URL认证。 |
record_user_story | 将结构化的探索结果(人物角色、路线、带有有效载荷的API、注释、后续候选)保存到 workspace//agent/user_stories.json. |
对于宽域目标(例如。, *.example.com),BugHound枚举子域并用httpx探测它们。在CLI模式下,系统会提示您选择要扫描的实时主机:
Found 9 live hosts:
1. [200] https://blog.example.com [WordPress]
2. [200] https://mail.example.com Login form
3. [200] https://api.example.com [Express, Node.js]
4. [403] https://cdn.example.com [CloudFront]
...
Options:
3 -- scan only host #3
1,3,5 -- scan specific hosts
1-10 -- scan hosts 1 through 10
all -- scan all 9 hosts
Select [all]: 1,2,3
Selected 3 host(s) -- continuing scan使用 --max-hosts N 跳过提示并自动选择前N个主机。
AI代理模式
BugHound的代理模式结合 CLI扫描速度 随着 AI验证深度。它首先运行所有45种自动化技术,然后由6名专业专家组成的人工智能单独验证每一项发现——发送目标有效载荷、阅读页面、确认或拒绝每一项。没有发现未经证实。
混合方法: CLI广度+AI深度
Phase 1: Automated Recon (Stages 0-3) → discover attack surface
Phase 2: Automated Testing (45 techniques) → find vulnerabilities fast
Phase 3: AI Validation + Discovery → verify each finding, reject false positives
Phase 4: Report Generation → professional deliverables6名专家: SQLi(5个DB提取剧本)、XSS(6个注入上下文)、LFI(配置文件优先级列表)、SSRF(云元数据+旁路)、RCE(每种语言评估)、Auth(登录旁路+JWT)。
12个人工智能工具: read_page, browse_page (剧作家), run_tool (Kali工具), http_request, extract_sqli_data, read_file_via_lfi, update_finding_status, add_finding, get_findings, get_attack_surface, validate_findings, generate_report
# Using OpenRouter (access to all models)
./bhound agent https://target.com --provider openrouter --model openai/gpt-5.4-mini
# Using .env file for API key
echo "OPENROUTER_API_KEY=sk-or-..." > .env
./bhound agent https://target.com --provider openrouter
# Supported providers
--provider anthropic # Claude (native SDK)
--provider openai # GPT-4o
--provider grok # Grok-3 (xAI)
--provider openrouter # Any model via OpenRouterAI在CLI之外添加了什么:
CLI scan: 36 findings, all PENDING — needs human review
Agent mode: 36 findings → 22 CONFIRMED, 12 FALSE POSITIVE, 2 MANUAL REVIEW
AI sent 27 http_requests to verify each finding individually管道结构
Stage 0: Init --> Target classification + workspace
Stage 1: Enumerate --> Subdomain discovery (skipped for single hosts)
Stage 2: Discover --> Probe, crawl, JS analysis, dir scan, param classification
Stage 3: Analyze --> Attack surface, chains, immediate wins, scan plan
Stage 4: Test --> 45 techniques in parallel (nuclei + pure-Python)
Stage 5: Validate --> Surgical verification (sqlmap, dalfox, curl)
Stage 6: Report --> HTML dashboard, bug bounty MD, executive summary基于目标类型的阶段崩溃:
- 广泛的领域 (
*.example.com):所有阶段都运行 - 单个主机 (
dev.example.com):跳过第一阶段,第二阶段从探测开始 - 单端点 (
https://dev.example.com/api):跳过第一阶段,第二阶段仅从路径爬行 - 网址列表:跳过第一阶段,批量探测和爬网
技术(共45项)
注入
- SQLi(基于错误、盲、基于时间)、XSS(反射、存储、DOM)、SSTI、CSTI、CRLF、头注入
文件访问
- LFI、XXE、路径遍历
服务器端
- SSRF、RCE(指令注入、eval)、原型污染
访问控制
- IDOR、路径IDOR、访问控制中断、大规模分配
配置
- 安全标头、版本披露、传输安全、ViewState MAC、默认凭据
数据泄露
- 敏感字段泄漏、HTML中的PII、易受攻击的组件
认证
- Cookie注入(SQLi、XSS、反序列化)、JWT分析、速率限制
外部
- Nuclei模板、WordPress、Spring执行器、GraphQL(自省+数据泄漏)、CORS
项目结构
BugHound/
├── CLAUDE.md # Project instructions
├── PLAN.md # Development plan
├── DEVLOG.md # Development journal
├── README.md
├── bughound/
│ ├── server.py # MCP server entry point
│ ├── config/
│ │ └── settings.py # Configuration
│ ├── core/
│ │ ├── target_classifier.py # Stage 0: target type detection
│ │ ├── workspace.py # Workspace CRUD + lazy dir creation
│ │ ├── job_manager.py # Async job lifecycle
│ │ └── tool_runner.py # Unified subprocess runner
│ ├── stages/
│ │ ├── enumerate.py # Stage 1
│ │ ├── discover.py # Stage 2
│ │ ├── analyze.py # Stage 3
│ │ ├── test.py # Stage 4
│ │ ├── validate.py # Stage 5
│ │ └── report.py # Stage 6
│ ├── tools/
│ │ ├── base.py # Unified base tool
│ │ ├── recon/ # subfinder, httpx, crtsh, etc.
│ │ ├── scanning/ # nuclei, ffuf, dalfox, sqlmap, etc.
│ │ ├── discovery/ # gospider, jsluice, arjun, etc.
│ │ ├── testing/ # injection_tester, graphql, jwt testers
│ │ └── oneliners/ # qsreplace, kxss, gf, uro, unfurl, anew + pipeline engine
│ ├── schemas/
│ │ └── models.py # Pydantic models
│ └── utils/
│ └── helpers.py
├── tests/
├── scripts/
│ └── install-tools.sh # Security tools installer
└── workspaces/ # Runtime data (gitignored)黑帽阿森纳
BugHound在 2026年黑帽阿森纳亚洲.
- 日期: 2026年4月24日
- 轨道: Web AppSec
- 地点: 阿森纳2号站,商务大厅
- 事件: 2026年亚洲黑帽
许可证
MIT许可证
学分
建造于 克里希纳·奈杜, 埃里克·提, Lwin Min Oo, 胡凯伟, Valen Sai 酒店
