Lab: a network tools scavenger hunt

Nothing to hand in

Goals

Your job

For each of the following, find 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 in your 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). My video A brief introduction to HTTP might help.

Go ahead and use whatever internet resources you find. Keep notes, including links to your sources. In fact, I recommend building your own personal quick-reference guide as you go. (I have a constantly evolving file named howto.txt that serves this purpose for me.)

The questions

  1. What's your computer's IP address for its current Internet connection? (0-point 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 Kali virtual machine and you want to put it someplace where you can save it, like your your 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 https://google.com/ or https://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. How can you view the HTTP headers that your computer sends to the web server when you do the tasks in the previous two questions?

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

Have fun!