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 | Enrollment | Name Lenght | Name |
---|---|---|---|
1 Byte | 8 Bytes | 2 Bytes | According to Name Lenght |
Type | Enrollment |
---|---|
1 Byte | 8 Bytes |
sudo apt-get install libpcap-dev
# Compiling sniffer
gcc sniffer.c -lpcap -o sniffer
# Compiling sender
gcc sender.c -o sender
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