This is a network analyzer that can be used to analyze the network traffic of a computer. It is written in C and uses the libpcap library to capture the packets. You need to have the libpcap library installed on your computer to compile the program :
sudo apt install libpcap-dev
To execute the program, you must first compile it using the command make
. This will create an executable file called sniffer
in the bin
folder.
You can also use the command make test
to compile the program and test it whith the files in the test
folder.
To use the programm, you must run the executable file sniffer
with the following arguments:
-i
followed by the name of the interface to capture the packets from.-o
followed by the file name to sniffer the packets from.(not implemented yet)-f
followed by the filter to apply to the packets.-v
followed by0
or1
or2
to display more infos in the terminal.-h
to display the help.
./sniffer -i eth0
: Capture the packets from the interfaceeth0
.- Note: You must run the program with
sudo
if you want to capture the packets from an interface.
- Note: You must run the program with
./sniffer -o capture.pcap
: Capture the packets from the filecapture.pcap
../sniffer -i eth0 -v 1
: Capture the packets from the interfaceeth0
and display more infos in the terminal.