A Python-based network packet sniffer that captures and analyzes network traffic in real-time. This tool uses the Scapy library to capture packets and provide detailed information about network communications, including packet payload analysis and protocol-specific details.
- Real-time packet capture and analysis
- Detailed protocol analysis
- TCP analysis (flags, sequence numbers, window size)
- UDP analysis
- ICMP type and code identification
- HTTP request/response analysis
- DNS query/response analysis
- Payload Analysis
- Hex dump with ASCII representation
- Text content detection and decoding
- Protocol-specific payload parsing
- Network statistics tracking
- Packet sizes and averages
- Total bytes captured
- Protocol distribution
- Top IP conversations
- Most active ports
- Comprehensive Logging
- Automatic file creation with timestamps
- Save all captured data to file
- Detailed packet information
- Traffic analysis
- Statistics and summaries
- Timestamps for all events
- Source and destination IP/port tracking
- Flexible packet filtering
- Command-line interface with customizable options
- Python 3.x
- Scapy library
- Administrator/root privileges (required for packet capture)
- Install the required dependencies:
pip install -r requirements.txtThe Network Sniffer now includes a Wireshark-like GUI interface for easier packet analysis. To run the GUI version:
python network_sniffer_gui.py- Select your network interface from the dropdown menu at the top
- Click "▶ Start Capture" to begin capturing packets
- Click "⏹ Stop Capture" when you want to stop the capture
- The top pane shows the list of captured packets
- Click on any packet to view its details
- The middle pane shows the packet's protocol layers in a tree view
- The bottom pane displays a hex dump of the packet with ASCII representation
- Use the filter box in the toolbar to search through captured packets
- Type any text and click "Apply" to filter the packet list
- The filter searches across all packet fields (source, destination, protocol, etc.)
- Click the "📊 Statistics" button to open the statistics window
- View real-time statistics including:
- Total number of packets captured
- Protocol distribution
- Traffic patterns
- Most active protocols
[Coming Soon]
This tool requires administrator/root privileges to capture packets. Run with appropriate permissions.