A simple Python-based network packet sniffer built for Kali Linux. This tool captures and analyzes network traffic, providing insights into packets such as source/destination IP addresses, protocols, and payload data.
The packet sniffer uses the scapy
library to capture and analyze network packets. Here's what it does:
-
Packet Capture:
- The tool listens on a specified network interface (e.g.,
eth0
orwlan0
). - It captures packets in real-time as they travel through the network.
- The tool listens on a specified network interface (e.g.,
-
Packet Analysis:
- For each captured packet, the tool extracts key information:
- Source IP: The IP address of the sender.
- Destination IP: The IP address of the receiver.
- Protocol: The network protocol used (e.g., TCP, UDP, ICMP).
- Payload: The raw data being transmitted (if applicable).
- For each captured packet, the tool extracts key information:
-
Output:
- The tool prints the extracted information to the terminal in a readable format.
- Kali Linux (or any Linux distribution with Python 3).
- Python 3.x.
- The
scapy
library (install usingpip
).
- Install Scapy:
sudo apt update sudo apt install python3-pip pip3 install scapy
- Clone the Repository:
git clone https://github.com/yourusername/network-packet-sniffer.git cd network-packet-sniffer
- Run the Script:
sudo python3 packet_sniffer.py
- Specify the Network Interface: When prompted, enter the network interface you want to sniff (e.g., eth0, wlan0).
The tool will start capturing and displaying packets.
$ sudo python3 packet_sniffer.py
Enter the network interface to sniff (e.g., eth0, wlan0): wlan0
[*] Starting packet capture on wlan0...
[+] Packet Captured:
Source IP: 192.168.1.100
Destination IP: 192.168.1.1
Protocol: TCP
Payload: b'GET / HTTP/1.1\r\nHost: example.com\r\n\r\n'
[+] Packet Captured:
Source IP: 192.168.1.1
Destination IP: 192.168.1.100
Protocol: UDP
Payload: b'\x00\x01\x02\x03'