Lab: Working with the Command Line
Part 1, The Basics
Because this is largely a hands-on course, it is essential that you learn many of the fundamental Linux commands, an important skill for any good security practitioner.
If you are using macOS, you can also use the Terminal app. If you are using Windows 10, you can use the Linux subsystem. See instructions at https://docs.microsoft.com/en-us/windows/wsl/install-win10.
Please learn and tinker with the commands below and answer the questions below. Many commands will require flags.
ls, rm, mkdir, rmdir, cd, wget, pwd, ln, sudo, chmod, umask, ping, cut, sort, which, grep, whereis, finger, w, who, whoami, last, file, strings, top, ps, nice, nohup, kill, signal, more, less, ifconfig, arp, nslookup, cat, uname, history, netstat, curl, ifconfig, traceroute, shred, dig, man, lsof, whois, crontab, nc, uniq, id, groups, df, du, dd, openssl, tar, clear, touch
In addition, please read "The command-line, for cybersec" by Rob Graham: https://blog.erratasec.com/2017/01/the-command-line-for-cybersec.html
Answer the questions below. Answers may vary depending on operating system used.
How would you find the path (i.e., location) to the
How would you download a file from the Internet?
What is the full command to read the manual page of the command that formats and displays the on-line manual pages? (NOTE: there is no typo to this question)
What command can you use to find out your IP address and MAC address?
What command can you use to show all the processes that are running on the system?
What command can you use to get more details about running processes listening on ports?
What command with flag could you use to list every file, including hidden files, on the entire system, showing their owner, location, and access time? Please also note the flags that you used with command.
Assume you found a file named
warrent.pdf. What command could you use to find out what type of file this was?
So you discovered that
warrent.pdfis a binary executable. What command could you use to extract any readable information from the file without running it? Also, try this on a compressed file such a ZIP or JAR
What command can you use to find the IP address-to-MAC address mappings for systems on the local network?
Consider the following IP address: 46[dot]252[dot]26[dot]153. Where is the computer with that IP address located --in what country?
For the previous question, what command did you use to determine the location of the computer?
What command can you use to securely delete a file?
What command can you use to see if you are a computer administrator or superuser?
What command can you use to see list of previous commands you have entered on command line?
What command can you use to see list of scheduled tasks running on your computer?
Part 2, Wargames
Let's further hone your basic security skills by playing wargames. This set of wargames is offered by OverTheWire (http://overthewire.org/wargames/).
Play the Bandit wargame at http://overthewire.org/wargames/bandit/, beginning with level 0. Play as many levels as you can. To get credit, show proof that you have played the Bandit wargames by submitting a screenshot of your terminal screen that shows the highest level you have completed (e.g., via Canvas).
This part is dedicated to Olivia MacDougal, Class of 2018
Submitting This Lab
For students officially enrolled in the course, submit lab on Canvas.