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 keep it brief—just a list of commands may be sufficient.
For each of the following, provide at least one Unix command that
answers the question. Make sure these commands work in either the Mac Terminal or
in the terminal on our Kali virtual machine or both. 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.
- 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?)
- How can you determine the IP address associated with a given host name?
- How can you determine the host name(s) associated with a given IP address?
- 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 mirage.mathcs.carleton.edu, how do you
go about it from the Kali command-line interface?
- 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?
- How can you tell which ports have processes listening on them on a given host?
- How can you retrieve and save a given web page (say http://google.com/ or http://carleton.edu/)
in a file on your system?
- How can you view the HTTP headers sent back from a specified web server when
you request one of its pages?
- [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.