WireMCP

by 0xKoda
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Runs on Node.js environment to power the MCP server, enabling real-time network traffic analysis and processing.

  • Leverages Wireshark's tshark tool to capture and analyze live network traffic, providing packet-level data, protocol statistics, conversation tracking, and credential extraction capabilities for network diagnostics and security analysis.

WireMCP

WireMCP 是一个模型上下文协议 (MCP) 服务器,旨在为大型语言模型 (LLM) 提供实时网络流量分析功能。WireMCP 利用基于 Wireshark 的tshark构建的工具,捕获并处理实时网络数据,为 LLM 提供结构化上下文,以协助执行威胁搜寻、网络诊断和异常检测等任务。

特征

WireMCP 向 MCP 客户端公开以下工具,增强 LLM 对网络活动的理解:

  • capture_packets :捕获实时流量并以 JSON 格式返回原始数据包数据,使 LLM 能够分析数据包级别的详细信息(例如 IP 地址、端口、HTTP 方法)。
  • get_summary_stats :提供协议层次结构统计信息,让 LLM 了解流量组成的概况(例如,TCP 与 UDP 的使用情况)。
  • get_conversations :提供 TCP/UDP 对话统计信息,允许 LLM 跟踪端点之间的通信流。
  • check_threats :捕获 IP 并根据 URLhaus 黑名单进行检查,为 LLM 提供威胁情报环境以识别恶意活动。
  • check_ip_threats :针对多个威胁源执行针对特定 IP 地址的目标威胁情报查找,提供详细的信誉和威胁数据。
  • analyze_pcap :分析 PCAP 文件以 JSON 格式提供全面的数据包数据,从而实现对网络流量的详细捕获后分析。
  • extract_credentials :扫描 PCAP 文件中来自各种协议(HTTP Basic Auth、FTP、Telnet)的潜在凭证,协助进行安全审计和取证分析。

它如何帮助法学硕士

WireMCP 通过以下方式弥合原始网络数据和 LLM 理解之间的差距:

  • 情境化流量:将实时数据包捕获转换为 LLM 可以解析和推理的结构化输出(JSON、统计数据)。
  • 威胁检测:集成 IOC(当前为 URLhaus)来标记可疑 IP,增强 LLM 驱动的安全分析。
  • 诊断:提供详细的流量洞察,使 LLM 能够协助排除故障或识别异常。
  • 叙事生成:LLM 可以将复杂的数据包捕获转换为连贯的故事,使非技术用户能够进行网络分析。

安装

先决条件

  • Mac / Windows / Linux
  • Wireshark (已安装tshark并可在 PATH 中访问)
  • Node.js(建议使用 v16+)
  • npm(用于依赖项安装)

设置

  1. 克隆存储库:
    git clone https://github.com/0xkoda/WireMCP.git cd WireMCP
  2. 安装依赖项:
    npm install
  3. 运行 MCP 服务器:
    node index.js

注意:确保tshark位于您的 PATH 中。WireMCP 会自动检测它,或者回退到常用的安装位置(例如,在 macOS 上为/Applications/Wireshark.app/Contents/MacOS/tshark )。

与 MCP 客户端一起使用

WireMCP 可与任何兼容 MCP 的客户端兼容。以下是一些常用客户端的示例:

示例 1:游标

在 Cursor -> Settings -> MCP 中编辑mcp.json

{ "mcpServers": { "wiremcp": { "command": "node", "args": [ "/ABSOLUTE_PATH_TO/WireMCP/index.js" ] } } }

位置(macOS)/Users/YOUR_USER/Library/Application Support/Claude/claude_desktop_config.json

其他客户

此 MCP 可与任何客户端兼容。请在客户端的 MCP 服务器设置中使用命令node /path/to/WireMCP/index.js

示例输出

运行check_threats可能会产生以下结果:

Captured IPs: 174.67.0.227 52.196.136.253 Threat check against URLhaus blacklist: No threats detected in URLhaus blacklist.

在捕获文件上运行analyze_pcap

{ "content": [{ "type": "text", "text": "Analyzed PCAP: ./capture.pcap\n\nUnique IPs:\n192.168.0.2\n192.168.0.1\n\nProtocols:\neth:ethertype:ip:tcp\neth:ethertype:ip:tcp:telnet\n\nPacket Data:\n[{\"layers\":{\"frame.number\":[\"1\"],\"ip.src\":[\"192.168.0.2\"],\"ip.dst\":[\"192.168.0.1\"],\"tcp.srcport\":[\"1550\"],\"tcp.dstport\":[\"23\"]}}]" }] }

LLM 可以利用这些输出来:

  • 提供网络活动的自然语言解释
  • 识别模式和潜在的安全问题
  • 提供情境感知建议
  • 生成人类可读的报告

路线图

  • 扩展 IOC 提供商:目前使用 URLhaus 进行威胁检查。未来更新将整合其他来源(例如 IPsum、新兴威胁),以扩大覆盖范围。

贡献

欢迎贡献代码!欢迎提交 Pull 请求。对于重大变更,请先提交一个 issue 来讨论您想要修改的内容。

执照

麻省理工学院

致谢

  • Wireshark/tshark 团队提供出色的数据包分析工具
  • 框架和规范的模型上下文协议社区
  • URLhaus 提供威胁情报数据

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

模型上下文协议服务器为 LLM 提供实时网络流量分析功能,通过 Wireshark 的 tshark 实现威胁搜寻、网络诊断和异常检测等任务。

  1. Features
    1. How It Helps LLMs
  2. Installation
    1. Prerequisites
    2. Setup
  3. Usage with MCP Clients
    1. Example 1: Cursor
    2. Other Clients
  4. Example Output
    1. Roadmap
      1. Contributing
        1. License
          1. Acknowledgments
            ID: d63qil4l1s