badchars/hackbrowser-mcp

GitHub: badchars/hackbrowser-mcp

首个专为安全测试构建的浏览器 MCP,赋予 AI Agent 真正的漏洞发现能力。

Stars: 0 | Forks: 0


hackbrowser-mcp

首个专为安全测试构建的浏览器 MCP。

其他浏览器 MCP 允许你的 AI 填写表单和截图。
而这一个能让它发现漏洞


功能介绍独特之处快速开始示例工具架构

License Bun Firefox MCP 39 Tools 60+ Payloads

## 功能介绍 **hackbrowser-mcp** 通过 [Model Context Protocol](https://modelcontextprotocol.io) 为你的 AI agent 提供一个真实的 Firefox 浏览器和 39 个安全测试工具。Agent 可以启动浏览器、浏览目标、捕获所有流量并测试漏洞 — 全部通过自然语言完成。 ``` You: "Log in as admin and as a regular user. Find endpoints the user shouldn't access." Agent: → launches Firefox → creates two isolated containers (admin + user) → logs in both accounts → browses the app, captures traffic → compares responses across roles → "User can access GET /api/admin/users — should return 403, returns 200" ``` AI 负责处理整个工作流程:启动浏览器、管理会话、发现端点、测试参数并生成安全报告。你只需描述要测试什么。剩下的交给它。 ## 独特之处 市面上有数十种浏览器 MCP。它们都做着同样的事情:让 LLM 导航页面、点击按钮、提取文本。它们是为**自动化**构建的 — 填写表单、抓取数据、运行 UI 测试。 **它们都无法测试漏洞。** 这正是 hackbrowser-mcp 填补的空白。
其他浏览器 MCP hackbrowser-mcp
目的 Web 自动化、抓取、表单填写 安全测试、漏洞评估
会话 单一会话 2-4 个独立容器,拥有独立的 cookies、存储和认证
流量 只读网络标签(如果有) 完整的 HAR 捕获 + 修改重放
安全工具 14 个工具:注入测试、CSRF、IDOR、访问矩阵、报告生成
注入测试 无法实现 7 种类型,60+ payloads,带技术标签的结果
访问控制 无法实现 跨角色对比、端点访问矩阵、IDOR 检测
浏览器 Chromium (CDP) Firefox (WebDriver BiDi) — 不同的引擎能发现不同的 bug
反检测 不一 内置 Stealth 模式(指纹、UA、WebGL 伪装)

