OSINT情报收集服务器

一个基于Model Context Protocol的服务器,为AI助手提供theHarvester OSINT工具的访问能力,主要用于渗透测试中的电子邮件和子域名收集。

  • by schwarztim
  • JavaScript
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 schwarztim/sec-theharvester-mcp

使用说明

收割机MCP服务器

MCP(模型上下文协议)服务器,为AI助手提供访问 收割机 -一个强大的OSINT侦察工具,用于在渗透测试期间收集电子邮件和子域。

概述

收割机是渗透测试侦察阶段用于收集情报的最广泛使用的OSINT工具之一。这个MCP服务器封装了收割机的功能,允许像克劳德这样的人工智能助手通过结构化界面执行领域侦察任务。

该服务器通过SSH在Kali Linux主机上执行Harvester命令,非常适合维护专用Kali环境的安全专业人员。

特性

  • 电子邮件收集 -发现与目标域关联的电子邮件地址
  • 子域发现 -使用40多个公共和高级数据源查找子域
  • DNS暴力 -使用基于单词表的暴力破解枚举子域
  • Shodan集成 -查询发现的开放端口、服务和横幅的主机
  • 接管检测 -检查子域接管漏洞
  • 虚拟主机发现 -在发现的IP地址上识别虚拟主机

安装

先决条件

  1. Kali Linux主机 -可通过SSH访问的Kali Linux系统
  2. SSH配置 -SSH访问已配置 ~/.ssh/config
  3. 收割机 -安装在Kali主机上:
    sudo apt install theharvester
    
  4. Node.js -版本18或更高

设置

# Clone the repository
git clone https://github.com/schwarztim/sec-theharvester-mcp.git
cd sec-theharvester-mcp

# Install dependencies
npm install

# Build the project
npm run build

MCP配置

添加到您的Claude Desktop或MCP客户端配置中:

{
  "mcpServers": {
    "theharvester": {
      "command": "node",
      "args": ["/path/to/sec-theharvester-mcp/dist/index.js"],
      "env": {
        "KALI_HOST": "kali"
      }
    }
  }
}

工具

工具 说明
theharvester_search 使用可配置的源和选项进行完整的OSINT搜索
theharvester_sources 列出可用的数据源和API要求
theharvester_emails 快速搜索专注于电子邮件收集
theharvester_hosts 快速搜索子域名/主机发现
theharvester_dns_brute DNS暴力枚举
theharvester_shodan 使用Shodan集成搜索详细的主机信息
theharvester_full_recon 使用所有功能进行全面侦察
theharvester_check_status 验证Kali主机上收割机的可用性

数据源

不需要API密钥

  • 阿努比斯、百度、冰、crtsh、dnsdumpster、duckduckgo
  • hackertarget、otx、rapiddns、站点档案、子域中心
  • threatminer、urlscan、雅虎

需要API密钥

  • 贝维吉尔、比纳里、勇敢、布弗罗伦、切西
  • criticip、fullhunt、github代码、hunter、hunterhow
  • intelx、leakix、netlas、onyphe、pentesttools
  • 项目发现、火箭技术、安全记分卡
  • securitytrails、shodan、tomba、virustotal、zoomeye

在Kali主机上Harvester的配置文件中配置API密钥。

配置

环境变量

变量 默认值 描述
KALI_HOST kali Kali Linux系统的SSH主机名

SSH设置

确保您的SSH配置(~/.ssh/config)包含Kali主机的条目:

Host kali
    HostName 192.168.1.100
    User root
    IdentityFile ~/.ssh/kali_key

使用示例

基本域名搜索

{
  "tool": "theharvester_search",
  "arguments": {
    "domain": "example.com",
    "sources": ["bing", "crtsh", "dnsdumpster"],
    "limit": 500
  }
}

电子邮件收集

{
  "tool": "theharvester_emails",
  "arguments": {
    "domain": "example.com",
    "sources": ["hunter", "tomba", "bing"]
  }
}

使用DNS解析进行子域发现

{
  "tool": "theharvester_hosts",
  "arguments": {
    "domain": "example.com",
    "dns_resolve": true,
    "dns_brute": true
  }
}

全面侦察

{
  "tool": "theharvester_full_recon",
  "arguments": {
    "domain": "example.com"
  }
}

输出格式

所有工具都返回结构化JSON,其中包含:

  • 解析结果(电子邮件、主机、IP、URL、ASN)
  • 统计和元数据
  • 用于详细分析的原始输出

示例响应:

{
  "domain": "example.com",
  "sources": ["bing", "crtsh"],
  "emails": ["admin@example.com", "support@example.com"],
  "hosts": ["www.example.com", "mail.example.com"],
  "ips": ["93.184.216.34"],
  "urls": [],
  "asns": [],
  "interesting_urls": [],
  "raw_output": "..."
}

安全考虑

  • 此工具用于 仅限授权安全测试
  • 在扫描任何域之前,始终获得适当的授权
  • 注意数据源API的速率限制
  • 某些来源可能会记录您的查询

发展

# Watch mode for development
npm run dev

# Build for production
npm run build

# Run the server
npm start

相关项目

许可证

MIT许可证-请参阅 许可证 了解详情。

免责声明

此工具仅用于教育和授权的安全测试目的。用户有责任在扫描任何系统或域之前确保他们有适当的授权。作者不对任何滥用此软件的行为负责。