This is a simple packet sniffer written in C that captures packets on a specified network interface and prints useful information about the packets such as source and destination MAC addresses, IP addresses, and protocols. The program uses the libpcap library to capture packets
You will need development version of Pcap. Run sudo apt-get install git libpcap-dev
in your Linux terminal
To use this program, follow these steps:
- Git clone this repository using:
git clone https://github.com/umairsafdar768/Simple-Packet-Sniffer-Using-Libpcap
cd
into the cloned repository and runmake
- An executable named packet_sniffer will be created in the current directory. Run it using
sudo ./packet_sniffer
- You will be prompted for name of interface and number of packets to capture. Enter appropriate responses.
- Run
make clean
to clear the main directory
Note: This program requires root privileges to run, as capturing packets requires special permissions.
Feel free to suggest changes/improvements.