与热门项目的详细对比
| 项目 | Stars | 功能 | 无法做到的事 | |---|---|---|---| | [playwright-mcp](https://github.com/microsoft/playwright-mcp) | 29k | 通过可访问性树导航、点击、输入、截图 | 无多会话、无流量捕获、无安全测试 | | [browser-use](https://github.com/browser-use/browser-use) | 81k | AI 完成 Web 任务(购物、表单、研究) | 单一 agent 操作、无 HAR、无注入测试 | | [stagehand](https://github.com/browserbase/stagehand) | 22k | 用于浏览器自动化的 act/extract/observe SDK | 无安全工具、无容器隔离 | | [chrome-devtools-mcp](https://github.com/nichochar/chrome-devtools-mcp) | 29k | DevTools 调试、性能分析、网络监控 | 只读网络、无重放、无主动测试 | | [browser-tools-mcp](https://github.com/AgentDeskAI/browser-tools-mcp) | 7k | 为 coding agent 提供控制台、网络、审计监控 | 聚焦 IDE、无进攻性测试能力 | | [mcp-playwright](https://github.com/executeautomation/mcp-playwright) | 5k | 多浏览器测试自动化 + 抓取 | 无安全意识、无访问控制分析 | 所有这些都是用于其预期目的的优秀工具。hackbrowser-mcp 并不取代它们 — 它服务于一个完全不同的用例。
## 核心能力 ### 多容器隔离 同时运行 2-4 个浏览器会话,每个会话拥有**完全隔离**的状态。这是访问控制测试的基础。 ``` ┌────────────────────────────────────────────────────────┐ │ Firefox Instance │ ├───────────────┬───────────────┬────────────────────────-┤ │ Container 1 │ Container 2 │ Container 3 │ │ role: admin │ role: user │ role: guest │ │ │ │ │ │ cookies: A │ cookies: B │ cookies: none │ │ storage: A │ storage: B │ storage: none │ │ session: ✓ │ session: ✓ │ session: ✗ │ └───────────────┴───────────────┴─────────────────────────┘ compare_access → "GET /api/admin/users returns 200 for user (expected 403)" access_matrix → role × endpoint grid showing every authorization gap ``` ### 流量情报 每一个 HTTP 请求和响应都会被捕获、存储并可查询。可修改并重放任何请求。 ``` Browser → Network Interceptor → In-Memory Store (10K max, FIFO) │ ┌─────────┴──────────┐ │ │ Auto-save (60s) Replay / modify │ │ ▼ ▼ HAR file (disk) replay_request │ (change method, Resume on restart headers, body) ``` ### 主动安全测试 从捕获的流量中发现注入点,然后使用 60+ payloads 跨 7 种漏洞类型进行测试。 | 类型 | Payloads | 技术 | |------|----------|------------| | **SQLi** | 9 | Error-based, union, time-based blind (MSSQL/MySQL/Postgres), boolean-blind | | **XSS** | 8 | Reflected script, event handler, SVG, JS context, HTML5 events, iframe | | **SSTI** | 8 | Jinja2, Freemarker, ERB, Angular sandbox, Spring EL, Vue | | **SSRF** | 8 | Localhost variants (IPv4/v6/hex/octal), AWS/GCP/Azure metadata, DNS rebind | | **CMDi** | 8 | Semicolon, pipe, backtick, subshell, newline, quote-break | | **LFI** | 8 | Path traversal, double-dot, /proc/environ, PHP filter, double-encode | | **HTML Injection** | 6 | Tag injection, form injection, style overlay, meta redirect | 当内置 payloads 被拦截时,AI agent 会分析 WAF 响应并使用 `replay_request` 制作自定义绕过 payloads。 ## 快速开始 ### 安装 ``` git clone https://github.com/user/hackbrowser-mcp.git cd hackbrowser-mcp bun install ``` ### 连接到你的 AI agent
Claude Desktop / Claude Code 添加到你的 MCP 配置 (`~/.claude/claude_desktop_config.json`): ``` { "mcpServers": { "hackbrowser": { "command": "bun", "args": ["run", "/path/to/hackbrowser-mcp/src/index.ts", "--mcp"] } } } ```
Cursor / Continue / 其他 MCP 客户端 相同的配置格式。将 command 指向你的安装路径。
独立运行(无 AI agent) ``` bun run src/index.ts --launch # GUI mode bun run src/index.ts --launch --headless # headless bun run src/index.ts --mcp # MCP server (stdio) ```
### 开始测试 ``` You: "Launch the browser and scan https://target.com for vulnerabilities" ``` 就这样。Agent 会处理剩下的事情。 ## 工作流示例 ### 全面安全扫描 ``` You: "Crawl https://app.com, find injection points, test them, generate a report." Agent: browser_launch → navigate → crawl (100 pages) → find_injection_points → test_injection (SQLi, XSS) → test_csrf → test_rate_limit → generate_report → "Found 3 XSS, 1 SQLi, 2 missing CSRF tokens" ``` ### IDOR / 访问控制审计 ``` You: "Login as admin and regular user. Find what the user shouldn't access." Agent: container_setup (admin + user) → container_login (both) → navigate admin pages → compare_access → access_matrix → "User can reach GET /api/admin/users (200 instead of 403)" ``` ### WAF 绕过 ``` You: "Test the search param for XSS. Bypass any WAF." Agent: test_injection {types: ["xss"]} → all blocked → analyzes response: