安全、模块化的 MCP 服务器,封装了 nmap、nuclei、gobuster、subfinder、httpx、nikto、sqlmap,用于 AI 驱动的渗透测试。
安全、模块化的渗透测试工具 MCP 服务器。
将 7 款行业标准安全工具(nmap、nuclei、gobuster、subfinder、httpx、nikto、sqlmap)封装为 13 个已注册的 MCP 工具 — 可直接与 Claude、Cursor、Copilot 以及任何兼容 MCP 的 AI 代理配合使用。
| 功能 | 描述 |
|---|---|
| 不使用 shell=True | 所有子进程调用均使用 asyncio.create_subprocess_exec — 无 shell 注入 |
| 输入验证 | 目标、URL、端口、严重级别 — 均在执行前验证 |
| 注入检测 | 阻止 shell 元字符(;、$()、反引号、|) |
| 超时强制 | 每个工具均有可配置的超时时间 — 自动终止挂起的进程 |
| 结构化输出 | 解析 XML/JSON/文本 → 为 AI 代理提供干净的 JSON |
| 模块化架构 | 每个工具一个文件 — 易于添加、维护和测试 |
| MCP SDK v2 | 基于最新的 Model Context Protocol SDK 构建 |
git clone https://github.com/azmisyahrul/prismsec.git
cd prismsec
pip install -e .
安装您需要的安全工具:
# Ubuntu/Debian
apt install nmap nikto sqlmap
# Go-based tools
go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest
go install github.com/OJ/gobuster/v3@latest
| MCP 工具 | 描述 |
|---|---|
nmap_port_scan | 端口扫描,支持快速/全面/服务/隐蔽/激进模式 |
nmap_service_detect | 对开放端口进行服务/版本检测 |
nmap_full_scan | 扫描全部 65535 个 TCP 端口 |
| MCP 工具 | 描述 |
|---|---|
nuclei_vuln_scan | 使用所有模板进行完整漏洞扫描 |
nuclei_severity_scan | 按严重级别筛选的扫描(critical、high 等) |
nuclei_template_scan | 使用特定模板进行定向扫描 |
| MCP 工具 | 描述 |
|---|---|
gobuster_directory | 目录暴力破解,可配置扩展名 |
gobuster_dns | DNS 子域暴力破解 |
| MCP 工具 | 描述 |
|---|---|
subfinder_enumerate | 被动子域枚举(crt.sh、VirusTotal 等) |
httpx_probe | Web 探测 — 存活检测、标题、技术指纹识别 |
| MCP 工具 | 描述 |
|---|---|
check_tools | 检查哪些安全工具已安装 |
添加到 claude_desktop_config.json:
{
"mcpServers": {
"prismsec": {
"command": "python3",
"args": ["/path/to/prismsec/server.py"],
"env": {}
}
}
}
claude mcp add prismsec python3 /path/to/prismsec/server.py
添加到 .cursor/mcp.json 或等效配置文件:
{
"mcpServers": {
"prismsec": {
"command": "python3",
"args": ["/path/to/prismsec/server.py"]
}
}
}
# Server side
python3 server.py --transport sse --host 0.0.0.0 --port 8000
# Client config
{
"mcpServers": {
"prismsec": {
"url": "http://localhost:8000/sse"
}
}
}
prismsec/
├── server.py # MCP server entry point (13 tools)
├── pyproject.toml # Project config + dependencies
├── tools/ # Tool wrappers (one file per tool)
│ ├── base.py # ToolWrapper ABC + async runner
│ ├── nmap.py # Nmap — XML parsing, scan modes
│ ├── nuclei.py # Nuclei — JSON output parsing
│ ├── gobuster.py # Gobuster — text output parsing
│ ├── subfinder.py # Subfinder — subdomain enum
│ ├── httpx.py # Httpx — web probing
│ ├── nikto.py # Nikto — web vuln scan
│ └── sqlmap.py # Sqlmap — SQL injection testing
├── parsers/ # Output parsers
│ ├── xml_parser.py # nmap XML → structured JSON
│ ├── json_parser.py # JSON/JSONL parsing
│ └── text_parser.py # Gobuster, nikto, sqlmap text
└── utils/ # Shared utilities
├── runner.py # AsyncRunner with timeout
├── validator.py # Input validation + injection detection
├── rate_limiter.py # Token bucket rate limiter
└── logging.py # Structured logging
| 环境变量 | 默认值 | 描述 |
|---|---|---|
LOG_LEVEL | INFO | 日志级别(DEBUG、INFO、WARNING、ERROR) |
⚠️ 仅限授权测试。 仅可对您拥有或已获得书面许可的系统使用。
127.0.0.1 — 切勿暴露给不受信任的网络MIT
基于 Model Context Protocol 标准构建,以实现广泛的客户端兼容性。
nikto_web_scan| Web 服务器漏洞扫描 |
sqlmap_injection_test | SQL 注入检测与测试 |