This assignment is worth 125 points. Partial credit will be given for all questions — it is in your best interest to not leave any blank. Some of these questions may require you to conduct research beyond what we learned in class. You are free to leverage any public resources you'd like to complete this assignment, but make sure to cite your sources in your answers. Refer to this course's honor code policy for more information on what is appropriate reuse.

For this assignment, record your responses to the following activities in the README.md file in the homework06 folder of your assignments GitLab repository and push your work (including any code you developed) by 11:59 PM Thursday, April 16.

The following programming assignment will guide you through the development and testing of a TCP XMAS Port Scanner in the Linux environment. It will require root privilege for access to Linux's raw sockets interface, as well as an isolated environment for testing. Thus the assignment must be completed on your own machine in an Ubuntu VirtualBox VM.

Activity 0: Branching

As discussed in class, each homework assignment must be completed in its own git branch; this will allow you to separate the work of each assignment and for you to use the merge request workflow.

First, follow these instructions to setup your git environment.

To create a homework06 branch in your local repository, follow the instructions below:

$ cd path/to/cse-40567-sp20-assignments   # Go to assignments repository

$ git checkout master                     # Make sure we are in master branch

$ git pull --rebase                       # Make sure we are up-to-date with GitLab

$ git checkout -b homework06              # Create homework06 branch and check it out

$ cd homework06                           # Go into homework06 folder

Once these commands have been successfully performed, you are now ready to add, commit, and push any work required for this assignment.

Activity 1: Coding a TCP XMAS Port Scanner with libcrafter (125 points)

Task 1: Install libcrafter and its dependencies. libcrafter is a high-level C++ library for raw packet crafting and packet decoding. When developing tools for network security work, such a library is necessary for manipulating all packet header fields, as well as packet payloads. For this assignment, libcrafter will provide a complete networking API that can be used to write the XMAS scanner.


Task 2: Write a command line program in C++ that makes use of the libcrafter API to perform XMAS scans of target hosts. Here are the requirements:

Tip 1: refer to the libcrafter code examples for sample API usage. If you reuse any of these examples or other code from the Internet, make sure to cite the source in the comments of your program.

Tip 2: skip construction of the ethernet header; you will be targetting the localhost in the next task, which should allow your scanner to work with any VM network configuration.


Task 3: Test your scanner against your host OS from the VM instance you've been developing in.


Deliverables. You must turn in the following deliverables to receive full credit for this assignment: your source code from Task 2, the plaintext output of your scan from Task 3.


Feedback

If you have any questions, comments, or concerns regarding the course, please provide your feedback at the end of your README.md.

Submission

Remember to put your name in the README.md file. To submit your assignment, please commit your work to the homework06 folder of your homework06 branch in your assignment's GitLab repository:

$ cd path/to/cse-40567-sp20-assignments   # Go to assignments repository
$ git checkout master                     # Make sure we are in master branch
$ git pull --rebase                       # Make sure we are up-to-date with GitLab
$ git checkout -b homework06              # Create homework06 branch and check it out
$ cd homework06                           # Go to homework06 directory
...
$ $EDITOR README.md                       # Edit appropriate README.md
$ git add README.md                       # Mark changes for commit
$ git commit -m "homework06: complete"    # Record changes
...
$ git push -u origin homework06           # Push branch to GitLab

Procedure for submitting your work: create a merge request by the process that is described here, but make sure to change the target branch from wscheirer/cse-40567-sp20-assignments to your personal fork's master branch so that your code is not visible to other students. Additionally, assign this merge request to our TA (sabraha2) and add wscheirer as an approver (so all class staff can track your submission).