Sniffer is a simple packet sniffer that analyzes HTTP and DNS packets with details and also gives general information about TCP and UDP conversations. Sniffer is written in c and uses libpcap library to read and maybe filter packets coming from network interface controllers.
To compile C files you must have libpcap installed, if you don't, this command do it for you.
sudo apt install libpcap-dev # Debian and Ubuntu only
After installing libpcap, you can simply(if GCC is installed) use Make using make, make normal, make separated to compile (difference of them is explained later) and make clean to delete the compiled file(It just removes Sniffer object file from directory).
Now after compiling code, the code can run via running this command
sudo. /sniffer [the device you want to sniff]
If you don't know which device you want to sniff use sudo. /sniffer and then choose from the listed devices. If you still don't know your choice just let time pass, code will choose the first one automatically.
Program won't show you outputs directly rather generates some logs using syslog which in ubuntu 20. 04 they are stored in /var/log/syslog/ but it differs from OS to OS. you can also use the flowing command to get logs that is cleaner than searching through thousands of logs to find program logs.
tail -f /var/log/syslog | grep Sniffer
Sniffer
is a simple packet
sniffer
that analyzes HTTP and DNS packets with
details
and
also
gives general information about TCP and UDP conversations.
Sniffer
is written
in c and
uses
libpcap
library to read and maybe filter packets coming from network interface controllers.
To compile C files you
must
have
libpcap
installed, if you don't, this command do it for you.
sudo
apt install
libpcap-dev
# Debian and Ubuntu
only
After installing
libpcap
, you can
simply
(if GCC
is installed
)
use
Make
using
make
,
make
normal,
make
separated to compile (difference of them is
explained
later) and
make
clean to delete the compiled file(It
just
removes
Sniffer
object file from directory).
Now
after compiling code, the code can run via running this command
sudo
. /sniffer [the device you want to sniff]
If you don't know which device you want to sniff
use
sudo
. /sniffer and then choose from the listed devices. If you
still
don't know your choice
just
let
time pass, code will choose the
first
one
automatically
.
Program won't
show
you outputs
directly
rather
generates
some
logs using
syslog
which in
ubuntu
20. 04 they
are stored
in /var/log/
syslog
/
but
it differs from OS to OS. you can
also
use
the flowing command to
get
logs
that is
cleaner than searching through thousands of logs to find program logs.
tail
-f /var/log/
syslog
| grep
Sniffer