CS 231: Computer Security

A network tools scavenger hunt

Folder: tools

File: tools/scavenger-hunt.txt

You may work with other people on this assignment, but write up your own copy of your solutions.

This is a short-answer assignment, so keep it brief—just a list of commands should be sufficient for most of the questions.

For each of the following, provide at least one Unix command that answers the question. Make sure these commands work in either the macOS Terminal, the WSL terminal on Windows, or the terminal on our Kali virtual machine. I'm not interested (today) in answers that involve GUI programs, so restrict your answers to command-line commands.

You'll need to have some familiarity with some beginning concepts related to IP (addresses), TCP (ports), and HTTP (headers). So you should watch my video A brief introduction to HTTP before jumping into those questions.

Go ahead and use whatever internet resources you find. For this assignment, you can cite sources if you wish, but you don't need to. Ultimately, the answers are in the commands' documentation, no matter how you found the command in the first place.

How to hand it in

In your GitHub repository for this course, create a top-level folder named "tools", and in that directory, create a text file named "scavenger-hunt.txt" containing the answers. I really do want this to be a text file (not PDF, not .docx, not .rtf, etc.). When you're ready, git add/commit/push to put your answers into the GitHub copy of your repository.

The questions

  1. What's your computer's IP address for its current Internet connection? (Bonus: how can you tell the difference between your Ethernet IP and your wireless IP if you have both connections active?)
  2. How can you determine the IP address associated with a given host name?
  3. How can you determine the host name(s) associated with a given IP address?
  4. How can you copy a file from one computer to another? Or more to the point, if you create a file on the Kali virtual machine and you want to put it someplace where you can save it, like your your Math/CS account on mantis.mathcs.carleton.edu, how do you go about it from the Kali command-line interface?
  5. How can you tell whether there's a process listening on a given port (e.g. port 80 or port 22) on a given host?
  6. How can you tell which ports have processes listening on them on a given host?
  7. How can you retrieve and save a given web page (say http://google.com/ or http://carleton.edu/) in a file on your system?
  8. How can you view the HTTP headers sent back from a specified web server when you request one of its pages?
  9. [Super bonus question] Is there a command-line-only way to view the HTTP headers that *my* computer sends when I run the commands in the previous two questions?

Some commands that you might find interesting: nc (also known as netcat), nmap, curl, wget. There are other relevant commands, of course, so use your internet-searching powers.