You are on page 1of 1

UNIVERSITY OF CENTRAL PUNJAB

(Faculty of IT&CS)
Information Security
Assignment No 1 Date: 29 Mar 2023
Total Marks: 100 Due Date: 07 Apr 2023

Programming Assignment

Develop a Packet Sniffing application in Unix C environment using


Packet Capture library “libpcap”

A general purpose packet sniffer in Unix C environment can be developed using “libpcap”
packet capture library. Consult the class lecture notes, libpcap programming guide provided in class, as
well as the web, and develop an understanding of the use/syntax of the various library functions used
for packet capturing, such as pcap_lookupdev( ), pcap_open_live( ), pcap_loop( ) or pcap_next(),
etc.
Then write the code to capture packets and process their headers to display major header field
values at data link layer, network layer, and transport layer.
While parsing protocol headers, the program will first need to determine the upper layer
protocol type, and then proceed to process/display the requisite protocol header fields.

The report is to include the following:-


(a) There should be a Title Page showing Subject, Assignment Number, Student Name/ID and
Date of Submission.
(b) Hard copy of complete code is to be provided; code should be well commented to indicate what
function is being performed; also, code should be readable (reasonable font size) and not span
unnecessary pages.
(c) Screen shots of packet sniffer functionality in terminal window, showing the Hex dump of at
least two captured packets, along with the major field values for Ethernet, IP and TCP headers.

Assignment Guidelines:

Hard copy of assignment is to be submitted in groups (2 students per group).

Program should not have been copied verbatim from any source, and should have only the required
functionality.

Code will also be submitted in hard copy; it should be in small font for good readability and indented/
well commented.

The screen shots of code functionality should be included in assignment.

Demo of running code will be given by individual groups. A viva will be conducted in class on Friday.

You might also like