Skip to main content
Glama

Wireshark-MCP

一个基于 Model Context Protocol (MCP) 的网络流量分析服务器,让大语言模型 (LLM) 能够使用 Wireshark/TShark 的强大功能进行自动化的网络取证、威胁狩猎和流量分析。

✨ 核心功能

离线分析 (PCAP)

  • PCAP 分析: 加载并解析 .pcap/.cap 文件

  • CTF 工具集: Flag 搜索、熵值分析、自动解码

  • Webshell 检测: 冰蝎/哥斯拉/蚁剑指纹识别和流量解密

  • 威胁检测: 自动识别 SQL 注入、XSS、Webshell、C2 通信等

  • IOC 提取: 自动提取 IP、域名、URL、User-Agent 等情报

  • 流重组: 自动追踪 TCP 流并提取文件/文本

实时抓包

  • Live Capture: 从网络接口实时捕获流量

  • 协议统计: 协议层次分析和会话统计

  • 威胁情报: IP 黑名单查询 (URLhaus)

  • 凭据提取: HTTP Basic/FTP/Telnet/Kerberos 凭据提取

AI 辅助

  • 结构化输出: 统一的 JSON 格式 {summary, findings, next_steps}

  • 标准调查流程: CTF/取证专用调查 Prompt

  • 智能工具调用: 详细的工具描述,自动引导 AI 使用

Related MCP server: Wireshark MCP

🚀 快速开始

详细安装、配置、使用请参阅:INSTALL_AND_CONFIG.md

MCP 客户端配置(Windows 本地 / Stdio)

将以下配置添加到你的 MCP 客户端配置文件中(如 mcp.json / Trae / Claude Desktop 配置)。该配置适配本仓库的 Windows 目录结构与 run_mcp.py 启动方式:

{
  "mcpServers": {
    "Local-win-wireshark": {
      "command": "E:\\mcp-wireshark\\venv\\Scripts\\python.exe",
      "args": [
        "-u",
        "E:\\mcp-wireshark\\run_mcp.py",
        "--workdir",
        "E:\\mcp-wireshark",
        "--tshark-path",
        "E:\\Wireshark\\tshark.exe",
        "--allow-outside-workdir",
        "--allow-all-tshark-args"
      ]
    }
  }
}

可用工具列表

类别

工具名

功能

基础

list_pcaps

列出目录中的 PCAP 文件

load_pcap

加载 PCAP 并创建分析会话

summary_stats

获取协议统计和 Top Talkers

一键

quick_triage

快速态势感知:协议/Top Talkers/IOC/推荐下一步(支持 pcap_path)

analyze_lateral_movement

一键横向线索:NTLM/SMB/WinRM/RDP 关联(支持 pcap_path)

auto_webshell

一键 Webshell:检测→提钥→尝试解密→提取战利品到 loot(支持 pcap_path)

solve_solar_challenge

题型一键:从 PCAP 自动抽取关键字段并计算最终 flag(支持 pcap_path)

过滤

run_display_filter

应用显示过滤器

run_tshark

执行任意 tshark 命令

追踪

follow_tcp_stream

追踪 TCP 流并提取内容

检测

detect_suspicious

基于规则检测可疑活动

detect_port_scan

检测端口扫描行为

detect_webshell

检测加密 Webshell 流量

CTF

search_patterns

搜索 CTF Flag 模式

analyze_entropy

香农熵分析(检测加密/压缩)

decode_stream

自动 Base64/hex/URL 解码

Webshell

extract_webshell_key

提取解密密钥

decrypt_webshell

解密冰蝎/哥斯拉/蚁剑流量

brute_force_webshell

字典爆破解密密钥

取证

extract_iocs

提取 IOC(IP、域名、URL)

generate_timeline

生成网络事件时间线

export_objects

导出 HTTP 对象和文件

extract_credentials

提取明文凭据和 Kerberos Hash

时序

analyze_timing

检测 C2 心跳和周期性通信

实时

capture_packets

实时抓包并返回 JSON

capture_summary

实时抓包并获取协议统计

capture_conversations

实时抓包并获取会话统计

check_ip_threat

查询 IP 威胁情报

说明:

  • 多数工具支持 session_id 或 pcap_path 二选一(更方便 AI 直接对任意目录的 PCAP 做一次调用得到结果)。

  • decrypt_rdp/analyze_rdp_attack_chain 输出以“取证线索/关联分析”为主,并不承诺一定能完成 TLS/NLA/CredSSP 全量解密。

CTF 使用示例

# 1. 加载 PCAP
load_pcap(pcap_path="./pcaps/attack.pcap")

# 2. 搜索 Flag
search_patterns(session_id="xxx", search_flag=True)

# 3. 检测加密
analyze_entropy(session_id="xxx", stream_index=5)

