Skip to main content
Glama
PreistlyPython

Wireshark MCP Server

PACKET_CAPTURE_GUIDE.mdβ€’5.27 kB
# 🦈 Wireshark MCP Packet Capture Setup Guide ## πŸš€ Quick Start - Enable Packet Capture The Wireshark MCP now includes **automatic permissions handling** and **real packet capture capabilities**! ### **Step 1: Run the Setup Script** ```bash cd /home/dell/coding/mcp/wireshark-mcp ./setup_permissions.sh ``` ### **Step 2: Activate Group Membership** ```bash # Either log out and back in, OR run: newgrp wireshark ``` ### **Step 3: Test Permissions** ```bash ./test_capture_permissions.py ``` ### **Step 4: Restart Claude Desktop** Close Claude Desktop completely and reopen it. --- ## πŸ”§ What the Setup Does ### **Secure Permissions Configuration** - βœ… Creates `wireshark` group for secure access control - βœ… Adds your user to the wireshark group - βœ… Sets Linux capabilities on capture tools (dumpcap, tshark, tcpdump) - βœ… Restricts access to group members only - βœ… No need for sudo during operation ### **Security Features** - πŸ›‘οΈ **Group-based access** - Only wireshark group members can capture - πŸ›‘οΈ **Capability-based permissions** - No root privileges required - πŸ›‘οΈ **Tool isolation** - Only capture tools have elevated capabilities - πŸ›‘οΈ **Automatic cleanup** - Temporary files cleaned up after analysis --- ## πŸ“‘ Live Packet Capture Features ### **Automatic Permission Detection** The Wireshark MCP now automatically detects if you have packet capture permissions: - βœ… **With Permissions**: Real packet capture using dumpcap/tshark - ⚠️ **Without Permissions**: Provides setup instructions ### **Real Packet Capture** ```bash # Through Claude Desktop MCP interface: "Capture live packets on interface wlp2s0 for 30 seconds with HTTP filter" ``` **Capabilities:** - πŸ“Š **Live capture** on any network interface - 🎯 **Smart filtering** using Wireshark display filters - ⏱️ **Duration control** (default: 60 seconds) - πŸ“¦ **Packet limits** (default: 1000 packets) - 🧹 **Automatic cleanup** of temporary files --- ## πŸ“ˆ PCAP File Analysis Features ### **Comprehensive Analysis Types** 1. **Quick Analysis** - Basic packet counts and protocols 2. **Security Analysis** - Threat detection and suspicious patterns 3. **Performance Analysis** - Network health and TCP issues 4. **Comprehensive Analysis** - All of the above combined ### **Security Pattern Detection** - 🚨 TCP SYN flood detection - πŸ” Port scan indicators - πŸ•³οΈ DNS tunneling detection - πŸ“Š Large HTTP request analysis - ⚠️ Non-standard port usage ### **Performance Metrics** - πŸ“‰ TCP retransmissions - πŸ”„ Duplicate ACK analysis - ⏸️ Zero window conditions - πŸ’“ Keep-alive patterns - πŸ₯ Overall network health assessment --- ## πŸ§ͺ Testing Your Setup ### **Test Script Results** After running `./test_capture_permissions.py`, you should see: ``` πŸ§ͺ Testing packet capture capabilities... ======================================== βœ… dumpcap: Capture started successfully (timeout expected) βœ… tshark: Capture started successfully (timeout expected) βœ… tcpdump: Capture started successfully (timeout expected) ======================================== βœ… 3/3 capture tools working without sudo πŸš€ Wireshark MCP packet capture is ready! ``` ### **Troubleshooting** If tests fail: 1. **Log out and back in** (group membership activation) 2. **Check group membership**: `groups $USER` 3. **Verify capabilities**: `getcap $(which dumpcap)` 4. **Re-run setup**: `./setup_permissions.sh` --- ## 🎯 Usage Examples ### **Through Claude Desktop** Once setup is complete, you can use natural language commands: **System Information:** ``` "Get Wireshark MCP system information" ``` **Live Capture:** ``` "Capture HTTP traffic on ethernet interface for 30 seconds" "Capture DNS queries on any interface with 100 packet limit" ``` **Filter Generation:** ``` "Generate a Wireshark filter for HTTPS traffic to Google" "Create a filter for slow TCP connections" ``` **PCAP Analysis:** ``` "Analyze /path/to/capture.pcap for security threats" "Perform quick analysis on /tmp/network.pcapng" ``` --- ## πŸ”’ Security Considerations ### **What's Protected** - βœ… Only wireshark group members can capture packets - βœ… Capabilities limited to network capture only - βœ… No system-wide root privileges granted - βœ… Temporary files automatically cleaned up ### **What's Accessible** - πŸ“‘ All network interfaces on the system - πŸ“Š Raw packet data (same as tcpdump/wireshark) - πŸ” Network traffic analysis capabilities ### **Best Practices** - 🎯 Use specific interfaces when possible (not "any") - ⏱️ Limit capture duration for large networks - 🧹 Captured files are automatically cleaned up after 5 minutes - πŸ”’ Only add trusted users to wireshark group --- ## βœ… Success Indicators After successful setup, your Wireshark MCP will provide: 1. **βœ… Real Packet Capture** - No more simulation mode 2. **πŸ” Intelligent Analysis** - Security, performance, and comprehensive insights 3. **🎯 Smart Filtering** - Natural language to Wireshark filters 4. **πŸ›‘οΈ Secure Operation** - No sudo required during operation 5. **🧹 Automatic Cleanup** - Temporary files managed automatically --- **πŸŽ‰ Your Wireshark MCP is now ready for professional network analysis!**

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PreistlyPython/wireshark-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server