CS 231: Computer Security

A network tools scavenger hunt

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

Bring your answers, printed out, to class on Friday. This is a short-answer assignment, so you can keep it brief--possibly just a list of commands. But note that there will be a bonus if you come up with more than one

For each of the following, provide at least one Unix command that answers the question. Make sure these commands work in the Mac Terminal program (and specifically, the Macs in Weitz 138, except for the wireless question). I'm not interested in answers that involve GUI programs, so restrict your answers to command-line commands.

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.

  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 (e.g. to your Math/CS account on spectra.mathcs.carleton.edu?
  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, whose answer I don't know] 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 others, of course, so use those internet-searching powers.