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(用于依赖项安装)
设置
- 克隆存储库:
- 安装依赖项:
- 运行 MCP 服务器:
注意:确保
tshark
位于您的 PATH 中。WireMCP 会自动检测它,或者回退到常用的安装位置(例如,在 macOS 上为/Applications/Wireshark.app/Contents/MacOS/tshark
)。
与 MCP 客户端一起使用
WireMCP 可与任何兼容 MCP 的客户端兼容。以下是一些常用客户端的示例:
示例 1:游标
在 Cursor -> Settings -> MCP 中编辑mcp.json
:
位置(macOS) : /Users/YOUR_USER/Library/Application Support/Claude/claude_desktop_config.json
其他客户
此 MCP 可与任何客户端兼容。请在客户端的 MCP 服务器设置中使用命令node /path/to/WireMCP/index.js
。
示例输出
运行check_threats
可能会产生以下结果:
在捕获文件上运行analyze_pcap
:
LLM 可以利用这些输出来:
- 提供网络活动的自然语言解释
- 识别模式和潜在的安全问题
- 提供情境感知建议
- 生成人类可读的报告
路线图
- 扩展 IOC 提供商:目前使用 URLhaus 进行威胁检查。未来更新将整合其他来源(例如 IPsum、新兴威胁),以扩大覆盖范围。
贡献
欢迎贡献代码!欢迎提交 Pull 请求。对于重大变更,请先提交一个 issue 来讨论您想要修改的内容。
执照
致谢
- Wireshark/tshark 团队提供出色的数据包分析工具
- 框架和规范的模型上下文协议社区
- URLhaus 提供威胁情报数据
You must be authenticated.
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
模型上下文协议服务器为 LLM 提供实时网络流量分析功能,通过 Wireshark 的 tshark 实现威胁搜寻、网络诊断和异常检测等任务。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that provides LLM Agents with a comprehensive toolset for IP geolocation, network diagnostics, system monitoring, cryptographic operations, and QR code generation.Last updated -1634TypeScriptApache 2.0
- AsecurityAlicenseAqualityA Model Context Protocol server that gives LLMs the ability to interact with Ethereum networks, manage wallets, query blockchain data, and execute smart contract operations through a standardized interface.Last updated -313232TypeScriptMIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that provides basic mathematical and statistical functions to LLMs, enabling them to perform accurate numerical calculations through a simple API.Last updated -1313TypeScriptMIT License
- -securityFlicense-qualityA Model Context Protocol server that connects LLMs to the Compiler Explorer API, enabling them to compile code, explore compiler features, and analyze optimizations across different compilers and languages.Last updated -Python