Wireshark MCP Server

Wireshark MCP Server

A Model Context Protocol server that enables AI assistants to perform network packet analysis, capture, and security operations on a remote machine via Wireshark/tshark.

Category
访问服务器

README

Wireshark MCP Server

A Model Context Protocol (MCP) server that provides network packet analysis capabilities via Wireshark/tshark on a remote machine (e.g., Kali Linux).

This server enables AI assistants to perform sophisticated network traffic analysis, packet capture, protocol inspection, and security-focused operations through a standardized MCP interface.

Features

  • Live Packet Capture - Capture network traffic on remote interfaces with BPF filters
  • PCAP Analysis - Read and analyze existing pcap files
  • Protocol Statistics - Generate protocol hierarchy, conversations, endpoints, and I/O statistics
  • Stream Reconstruction - Follow TCP, UDP, HTTP, and TLS streams
  • File Extraction - Extract files from HTTP, SMB, DICOM, IMF, and TFTP traffic
  • Deep Packet Inspection - Decode packets with full protocol details
  • Credential Extraction - Search for credentials in HTTP Basic Auth, FTP, Telnet, and form submissions
  • HTTP Object Export - List and export HTTP objects from captures

Prerequisites

  • Node.js 18+
  • SSH access to a remote machine with tshark installed (e.g., Kali Linux)
  • SSH key-based authentication configured (password-less)
  • sudo access on the remote machine for packet capture

Installation

git clone https://github.com/schwarztim/sec-wireshark-mcp.git
cd sec-wireshark-mcp
npm install
npm run build

Configuration

Set the following environment variables:

Variable Description Default
WIRESHARK_SSH_HOST SSH hostname or IP of the remote machine kali
WIRESHARK_SSH_USER SSH username (optional if using SSH config) (empty)
WIRESHARK_PCAP_DIR Directory on remote host for pcap files /tmp/mcp-pcaps

Example Configuration

export WIRESHARK_SSH_HOST="192.168.1.100"
export WIRESHARK_SSH_USER="kali"

Or use an SSH config entry:

# ~/.ssh/config
Host kali
    HostName 192.168.1.100
    User kali
    IdentityFile ~/.ssh/id_rsa

Usage with Claude Desktop

Add to your Claude Desktop configuration (~/.claude/user-mcps.json or Claude Desktop settings):

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

Available Tools

tshark_list_interfaces

List available network interfaces on the remote machine for packet capture.

tshark_capture

Start packet capture on a specified interface.

Parameters:

  • interface (required): Network interface (e.g., eth0, wlan0)
  • count: Number of packets to capture (default: 10, max: 1000)
  • filter: BPF capture filter (e.g., port 80, host 192.168.1.1)
  • timeout: Capture timeout in seconds (default: 10, max: 60)
  • outputFile: Save capture to pcap file on remote host

tshark_read_pcap

Read and analyze a pcap file.

Parameters:

  • file (required): Path to the pcap file on remote host
  • filter: Wireshark display filter
  • count: Maximum packets to return (default: 100, max: 1000)
  • fields: Specific fields to extract (e.g., ['ip.src', 'ip.dst', 'tcp.port'])

tshark_filter

Apply a display filter to a pcap file.

Parameters:

  • file (required): Path to the pcap file
  • filter (required): Display filter (e.g., http.request, dns, tcp.flags.syn == 1)
  • outputFormat: json, text, or fields (default: json)
  • fields: Fields to extract when using fields format

tshark_stats

Generate protocol statistics from a pcap file.

Parameters:

  • file (required): Path to the pcap file
  • type (required): hierarchy, conversations, endpoints, io, http, or dns
  • protocol: Protocol for conversations/endpoints (e.g., tcp, udp, ip)

tshark_follow_stream

Reconstruct a TCP, UDP, HTTP, or TLS stream.

Parameters:

  • file (required): Path to the pcap file
  • protocol (required): tcp, udp, http, or tls
  • streamIndex: Stream index number (default: 0)
  • format: ascii, hex, or raw (default: ascii)

tshark_extract_files

Extract files from protocol traffic.

Parameters:

  • file (required): Path to the pcap file
  • protocol: http, dicom, imf, smb, or tftp (default: http)
  • outputDir: Directory for extracted files (default: /tmp/mcp-extracted)

tshark_decode

Deep packet inspection with full protocol details.

Parameters:

  • file (required): Path to the pcap file
  • packetNumber: Specific packet number to decode
  • filter: Display filter to select packets
  • protocols: Specific protocols to show (e.g., ['http', 'tcp', 'ip'])
  • verbose: Show all protocol details (default: false)

tshark_extract_credentials

Search for potential credentials in network traffic.

Parameters:

  • file (required): Path to the pcap file

Searches for HTTP Basic Auth, FTP credentials, HTTP POST form data, and Telnet data.

tshark_export_objects

List and export HTTP objects from a capture.

Parameters:

  • file (required): Path to the pcap file
  • listOnly: Only list objects without extracting (default: true)
  • outputDir: Directory for extracted objects

Security Considerations

  • This server executes commands on a remote machine via SSH
  • Input sanitization is implemented to prevent command injection
  • Use SSH key authentication with appropriate permissions
  • Consider network segmentation for the capture machine
  • The remote machine requires sudo access for live capture
  • Credential extraction features should be used only for authorized security testing

Development

# Run in development mode
npm run dev

# Build for production
npm run build

# Start production server
npm start

License

MIT License - see LICENSE for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Related Projects

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选