Shodan MCP服务器
A. 模型上下文协议(MCP) 提供对 肖丹 物联网搜索引擎API。这使得AI助手能够使用Shodan强大的搜索功能进行网络侦察、漏洞研究和安全分析。
特性
- 设备搜索:使用强大的查询语法在Shodan数据库中搜索连接互联网的设备
- 主机智能:获取有关特定IP地址的详细信息,包括开放端口、服务和漏洞
- 利用数据库:搜索Shodan的漏洞数据库,包括CVE、漏洞数据库和Metasploit
- 网络扫描:请求按需扫描IP地址和网络范围
- 网络监控:创建警报以监控IP范围的变化
- DNS操作:执行正向和反向DNS查找,枚举子域
- 蜜罐检测:使用Shodan的honeyscore算法识别潜在的蜜罐
先决条件
- Node.js 18或更高版本
- 一个Shodan API密钥(在 永远。)
安装
# Clone the repository
git clone https://github.com/schwarztim/sec-shodan-mcp.git
cd sec-shodan-mcp
# Install dependencies
npm install
# Build the project
npm run build配置
克劳德桌面版
添加到您的Claude Desktop配置文件中:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json 视窗: %APPDATA%\Claude\claude_desktop_config.json Linux: ~/.config/claude/claude_desktop_config.json
{
"mcpServers": {
"shodan": {
"command": "node",
"args": ["/path/to/sec-shodan-mcp/dist/index.js"],
"env": {
"SHODAN_API_KEY": "your-api-key-here"
}
}
}
}克劳德代码
添加到 ~/.claude/user-mcps.json:
{
"mcpServers": {
"shodan": {
"command": "node",
"args": ["/path/to/sec-shodan-mcp/dist/index.js"],
"env": {
"SHODAN_API_KEY": "your-api-key-here"
}
}
}
}可用工具
搜索与发现
| 工具 | 说明 |
|---|---|
shodan_search | 使用以下过滤器在Shodan中搜索与查询匹配的设备 port:, country:, org:, product:, vuln: |
shodan_host | 获取有关特定IP的所有信息,包括端口、服务、横幅、漏洞和SSL证书 |
shodan_count | 统计搜索结果而不消耗查询积分 |
利用数据库
| 工具 | 说明 |
|---|---|
shodan_exploits_search | 按CVE、作者、平台、类型或端口搜索漏洞 |
shodan_exploits_count | 统计匹配漏洞,不返回单个结果 |
网络扫描
| 工具 | 说明 |
|---|---|
shodan_scan | 请求按需扫描IP地址或CIDR范围 |
shodan_scan_status | 检查以前提交的扫描的状态 |
shodan_list_scans | 列出所有活动的按需扫描 |
网络警报
| 工具 | 说明 |
|---|---|
shodan_alert_create | 为IP范围创建监控警报 |
shodan_alert_list | 列出所有活动的网络警报 |
shodan_alert_get | 获取特定警报的详细信息 |
shodan_alert_delete | 删除网络警报 |
shodan_alert_triggers | 列出可用的警报触发类型 |
DNS操作
| 工具 | 说明 |
|---|---|
shodan_dns_resolve | 将主机名解析为IP地址(转发DNS) |
shodan_dns_reverse | 查找IP地址的主机名(反向DNS) |
shodan_dns_domain | 获取包括子域在内的域的DNS信息 |
安全分析
| 工具 | 说明 |
|---|---|
shodan_honeyscore | 计算IP是蜜罐的概率(0.0到1.0) |
效用
| 工具 | 说明 |
|---|---|
shodan_ports | 列出Shodan抓取的所有端口 |
shodan_protocols | 列出可用于按需扫描的协议 |
shodan_filters | 列出Shodan中可用的所有搜索筛选器 |
shodan_facets | 列出可用于搜索结果细分的方面 |
shodan_api_info | 获取API计划信息,包括查询和扫描信用 |
shodan_account_profile | 获取API密钥的帐户信息 |
shodan_myip | 获取您当前的公共IP地址 |
查询库
| 工具 | 说明 |
|---|---|
shodan_saved_queries | 浏览已保存搜索查询的目录 |
shodan_search_queries | 搜索已保存的查询目录 |
使用示例
搜索设备
# Find Apache servers in the United States
shodan_search: query="apache country:US"
# Find open SSH servers
shodan_search: query="port:22 product:openssh"
# Find devices vulnerable to Log4Shell
shodan_search: query="vuln:CVE-2021-44228"
# Find webcams with screenshots
shodan_search: query="webcam has_screenshot:true"
# Find industrial control systems
shodan_search: query="tag:ics"
# Find devices by organization
shodan_search: query="org:\"Google LLC\""获取主机信息
# Get details about a specific IP
shodan_host: ip="8.8.8.8"
# Include historical data
shodan_host: ip="8.8.8.8" history=true搜索漏洞
# Search for Log4j exploits
shodan_exploits_search: query="log4j"
# Find exploits by CVE
shodan_exploits_search: query="cve:CVE-2021-44228"
# Find Metasploit modules
shodan_exploits_search: query="source:metasploit"DNS操作
# Resolve hostnames
shodan_dns_resolve: hostnames="google.com,github.com"
# Reverse DNS lookup
shodan_dns_reverse: ips="8.8.8.8,1.1.1.1"
# Get domain information
shodan_dns_domain: domain="example.com"API学分
不同的Shodan API计划有不同的信用额度:
- 免费帐户:每月搜索查询次数有限
- 按页码搜索:消耗查询积分
shodan_count:不消耗积分(用于范围界定)- 按需扫描:消耗扫描积分(每个IP 1个积分)
- 一些过滤器 (比如
vuln:)要求付费计划
通过以下方式查看您当前的积分 shodan_api_info.
发展
# Run in development mode
npm run dev
# Build for production
npm run build
# Start the server
npm start安全通知
该工具旨在用于合法的安全研究、渗透测试(经授权)和网络防御目的。在扫描或探测您不拥有的系统之前,始终确保您有适当的授权。
资源
许可证
MIT许可证-请参阅 许可证 了解详情。
贡献
欢迎投稿!请随时提交拉取请求。
