The goal of this homework assignment is to allow you to practice shell scripting and explore networking in a Unix environment.

For this assignment, you are to do your work in the homework02 folder of of your assignments GitHub repository and push your work by noon Saturday, February 04.

Activity 0: Pulling Changes

Before starting this homework assignment, you should first perform a git pull to retrieve any changes in your remote GitHub repository:

$ cd path/to/repository                   # Go to assignments repository

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

$ git pull --rebase                       # Get any remote changes not present locally

You will need to do this from time to time since the TAs will be grading your assignments and merging in your previous work. To integrate these changes into your local repository, you will need to do a git pull to retrieve it from the remote GitHub repository.

Note: If you get the following messages when you do a git push:

! [rejected]        master -> master (fetch first)
error: failed to push some refs to ''
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first merge the remote changes (e.g.,
hint: 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.


! [rejected]        master -> master (fetch first)
error: failed to push some refs to '...'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again.  See the 'Note about fast-forwards'
section of 'git push --help' for details

This means you need to perform a git pull and merge in the remote changes before performing a git push as described above.

Don't forget to create a new branch for this assignment:

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

$ cd homework02                           # Go into homework02 folder

Activity 1: Meet the Oracle (6 Points)

The main activity for this assignment is to follow the prompts of MORPHEUS, who takes the form of a program located at:

You can use either curl or wget to download this program to your homework02 folder in your assignments repository and execute it as follows:

# Go to homework02 directory in assignments repository
$ cd path/to/assignments/homework02

# Download Adventure MORPHEUS
$ curl -LO

# Make MORPHEUS executable
$ chmod +x MORPHEUS


Student Machines

For this assignment, you will need to use the CSE student machines. This is because MORPHEUS relies on some timing and networking features specific to the student machines.

MORPHEUS will lead you down the rabbit hole and guide you on your journey to meet with the Oracle:

Of course, access to the Oracle is heavily restricted, so you will need to use your hacking skills to locate her. Once you connect with her, she will hopefully give you a message about how to use your awesome Unix skills.

You are to follow the prompts specified by MORPHEUS until you have completed each of the tasks in the journey. Because some tasks depend on others, there is no skipping ahead or going backwards. That said, you can always remove the checkpoints in the tasks.yaml file to go back to a particular task.

At the end of this activity, you should see the following output from the MORPHEUS:

Checking homework02 tasks ...
 Task 00 Checkout on homework02 branch            ... Completed
 Task 01 IP of current machine                    ... Completed
 Task 02 IP of remote machine                     ... Completed
 Task 03 SSH hopping via jumpbox                  ... Completed
 Task 04 Measuring latency                        ... Completed
 Task 05 Scanning remote ports                    ... Completed
 Task 06 Find the DOORMAN                         ... Completed
 Task 07 Find your LOCKBOX                        ... Completed
 Task 08 Copy remote file                         ... Completed
 Task 09 Crack your LOCKBOX                       ... Completed
 Task 10 Contact the DOORMAN                      ... Completed
 Task 11 Retrieve MESSAGE                         ... Completed
 Task 12 Meet the ORACLE                          ... Completed
 Task 13 Quiz                                     ... Completed
   Score 10.00 / 10.00
  Status Success

Task Checkpoints

Note, that each task checkpoint in the tasks.yaml is specially encoded for your netid. This means that copying the checkpoint from another student or from a previous task will not work and will lead to a corruption warning that will confuse MORPHEUS. The only way to proceed through the activity is to actually do the tasks!

Matrix Utilities

The following information will help you on your journey:

Command Description Example
curl Request remote file using HTTP. curl
find Recursively search file paths. find /etc -name '\*ssl\*'
host Lookup DNS records for domain or IP address. host
ip Display IP address of current machine. ip addr
md5sum Compute checksum of file. md5sum
nc Connect to remote machine for arbitrary communication. nc 80
nmap Scan remote machine for open ports. nmap -v -Pn
ping Measure latency to remote machine. ping
scp Securely copy files with remote host. scp
sftp Securely transfer files with remote host. sftp
ss Display ports and services on current machine. ss -tlp
ssh Securely login to remote host. ssh
strings List all strings in a file. strings /bin/ls
traceroute Display hops to remote machine. traceroute
wget Download a file via HTTP. wget

Activity 2: Oracle Quiz (4 Points)

Once you have completed all the tasks specified by the MORPHEUS in Activity 1, you are to complete the following reflection quiz:

As with Reading 01, you will need to store your answers in a homework02/answers.json file. You can use the form above to generate the contents of this file, or you can write the JSON by hand.

Guru Point (1 Extra Credit Point)

For extra credit, you are to customize your favorite $EDITOR by adding useful programming or development extensions and plugins that will make your Unix programming environment more productive. Here are some sources of inspiration:




If you come across any other tutorials or resources, please share them on Slack.


To get credit for this Guru Point, show your text editor customizations to a TA to verify (or attached a video / screenshot to your Pull Request). You have up until a week after this assignment is due to verify your Guru Point.

Self-Service Extension

Remember that you can always forgo this Guru Point for two extra days to do the homework. That is, if you need an extension, you can simply skip the Guru Point and you will automatically have until Monday to complete the assignment for full credit.

Just leave a note on your Pull Request of your intentions.


To submit your assignment, please commit your work to the homework02 folder of your homework02 branch in your assignments GitHub repository:


$ cd homework02                                       # Go to homework02 directory
$ git add Makefile                                    # Mark changes for commit
$ git add MORPHEUS                                    # Mark changes for commit
$ git add tasks.yaml                                  # Mark changes for commit
$ git commit -m "homework02: Activity 1 completed"    # Record changes
$ git add answers.json                                # Mark changes for commit
$ git commit -m "homework02: Activity 2 completed"    # Record changes
$ git push -u origin homework02                       # Push branch to GitHub

Pull Request

Remember to create a Pull Request and assign the appropriate TA from the Reading 02 TA List.

DO NOT MERGE your own Pull Request. The TAs use open Pull Requests to keep track of which assignments to grade. Closing them yourself will cause a delay in grading and confuse the TAs.