This project will introduce you to common network protocols, to network packet trace analysis, and to the basics of network penetration testing.
This is a group assignment, and must be done in groups of 2 or 3 only.
This project asks you to perform attacks, with our permission, against a target network that we are providing for this purpose. Attempting the same kinds of attacks against other networks without authorization is prohibited by law and university policies. You must not attack any network without authorization! Per course policy, you are required to respect the privacy and property rights of others at all times. See “Right, Rules, and Responsibilities” on the Princeton University website for more details.
Additionally, please understand and honor the specific actions that are OUT OF SCOPE for Part 3 of the assignment at the end of that section.
netsec-answers.pdf
file.
part1.pcap
file from the zip file that you downloaded. Familiarize yourself with
Wireshark’s features. Try exploring the various options for filtering and for reconstructing data streams.
Concisely answer the questions below. Each response should require at most two to three sentences. Use the
provided template file: netsec-answers.pdf
SYN
scan, the scanner sends
TCP SYN
packets (the first packet in the TCP handshake) and watches for hosts that respond with SYN+ACK
packets (the second handshake step).
Since most hosts are not prepared to receive connections on any given port, typically, during a port scan, a much
smaller number of hosts will respond with SYN+ACK
packets than originally received SYN
packets. By observing this effect in a packet trace, you can identify source addresses that may be attempting a
port scan.
Your task is to develop a Python program that analyzes a pcap file in order to detect possible SYN
scans. To do this, you will use dpkt
, a library for packet manipulation and dissection. It is
available in most package repositories. You can find more information about dpkt
at https://github.com/~kbandla/dpkt
and view documentation by running pydoc dpkt
, pydoc dpkt.ip
, etc.; there's also a helpful
tutorial here: https://jon.oberheide.org/blog/2008/10/15/dpkt-tutorial-2-parsing-a-pcap-file
Your program will take the path of the pcap file to be analyzed as a command-line parameter, e.g.:
python2.7 detector.py capture.pcap
SYN
packets as the number of SYN+ACK
packets they received. Your program should silently ignore packets
that are malformed or that are not using Ethernet, IP, and TCP.
A large (~350MB) sample pcap file captured from a real network is included in the starter zip as part2.pcap
.
You can examine the packets manually by opening this file in Wireshark. For this input, your program’s output
should be these lines, in any order:
128.3.23.2
128.3.23.5
128.3.23.117
128.3.23.158
128.3.164.248
128.3.164.249
Although the above instructions are for a Python program, you are welcome to use any programming language of your
choice. Simply make a private Piazza post if your group is planning to use a different programming language and
wait for a confirmation from the AIs (we'd like to make sure we're equipped to evaluate and grade your code). In this post, please also specify the library you plan on using. Kindly note that support might be limited for languages other than Python.
The fictional company SketchyCorp has contracted with COS 432 to provide penetration testing services to it. Each project team will conduct a thorough penetration test of the company's networks and exposed systems.
SketchyCorp recently set up a remote office for its employees to work in. SketchyCorp is concerned that its remote office may be more vulnerable than its headquarters since it uses a wireless network to provide access to its remote employees.
Your objective is to test the security of SketchyCorp’s networks and systems. In this engagement you will be authorized to break in to SketchyCorp’s systems and explore any vulnerabilities you find, subject to the Rules of Engagement below. As in a real-world penetration test, you will be expected to use your ingenuity and technical skills to discover clues and techniques for meeting your objectives.
SketchyCorp employees connect to the wireless network using WPA2-PSK security. From there, they can access the SketchyCorp firewall, which allows company employees to log in and gain access to company mainframe.
The investigators believe the infrastructure works as shown in Figure 1.
We have sent investigators to the remote office to attempt to capture WiFi traffic. However, they have been foiled by WPA2-PSK security used by the WiFi network. They have managed to find a capture of the WiFi authentication handshake which can be found aspart3.pcap
in the zip file. They
have also managed to determine the password is in the form of either cos432-XYZ or COS432-XYZ where X,Y,Z are alphanumeric characters [a-z,A-Z,0-9]. Provide them with the WiFi password at http://cos432.org/netsec/
and they will provide you with your next lead.
Concisely answer the following questions. Each question should require at most a few sentences. Type up your
answers in netsec-answers.pdf
.
Things that are in scope:
Here are a few examples of activities that are OUT OF SCOPE for this project:
A note about cheating: There may be backdoors you discover along the way. DO NOT SHARE THEM. If you have questions about whether you may use a particular backdoor, post a private question on Piazza before using it.
netsec-answers.pdf
- Provide answers to the questions in the pdf file. Submit the file to Gradescope and include all the group members in the Gradescope submission. detector.py
- The source code for your Python script (or another language) for SYN
scan detection. Submit to the COS Dropbox .