使用说明
Nuclei MCP服务器
MCP(模型上下文协议)服务器,为AI助手提供访问 核,ProjectDiscovery的快速和可定制的漏洞扫描程序。
概述
此MCP服务器使AI助手能够通过SSH连接到Kali Linux主机,通过Nuclei执行漏洞扫描。它为安全评估提供了一套全面的工具,包括模板管理、工作流执行和已知漏洞(KEV)的专门扫描。
特性
- 漏洞扫描:对单个或多个目标进行Nuclei扫描
- 模板管理:按标签、严重性、作者和类型列出、搜索和筛选模板
- 工作流执行:运行预定义的工作流,进行全面的技术特定扫描
- KEV扫描:用于扫描CISA已知漏洞的专用工具
- 配置预设:针对隐形、快速、全面、API和web扫描的内置建议
- 速率限制:可配置的速率限制,用于控制扫描强度
需求
- Node.js 18+
- SSH访问安装了Nuclei的Kali Linux主机
- 配置了基于SSH密钥的身份验证
安装
# Clone the repository
git clone https://github.com/schwarztim/sec-nuclei-mcp.git
cd sec-nuclei-mcp
# Install dependencies
npm install
# Build
npm run build
配置
设置以下环境变量:
| 变量 | 描述 | 默认值 |
|---|---|---|
KALI_HOST |
Kali Linux的SSH主机名 | kali |
SSH_TIMEOUT |
命令超时(秒) | 300 |
DEFAULT_RATE_LIMIT |
默认每秒请求数 | 150 |
SSH设置
确保您的Kali主机配置了基于SSH密钥的身份验证:
# Add your Kali host to ~/.ssh/config
Host kali
HostName your-kali-ip-or-hostname
User root
IdentityFile ~/.ssh/id_rsa
MCP配置
添加到您的Claude Desktop或MCP客户端配置中:
{
"mcpServers": {
"nuclei": {
"command": "node",
"args": ["/path/to/sec-nuclei-mcp/dist/index.js"],
"env": {
"KALI_HOST": "kali"
}
}
}
}
可用工具
nuclei_scan
对具有广泛过滤选项的目标运行漏洞扫描。
// Basic scan
nuclei_scan({ target: "https://example.com" })
// High severity only
nuclei_scan({
target: "https://example.com",
severity: ["high", "critical"]
})
// Specific vulnerability types
nuclei_scan({
target: "https://example.com",
tags: ["cve", "rce", "sqli"]
})
// Multiple targets
nuclei_scan({
targets: ["https://a.com", "https://b.com"]
})
nuclei_templates
列出并搜索可用模板。
// List critical severity templates
nuclei_templates({ severity: ["critical"] })
// Search by tags
nuclei_templates({ tags: ["wordpress", "cve"] })
// Filter by author
nuclei_templates({ author: "pdteam" })
nuclei_kev_scan
扫描已知漏洞(CISA KEV目录)。
nuclei_kev_scan({ target: "https://example.com" })
nuclei_workflows
列出可用的扫描工作流。
// List all workflows
nuclei_workflows({})
// Search for specific workflows
nuclei_workflows({ search: "wordpress" })
nuclei_run_workflow
针对目标执行工作流。
nuclei_run_workflow({
target: "https://example.com",
workflow: "wordpress-workflow"
})
nuclei_config
获取不同扫描场景的配置建议。
// Available scenarios: stealth, fast, comprehensive, api, web
nuclei_config({ scenario: "stealth" })
nuclei_update_templates
将模板更新到最新版本。
nuclei_update_templates({})
nuclei_version
获取Nuclei版本和配置信息。
nuclei_tags
列出带有描述的流行模板标签。
nuclei_severity_stats
按严重性级别获取模板计数。
扫描选项
| 选项 | 类型 | 描述 |
|---|---|---|
target |
string | 单目标URL |
targets |
string[] | 多个目标URL |
templates |
string[] | 特定模板路径/ID |
tags |
string[] | 按标签筛选(cve、rce、xss等) |
excludeTags |
string[] | 排除带有标签的模板 |
severity |
string[] | 按严重性筛选(信息、低、中、高、严重) |
author |
string | 按模板作者筛选 |
rateLimit |
number | 每秒最大请求数 |
concurrency |
number | 并发模板执行 |
timeout |
number | 请求超时(秒) |
proxy |
string | HTTP/SOCKS代理URL |
headless |
boolean | 启用无头浏览器 |
customHeaders |
object | 自定义HTTP标头 |
followRedirects |
boolean | 遵循HTTP重定向 |
maxRedirects |
number | 要遵循的最大重定向数 |
debug |
boolean | 启用调试输出 |
热门标签参考
| 标签 | 描述 |
|---|---|
cve |
CVE漏洞 |
kev |
已知漏洞 |
rce |
远程代码执行 |
xss |
跨站点脚本 |
sqli |
SQL注入 |
lfi |
本地文件包含 |
ssrf |
服务器端请求伪造 |
default-login |
默认凭据 |
exposure |
信息暴露 |
misconfig |
配置错误 |
panel |
管理面板 |
tech |
技术检测 |
安全考虑
- 此工具仅用于授权的安全测试
- 在扫描目标之前,始终获得适当的授权
- 使用速率限制来避免压倒性的目标系统
- 考虑使用隐形模式进行敏感评估
许可证
MIT许可证-请参阅 许可证 了解详情。
