0% found this document useful (0 votes)
12 views4 pages

CNassignment 1

This document outlines the assignment details for a Computer Networks course, including submission guidelines and deadlines. It consists of seven questions covering various topics such as HTTP requests, DNS record analysis, FTP automation, email spoofing, packet capturing, and response time modeling. Students are required to follow specific formatting and coding practices, with penalties for plagiarism and late submissions.

Uploaded by

i220894
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views4 pages

CNassignment 1

This document outlines the assignment details for a Computer Networks course, including submission guidelines and deadlines. It consists of seven questions covering various topics such as HTTP requests, DNS record analysis, FTP automation, email spoofing, packet capturing, and response time modeling. Students are required to follow specific formatting and coding practices, with penalties for plagiarism and late submissions.

Uploaded by

i220894
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Computer Networks

CS - (Spring 25)
Assignment-1

Marks 40

Submission Date 1st March 2025

Instructions:

● This is an individual Assignment.


● All parties involved in any kind of plagiarism/cheating (even in a single line of code) will be
given zero marks in all the assignments.
● Assignment deadline won’t be extended
● Late submissions will be discarded so submit your assignment on-time
● You must follow below submission guidelines, otherwise your submission won’t be accepted
○ create a new directory
○ change its name to the following format
YOURSECTION_ROLLNUMBER_NAME.
E.g. A_20I-0012_Muhammad Ahamd
○ put all your files into this newly created directory (code files and output screenshots, scan
pdf for theoretical questions)
○ Compress the directory into a compressed .zip file
○ Submit it on google classroom
● Use good programming practices (well commented and indented code; meaningful variable
names, readable code etc.).
● Understanding the problem is also part of the assignment.

---------------------------------------------------------------------------------------------------------------------

QUESTION 1 (5 Marks)
1. Intercept an HTTP request using a proxy tool like Burp Suite or mitmproxy.

o Analyze the request headers, response headers, and payload.


o Identify security vulnerabilities (e.g., missing HTTPS, exposed cookies).

2. Simulate a basic HTTP server using Python (Use Flask or SimpleHTTPServer).

o Write a Python script that serves a simple HTML page.

o Demonstrate handling GET and POST requests with form data.

QUESTION 2 (5 Marks)
1. DNS Record Analysis:

o Use the nslookup or dig command to find:

▪ The A, AAAA, MX, and NS records for example.com.

▪ The IP address of your university website.

2. Custom DNS Resolver (Python Challenge)

o Write a Python script using socket to send a query to a public DNS resolver (e.g., 8.8.8.8)
and parse the response manually.

o Return the resolved IP address of a domain entered by the user.

QUESTION 3 (5 Marks)
1. Automate File Upload and Download via FTP (Python Scripting)

o Write a Python script using the ftplib library to:

▪ Connect to an FTP server (e.g., speedtest.tele2.net).

▪ List available files.

▪ Download a test file.

▪ Upload a small text file (if allowed).

QUESTION 4 (5 Marks)
1. Send a Fake Email using Python (Without Authentication)

o Use Python’s smtplib to send an email using an open relay SMTP server.

o Change the From: address to a fake sender (e.g., [email protected]).

o Observe if the email gets delivered or rejected.


2. Explain how SPF, DKIM, and DMARC prevent email spoofing.

QUESTION 5 (5 Marks)
1. Capture Live HTTP, FTP, and DNS Packets

o Use Wireshark to filter and capture packets for:

▪ HTTP GET requests

▪ DNS Query responses

▪ FTP file transfer data

2. Analyze a captured HTTP request

o Identify the requested URL, User-Agent, and cookies.

o Explain how HTTPS protects sensitive data compared to HTTP.

QUESTION 6 (10 Marks)


Consider that you are working on one of the lab systems of GoodWell software house having a LAN
network with 350 Mb/s transmission rate to institutional Router 1, for which there is an institutional
network connected to the Internet. Suppose that the average object size is 250,000 bits and that the
average request rate from the Lab’s browsers to the origin servers is 35 requests per second. Also suppose
that the amount of time it takes from when the router on the Internet side (Router 2) of the access link
forwards an HTTP request until it receives the response is 2.5 seconds on average. Model the total average
response time as the sum of the average access delay (that is, the delay from Router 2 to Router 1) and
the average Internet delay.

i. Find the total average response time. [4]

ii. Now suppose that a web cache is installed on the GoodWell Lab network’s LAN. Suppose that the miss
rate is 0.7. Find the total response time (considering that the response time from the cache is 0.01 sec)
[6]

QUESTION 7 Bonus Challenge - Build a Simple Proxy Server (5 Marks)


(Extra credit for students who complete this!)

1. Write a Python script that acts as an HTTP proxy server.

o Accept client requests.


o Forward them to the target website.

o Return the response to the client.

o Log all requests and responses.

------------------------------------------------------- Best of Luck! ------------------------------------------------

You might also like