V

VirusTotal威胁情报平台

@emeryray2002/virustotal-mcp
1 Stars 98 次浏览 emeryray2002 更新于 2026-08-23

提供了全面的安全分析工具,用于查询 VirusTotal API,能够针对 URL、文件、IP 地址和域生成详细的安全报告,并自动获取关联数据。

该服务暂未提供标准配置,请参考 README 手动接入

服务介绍

VirusTotal MCP 服务器

smithery 徽章

一个用于查询 VirusTotal API 的模型上下文协议 (MCP) 服务器。该服务器提供了全面的安全分析工具,并自动获取关系数据。它无缝集成到像 Claude Desktop 这样的兼容 MCP 的应用程序中。

快速开始(待定)

通过 Smithery 安装

要通过 Smithery 自动为 Claude Desktop 安装 virustotal-mcp:

npx -y @smithery/cli install @emeryray2002/virustotal-mcp --client claude

手动安装

待定

功能

  • 全面的分析报告:每个分析工具都会在基本报告的基础上自动获取相关的关联数据,提供完整的安全概览。
  • URL 分析:包括自动获取联系的域名、下载的文件和威胁行为者在内的安全报告。
  • 文件分析:详细的文件哈希分析,包括行为、丢弃的文件和网络连接。
  • IP 分析:包含历史数据、解析记录和相关威胁的安全报告。
  • 域名分析:DNS 信息、WHOIS 数据、SSL 证书和子域名。
  • 详细的关系分析:专门用于查询特定类型关系的工具,并支持分页。
  • 高级搜索:VT Intelligence 搜索功能,可以在 VirusTotal 数据集中进行复杂查询。
  • 丰富的格式化:清晰地分类和展示分析结果及关系数据。

工具

报告工具(带自动关系获取)

1. URL 报告工具

  • 名称:get_url_report
  • 描述:获取一个综合的 URL 分析报告,包括安全扫描结果和关键关系(通信文件、联系的域名/IP、下载的文件、重定向、威胁行为者)。
  • 参数:
    • url(必需):要分析的 URL
  • 示例:
await get_url_report(url="http://example.com/suspicious")

2. 文件报告工具

  • 名称:get_file_report
  • 描述:使用文件哈希(MD5/SHA-1/SHA-256)获取一个综合的文件分析报告。包括检测结果、文件属性和关键关系(行为、丢弃的文件、网络连接、嵌入内容、威胁行为者)。
  • 参数:
    • hash(必需):文件的 MD5、SHA-1 或 SHA-256 哈希值
  • 示例:
await get_file_report(hash="44d88612fea8a8f36de82e1278abb02f")

3. IP 报告工具

  • 名称:get_ip_report
  • 描述:获取一个综合的 IP 地址分析报告,包括地理位置、声誉数据和关键关系(通信文件、历史证书/WHOIS、解析记录)。
  • 参数:
    • ip(必需):要分析的 IP 地址
  • 示例:
await get_ip_report(ip="8.8.8.8")

4. 域名报告工具

  • 名称:get_domain_report
  • 描述:获取一个综合的域名分析报告,包括 DNS 记录、WHOIS 数据和关键关系(SSL 证书、子域名、历史数据)。
  • 参数:
    • domain(必需):要分析的域名
  • 示例:
await get_domain_report(domain="example.com")

关系工具(用于详细分析)

1. URL 关系工具

  • 名称: get_url_relationship
  • 描述: 查询特定类型的 URL 关系,并支持分页
  • 参数:
    • url (必需): 要获取关系的 URL
    • relationship (必需): 要查询的关系类型
      • 可用关系: analyses, comments, communicating_files, contacted_domains, contacted_ips, downloaded_files, graphs, last_serving_ip_address, network_location, referrer_files, referrer_urls, redirecting_urls, redirects_to, related_comments, related_references, related_threat_actors, submissions
    • limit (可选, 默认值: 10): 要检索的相关对象的最大数量 (1-40)
    • cursor (可选): 分页的连续游标
  • 示例:
await get_url_relationship(
    url="http://example.com/suspicious",
    relationship="communicating_files",
    limit=20
)