# 4. 自动解码
decode_stream(session_id="xxx", stream_index=5, encoding="auto")

# 5. 检测 Webshell
detect_webshell(session_id="xxx")

# 6. 暴力破解密钥
brute_force_webshell(session_id="xxx", tool_type="behinder", stream_index=5)

📜 许可证

MIT License

Available Tools

34 tools
advanced_threat_detectionD

Perform advanced threat detection using behavioral analysis and pattern recognition.

Inputs: session_id (required).

analyze_entropyA

【CTF必备】Analyze Shannon entropy of data to detect encryption or compression. High entropy (>5.0) suggests encrypted data. Use this when: 1) User suspects encrypted payload, 2) After finding suspicious data that looks random, 3) Before attempting decryption.

Inputs: session_id (required), threshold, stream_index.

analyze_lateral_movementA

One-shot lateral movement analysis for SMB/NTLM/RDP evidence. Accepts session_id or pcap_path.

Inputs: pcap_path, session_id, include_rdp, max_packets.

analyze_rdp_attack_chainA

【自动化攻击链路】Automated analysis of RDP + NTLM attack chain. Correlates NTLM evidence with RDP sessions and extracts forensic hints. Accepts session_id or pcap_path.

Inputs: pcap_path, session_id, max_packets, auto_correlate.

analyze_timingA

Analyze timing patterns to detect beaconing or periodic communication. Use this when: 1) User suspects C2 heartbeat, 2) Looking for automated callbacks, 3) Anomaly detection in time series.

Inputs: session_id (required), interval_seconds, anomaly_threshold.

auto_webshellA

One-shot webshell analysis: enumerate HTTP streams, detect tool family, extract/guess key, decrypt, and extract loot to workdir/loot. Accepts session_id or pcap_path.

Inputs: loot_dir, pcap_path, session_id, max_packets, +2 more.

brute_force_webshellA

【Webshell专用】Brute force webshell decryption key using common passwords. Use this when: 1) Key extraction failed, 2) Decryption with known key failed, 3) Need to recover key from encrypted traffic.

Inputs: tool_type (required), session_id (required), stream_index (required), custom_wordlist.

capture_conversationsA

【实时抓包】Capture live traffic and provide TCP/UDP conversation statistics. Use this when: 1) User wants conversation details, 2) Identifying communicating pairs, 3) Network mapping.

Inputs: duration, interface, tshark_path.

capture_packetsA

【实时抓包】Capture live traffic and provide raw packet data as JSON. Use this when: 1) User wants to capture live network traffic, 2) Monitoring current network activity, 3) Real-time threat detection.

Inputs: duration, interface, tshark_path.

capture_summaryA

【实时抓包】Capture live traffic and provide protocol hierarchy statistics. Use this when: 1) User wants protocol distribution, 2) Quick network overview, 3) Traffic analysis summary.

Inputs: duration, interface, tshark_path.

check_ip_threatA

【威胁情报】Check an IP address against URLhaus blacklist. Use this when: 1) User asks if an IP is malicious, 2) Checking IOCs, 3) Threat intelligence lookup.

Inputs: ip (required), urlhaus_url.

close_sessionA

Close and clean up a PCAP analysis session.

Inputs: session_id (required).

decode_streamA

【CTF必备】Automatically decode Base64, hex, URL, or rot13 encoded data. Use this when: 1) User asks to decode something, 2) After entropy analysis suggests encoding, 3) Found what looks like encoded flag.

Inputs: session_id (required), stream_index (required), encoding.

decrypt_rdpA

【RDP取证】Analyze RDP sessions and correlate with NTLM evidence (NLA/TLS detection and handshake hints). Does not guarantee full TLS/CredSSP decryption. Accepts session_id or pcap_path.

Inputs: domain, username, ntlm_hash, pcap_path, +3 more.

decrypt_webshellA

【Webshell专用】Decrypt webshell traffic to reveal attacker commands. Supports Behinder (AES), Godzilla (AES+XOR), AntSword (XOR). Use this when: 1) Key has been extracted, 2) User provides the key, 3) Want to see what commands attacker executed.

Inputs: tool_type (required), session_id (required), stream_index (required), key, +1 more.

detect_port_scanA

Detect port scanning behavior from traffic patterns. Use this when: 1) User suspects reconnaissance, 2) Many connections to different ports, 3) Early stage of attack analysis.

Inputs: session_id (required), threshold.

detect_suspiciousB

Detect suspicious activity in the loaded PCAP based on predefined rules.

Inputs: session_id (required), ruleset.

detect_webshellA

【Webshell专用】Detect encrypted webshell traffic (Behinder, Godzilla, AntSword) using fingerprint matching. Use this when: 1) User asks about webshell, 2) Suspicious HTTP traffic found, 3) Encrypted POST data detected.

Inputs: session_id (required), stream_index.

