Skip to content

Barbalho12/basic-sniffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sniffer

Program for monitoring network packets

sniffer is listening by default with filter:

  • Interface: lo
  • Protocol: UDP
  • Port: 1234

And search for messages of two types:

Type 1

Type Enrollment Name Lenght Name
1 Byte 8 Bytes 2 Bytes According to Name Lenght

Type 2

Type Enrollment
1 Byte 8 Bytes

Download libpcap

sudo apt-get install libpcap-dev

Compiling

# Compiling sniffer
gcc sniffer.c -lpcap -o sniffer

# Compiling sender
gcc sender.c -o sender

Running

For the sniffer add the interface in which you will be listening as a parameter

And for the sender add: out interface, destination mac, destination ip, port, enrollment, and the student's name (message type and name size will be inferred)

# In Terminal 1 
sudo ./sniffer lo

# In Terminal 2
sudo ./sender lo 00:00:00:00:00:00 127.0.0.1 1234 98764532 user_name # Pattern with menssage type 1
sudo ./sender lo 00:00:00:00:00:00 127.0.0.1 1234 98764532 # Or Pattern with menssage type 2

Releases

No releases published

Packages

No packages published

Languages