Shodan-MCP-Server

by X3r0K
Verified

Integrations

  • Enables secure API key management through environment variables, supporting configuration of the Shodan API key and other server settings.

  • Hosts the repository for the Shodan MCP Server, allowing users to clone the project for installation.

  • Provides the runtime environment for the MCP server, with version 14 or higher required to run the Shodan integration.

Shodan MCP 服务器

模型上下文协议 (MCP) 服务器通过标准化接口提供对 Shodan 互联网扫描功能的访问。

概述

该服务器实现了模型上下文协议 (MCP),以开放 Shodan 强大的互联网扫描和侦察功能。它提供了一个标准化接口,用于查询 Shodan 的互联网连接设备、服务和漏洞数据库。

特征

  • 搜索功能:使用高级搜索过滤器查询 Shodan 数据库
  • DNS 查找:解析域名并获取详细的 DNS 信息
  • CVE 信息:获取有关常见漏洞和暴露的详细信息
  • 获取漏洞:获取与 IP 地址相关的漏洞详细信息
  • 标准化接口:使用 MCP 协议实现一致通信
  • 环境变量支持:通过环境变量进行安全的 API 密钥管理

先决条件

  • Node.js(v14 或更高版本)
  • npm(v6 或更高版本)
  • Shodan API 密钥

安装

  1. 克隆存储库:
    git clone https://github.com/X3r0K/Shodan-MCP-Server-Inspector.git cd shodan-mcp-server-Inspector
  2. 安装依赖项:
    npm install
  3. 在根目录中创建一个.env.local文件并添加您的 Shodan API 密钥:
    SHODAN_API_KEY=your_api_key_here

用法

启动服务器

  1. 构建服务器:
    npm run build
  2. 启动服务器:
    node build/index.js

可用工具

  1. 搜索工具
    • 查询:使用 Shodan 的搜索语法搜索设备和服务
    • 例如: log4j country:US city:Atlanta
    • 返回:匹配设备的详细信息列表
  2. DNS查找工具
    • 查询:要解析的域名
    • 例如: example.com
    • 返回:DNS记录及相关信息
  3. CVE信息工具
    • 查询:CVE 标识符
    • 例如: CVE-2021-44228
    • 返回:详细的漏洞信息

示例查询

// Search for Log4j vulnerable systems in the US { "query": "log4j country:US" } // DNS lookup for a domain { "query": "example.com" } // Get CVE information { "query": "CVE-2021-44228" }

使用 MCP 检查器

您可以使用 MCP 检查器直接与服务器交互:

  1. 安装 MCP 检查器:
npm install -g @modelcontextprotocol/inspector
  1. 使用您的服务器运行检查器:
npx @modelcontextprotocol/inspector build/index.js

检查器提供了一个交互式界面来:

  • 测试所有可用的工具
  • 查看工具文档
  • 调试服务器响应
  • 监控服务器状态

环境变量

  • SHODAN_API_KEY :您的 Shodan API 密钥(必需)
  • PORT :服务器端口(可选,默认为 3000)
  • LOG_LEVEL :日志记录级别(可选,默认为“info”)

错误处理

服务器实现了全面的错误处理:

  • 无效的 API 密钥
  • 速率限制
  • 网络问题
  • 无效查询
  • 服务器错误

安全注意事项

  1. API密钥保护:
    • 切勿将 API 密钥提交到版本控制
    • 使用环境变量来存储敏感数据
    • 定期轮换 API 密钥
  2. 速率限制:
    • 尊重 Shodan 的 API 速率限制
    • 实施客户端速率限制
  3. 数据隐私:
    • 从回复中过滤敏感信息
    • 根据需要实施访问控制

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。

致谢

  • Shodan 提供 API
  • MCP 规范的模型上下文协议团队
-
security - not tested
F
license - not found
-
quality - not tested

这是一个模型上下文协议 (MCP) 服务器,提供对 Shodan API 的访问。它允许您以编程方式向 Shodan 查询有关设备、漏洞等信息。

  1. Overview
    1. Features
      1. Prerequisites
        1. Installation
          1. Usage
            1. Starting the Server
            2. Available Tools
            3. Example Queries
            4. Using the MCP Inspector
          2. Environment Variables
            1. Error Handling
              1. Security Considerations
                1. License
                  1. Acknowledgments
                    ID: fi8zaw0bu7