export_objectsA

Export objects (files, certificates, etc.) from a PCAP based on protocol. Accepts session_id or pcap_path.

Inputs: protocol (required), output_dir (required), pcap_path, session_id, +1 more.

extract_credentialsA

【取证分析】Extract credentials (HTTP Basic, FTP, Telnet, Kerberos) from a PCAP file. Use this when: 1) User wants to find passwords, 2) Credential harvesting analysis, 3) Forensic investigation.

Inputs: pcap_path, session_id, tshark_path.

extract_iocsB

Extract Indicators of Compromise (IOCs) from the loaded PCAP.

Inputs: session_id (required), filters.

extract_ntlm_hashesB

【RDP/SMB取证】Extract NTLM hashes from SMB/RDP authentication traffic. Supports Hashcat and John the Ripper formats. Accepts session_id or pcap_path.

Inputs: pcap_path, session_id, max_packets, output_format.

extract_webshell_keyA

【Webshell专用】Extract decryption key from webshell handshake traffic. Use this when: 1) After detect_webshell finds encrypted traffic, 2) User knows the webshell type and wants to decrypt, 3) Found potential key exchange in first request.

Inputs: tool_type (required), session_id (required), stream_index (required), password_hint.

follow_tcp_streamC

Follow and extract the content of a TCP stream.

Inputs: session_id (required), stream_index (required), mode.

generate_timelineB

Generate a timeline of network events from the loaded PCAP.

Inputs: session_id (required), interval_seconds.

get_top_talkersA

Get Top-N communicating pairs by traffic volume. Use this when: 1) User wants to see who talks most, 2) Identifying C2 servers, 3) Finding data exfiltration targets.

Inputs: session_id (required), top_n, metric.

list_pcapsB

List PCAP files in the specified directory.

Inputs: recursive, directory_path.

load_pcapB

Load a PCAP file for analysis and return a session ID.

Inputs: pcap_path (required), max_packets.

quick_triageA

One-shot triage for a PCAP: protocol overview, top talkers, IOC hints, and recommended next analysis tracks. Accepts session_id or pcap_path.

Inputs: top_n, pcap_path, session_id, max_packets, +2 more.

run_display_filterB

Apply a display filter to the loaded PCAP and return matching packets.

Inputs: filter (required), session_id (required), limit.

run_tsharkC

Run a tshark command with specified arguments. Arguments are validated against a whitelist.

Inputs: args (required), timeout, session_id.

search_patternsA

【CTF必备】Search for patterns including CTF flags (flag{...}, CTF{...}) and custom regex. Use this when: 1) User asks to find flag, 2) User wants to search for specific patterns in traffic, 3) After following a TCP stream to search its content.

Inputs: session_id (required), data_source, search_flag, stream_index, +1 more.

solve_solar_challengeA

Solve the Solar traffic-analysis CTF task: extract CVE, forged username, malicious filename, run path, flag, JWT key, and compute final flag{md5(...)}. Accepts session_id or pcap_path.

Inputs: pcap_path, session_id, max_packets.

summary_statsB

Get summary statistics for a loaded PCAP session.

Inputs: session_id (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 34 tools

    Disambiguation2/5

    Multiple tools overlap in purpose, especially in the webshell and detection categories (detect_webshell vs. auto_webshell vs. analyze_webshell; detect_suspicious vs. detect_port_scan vs. advanced_threat_detection). Also quick_triage overlaps with summary_stats and get_top_talkers, and analyze_lateral_movement overlaps with analyze_rdp_attack_chain and extract_ntlm_hashes. The descriptions help, but the boundaries remain unclear.

    Naming Consistency3/5

    Most tools follow a verb_noun pattern (detect_, analyze_, extract_, capture_, run_, list_), but there are notable outliers like advanced_threat_detection, quick_triage, auto_webshell, and summary_stats which use adjective or noun forms. The mixed style is still readable and largely predictable, but not fully consistent.

    Tool Count3/5

    34 tools is on the heavier side, especially with several highly specific CTF/webshell utilities (solve_solar_challenge, brute_force_webshell). However, the domain is complex and warrants a broad toolkit, so the count is not excessive but feels bloated with overlapping features.

    Completeness4/5

    The server covers a wide range of traffic analysis, live capture, IOC extraction, credential harvesting, webshell decryption, and RDP/NTLM forensics. Gaps are minor, such as no direct packet modification or a dedicated tool for listing loaded sessions, but core workflows are well supported.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables LLMs to analyze network packet captures (PCAP files) from local or remote sources through a modular architecture. Supports DNS traffic analysis with structured JSON responses for network security and troubleshooting tasks.
      9
      117 PyPI
      54
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to analyze network traffic using Wireshark/tshark, providing packet statistics, protocol analysis, and anomaly detection through natural language interaction.
      75
      MIT