This is a simple packet sniffer capable of capturing frames on one interface while allowing filtering by port number. It can capture frames of TCP, UDP, ARP and ICMP protocols and user options allow for filtering any combination of these protocols. It supports both IPv4 and IPv6 packets (so capturing ICMP packets captures both ICMPv4 and ICMPv6). It is written in C++.
Patrik Skaloš
./ipk-sniffer [-h] [-i int] [-p port] [--tcp] [--udp] [--arp] [--icmp] [-n num]
-h
print this help
-i
interface to sniff on
-p
port to use
--tcp
, --udp
, --icmp
, --arp
select protocols to filter the traffic by.
If none is used, all four protocols are selected by default
-n
amount of packets to stop after \
Note: Program may require root privileges
./ipk-sniffer -h
./ipk-sniffer -i
./ipk-sniffer -i wlo1 --tcp -n 4
./ipk-sniffer -i wlo1 -p 80
or
./ipk-sniffer -i wlo1 -p 80 --tcp --udp --arp --icmp
./ipk-sniffer -i wlo1 -p 80 --udp --icmp
The code requires some standard libraries along with arpa/inet
and several
netinet
libraries.
The sniffer can be safely killed using SIGINT
signal (Ctrl+C). Using any other
signal might result in an interface handle not being closed.
For more information about this project (including introduction, references
and such), check out the documentation in doc/
folder.