2. 文件关系工具

  • 名称: get_file_relationship
  • 描述: 查询特定类型的文件关系,并支持分页
  • 参数:
    • hash (必需): 文件的 MD5、SHA-1 或 SHA-256 哈希值
    • relationship (必需): 要查询的关系类型
      • 可用关系: analyses, behaviours, bundled_files, carbonblack_children, carbonblack_parents, ciphered_bundled_files, ciphered_parents, clues, collections, comments, compressed_parents, contacted_domains, contacted_ips, contacted_urls, dropped_files, email_attachments, email_parents, embedded_domains, embedded_ips, embedded_urls, execution_parents, graphs, itw_domains, itw_ips, itw_urls, memory_pattern_domains, memory_pattern_ips, memory_pattern_urls, overlay_children, overlay_parents, pcap_children, pcap_parents, pe_resource_children, pe_resource_parents, related_references, related_threat_actors, similar_files, submissions, screenshots, urls_for_embedded_js, votes
    • limit (可选, 默认值: 10): 要检索的相关对象的最大数量 (1-40)
    • cursor (可选): 分页的连续游标
  • 示例:
await get_file_relationship(
    hash="44d88612fea8a8f36de82e1278abb02f",
    relationship="behaviours",
    limit=20
)

3. IP 地址关系工具

  • 名称: get_ip_relationship
  • 描述: 查询特定类型的 IP 地址关系,并支持分页
  • 参数:
    • ip (必需): 要分析的 IP 地址
    • relationship (必需): 要查询的关系类型
      • 可用关系: comments, communicating_files, downloaded_files, graphs, historical_ssl_certificates, historical_whois, related_comments, related_references, related_threat_actors, referrer_files, resolutions, urls
    • limit (可选, 默认值: 10): 要检索的相关对象的最大数量 (1-40)
    • cursor (可选): 分页的连续游标
  • 示例:
await get_ip_relationship(
    ip="8.8.8.8",
    relationship="communicating_files",
    limit=20
)

4. 域名关系工具

  • 名称: get_domain_relationship
  • 描述: 查询特定类型的域名关系,并支持分页
  • 参数:
    • domain (必需): 要分析的域名
    • relationship (必需): 要查询的关系类型
      • 可用的关系: caa_records, cname_records, comments, communicating_files, downloaded_files, historical_ssl_certificates, historical_whois, immediate_parent, mx_records, ns_records, parent, referrer_files, related_comments, related_references, related_threat_actors, resolutions, soa_records, siblings, subdomains, urls, user_votes
    • limit (可选,默认值: 10): 检索的相关对象的最大数量(1-40)
    • cursor (可选): 用于分页的继续游标
  • 示例:
await get_domain_relationship(
    domain="example.com",
    relationship="historical_ssl_certificates",
    limit=20
)

5. 高级搜索工具

  • 名称: advanced_corpus_search
  • 描述: 使用 VT Intelligence 查询语法在 VirusTotal 数据集中执行高级搜索
  • 参数:
    • query (必需): VT Intelligence 搜索查询字符串
    • limit (可选,默认值: 20): 每页返回的最大结果数
    • cursor (可选): 用于分页的继续游标
    • descriptors_only (可选): 如果为 true,则仅检索对象描述符而不是完整对象
  • 示例:
await advanced_corpus_search(
    query="type:peexe size:100kb+ positives:5+",
    limit=20,
    cursor=None
)

要求

  • Python >= 3.11
  • 有效的 VirusTotal API 密钥
  • 必需的 Python 包:
    • aiohttp >= 3.9.0
    • mcp[cli] >= 1.4.1
    • python-dotenv >= 1.0.0
    • typing-extensions >= 4.8.0

错误处理

服务器包括以下错误的全面处理:

  • 无效的 API 密钥
  • 速率限制
  • 网络错误
  • 无效的输入参数
  • 无效的哈希格式
  • 无效的 IP 格式
  • 无效的 URL 格式
  • 无效的关系类型
  • 分页错误

开发

以开发模式运行:

python -m virustotal_mcp

贡献

  1. 分叉仓库
  2. 创建一个功能分支 (git checkout -b feature/amazing-feature)
  3. 提交您的更改 (git commit -m 'Add amazing feature')
  4. 推送到分支 (git push origin feature/amazing-feature)
  5. 打开拉取请求

许可证

本项目根据 Apache License 2.0 许可发布 - 请参阅 LICENSE 文件获取详细信息。

致谢

  • VirusTotal 提供了 API 和威胁情报平台
  • MCP 项目提供了服务器框架
  • 贡献者和维护者

支持

如需支持,请:

  1. 查看文档
  2. 搜索现有问题
  3. 如有需要,创建新问题

安全

  • 永远不要提交 API 密钥或敏感凭据
  • 使用环境变量进行配置
  • 在处理威胁情报数据时遵循安全最佳实践