A simple CLI packet sniffer written in C
GPL-3.0 License
A simple and efficient packet sniffer library built using libpcap 0.8. This library provides an easy-to-use API for capturing, parsing, and analyzing network packets in real-time. It's perfect for network debugging, monitoring, and research purposes.
GETTING STARTED
IMPORTANT:
INSTALLATION:
sudo apt install libpcap0.8-dev
gcc pcap_sniffer.c pcap_functions.c print_colors.c -o pcap_sniffer -lcap
USAGE:
sudo ./pcap_sniffer --help -i : interface on which to sniff -p : protocol to sniff -s : source port to filter -d <dest. port>: destination port to filter -S : source IP to filter -D <dest. IP>: destination IP to filter -r : port range (from x-y) -l: list all network interfaces -n <# of packets>: number of packet to sniff (10 by default) --help: displays this menu
EXAMPLES:
Sniffs for 100 packets on interface wlan0:
sudo ./pcap_sniffer -i wlan0 -n 100
Sniffs for 100 TCP packet on interface wlan0:
sudo ./pcap_sniffer -i wlan0 -n 100 -p tcp
SCREENSHOTS:
CONTRIBUTING:
Contributions are welcome! If you encounter any bugs or have suggestions for improvement, please submit an issue or pull request. Make sure to follow our Contributing Guidelines when submitting changes.