Packet Sniffer application written in Python that provides functionality to capture, analyze, and display network packets in real time.
Note this project is not done...
Our instagram page
.
Our youtube chanel
.
Our twitter page
This project is a Packet Sniffer application written in Python that provides functionality to capture, analyze, and display network packets in real time. The application offers both a Graphical User Interface (GUI) using PyQt5 and a Command Line Interface (CLI) mode for flexible usage. Users can view detailed packet information in either mode and switch between them based on their requirements.
A sniffer is a software or hardware tool that allows the user to “sniff” or monitor your internet traffic in real time, capturing all the data flowing to and from your computer.
Sniffers work by capturing and inspecting "packets" of data as they travel across a network. Think of internet traffic like real-world traffic: it's like a series of cars driving down a road, and it slows down depending on a variety of factors. On the internet, each car is a packet, and the people inside it are the data it carries.
The GUI includes the following components:
- Host Input: Enter the host IP address for sniffing.
- Start/Stop Buttons: Control the sniffing process.
- Packet Table: Displays captured packets with the following columns:
- Protocol
- Source IP
- Destination IP
- ICMP Type
- ICMP Code
- ICMP Sequence
- TTL
- Packet ID
- Packet Length
- View Options: Toggle the visibility of columns in the packet table.
- Packet Details: Double-click a packet in the table to open a detailed view, showing:
- Connection details (protocol, source, destination, etc.).
- Raw packet data in binary and hexadecimal formats.
Basic Mode: Displays a summary of captured packets, including:
-
Protocol
-
Source and Destination IPs
-
ICMP details (if applicable)
-
TTL, Packet ID, and Length
Example Output:
Protocol: ICMP, Source: 192.168.1.10, Destination: 192.168.1.1, ICMP Type: 8, ICMP Code: 0, ICMP Seq: 1, TTL: 64, ID: 54321, Length: 98
-
-
Detailed Mode: Displays additional information such as the raw binary and hexadecimal data of packets.
Example Output:
[Packet Captured] Protocol: ICMP Source: 192.168.1.10 Destination: 192.168.1.1 ICMP Type: 8 ICMP Code: 0 ICMP Seq: 1 TTL: 64 Packet ID: 54321 Length: 98 Raw Buffer: 45000054000040004001be5bc0a80101c0a80102e91f0001abcd...
-
Packet Sniffing:
- The program uses raw sockets to capture network packets.
- IP headers and ICMP headers are parsed using struct.unpack() to extract details.
-
GUI Functionality:
- A QTableWidget is used to display packet details.
- Clicking a row in the table opens a dialog showing raw data in binary and hex formats.
- Threading ensures the GUI remains responsive during sniffing.
-
CLI Functionality:
- Packets are displayed in real time with structured and optionally detailed outputs.
Prerequisites:
- Python 3.6+: Ensure you have Python installed.
- PyQt5: Required for the GUI. Install it using:
pip install PyQt5
Clone the Repository:
git clone https://github.com/errorfiathck/Demon-Sniffer.git
cd packet-sniffer
Command-Line Arguments
- -A: Launch the GUI mode for packet sniffing.
- -host [IP]: Specify the host IP address for packet sniffing.
- -details: Display detailed packet information in the CLI.
Examples:
Launch GUI Mode
python demon-sniffer.py -A -host 192.168.1.1
Basic CLI Mode
python demon-sniffer.py -host 192.168.1.1
Detailed CLI Mode
python demon-sniffer.py -host 192.168.1.1 -details
- Requires administrative/root privileges to run due to the use of raw sockets.
- Limited protocol support (ICMP).
- Packet capture and display may not handle high traffic efficiently.