Lab 1 – Command Line Interface (CLI) Familiarization
Class: CYBR-405
Notes:
Questions:
1. How many total files are in the four Lab1 subfolders?
First we see (using ls):
┌──(kali㉿kali)-[~/Desktop/ProfPriceLabs/Lab1]
└─$ ll
total 300
drwxr-xr-x 2 kali kali 4096 Sep 15 12:04 1
drwxr-xr-x 2 kali kali 4096 Sep 15 12:04 2
drwxr-xr-x 2 kali kali 4096 Sep 15 12:04 3
drwxr-xr-x 2 kali kali 4096 Sep 15 12:04 4
-rw-r--r-- 1 kali kali 287006 Sep 15 12:04 'LAB 1 Instructions.pdf'
- There is an extra 'LAB 1 Instructions.pdf' file that is not inside the 4 subfolders
Navigate to the Lab1/ directory in the Terminal, then use the following command:
find . -type f | wc -l
find .starts the search in the current directory (.) and goes through all subdirectories.-type frestricts the results to only files (not directories).| wc -lpipes the output to the word count utility (wc) with the line count option (-l).
Output:
6
- But since this is counting the 'LAB 1 Instructions.pdf' file, we need to subtract one from this number to report the real number fo files within the 4 subfolders
Answer: 5
2. Which folder has the chicken picture?
After looking through the files we find:
┌──(kali㉿kali)-[~/Desktop/ProfPriceLabs/Lab1/3]
└─$ feh d
- It opens an image window of a chicken image!
Answer: 3
3. Which file has an MD5 hash that ends in 454b?
After trying the md5sum command on many files
┌──(kali㉿kali)-[~/Desktop/ProfPriceLabs/Lab1/2]
└─$ md5sum c
fc148faff73af5acf4bcaf072754454b c
Answer: c
4. How many total cats are shown in the pictures?
a
/CYBR-405/Labs/Visual%20Aids/Pasted%20image%2020260218213352.png)
b

Answer: 3
5. Which file has an MD5 hash that ends in 6759?
After trying the md5sum command on many files
┌──(kali㉿kali)-[~/Desktop/ProfPriceLabs/Lab1/3]
└─$ md5sum d
c1128963259b0a41459a0d94b3c06759 d
Answer: d
6. Did the hash value change after the move?
Make a directory (mkdir) named “new” in Lab1. Next, navigate to 3, hash d, and save the hash value in a log (> log). Move d to the new directory you created in Lab1 using this command (mv d ~/Desktop/Lab1/new). Next, hash d in its new location and compare with its hash from 3. Did the hash value change after the move?
Check the log file we created
┌──(kali㉿kali)-[~/Desktop/ProfPriceLabs/Lab1/3]
└─$ cat log
c1128963259b0a41459a0d94b3c06759 d
Check the hash of the d file in the new location:
┌──(kali㉿kali)-[~/Desktop/ProfPriceLabs/Lab1/new]
└─$ md5sum d
c1128963259b0a41459a0d94b3c06759 d
Moving a file (using mv) only changes its location in the file system structure, not the data within the file itself. Therefore, the cryptographic hash value (such as MD5 or SHA-256) remains the same.
Answer: False (No)
7. What body part does “c” reference in the punch line?
Cat it!
┌──(kali㉿kali)-[~/Desktop/ProfPriceLabs/Lab1/2]
└─$ cat c
what has 5 toes but is not your foot?
my foot!
Answer: foot
8. Does the hash value change?
Hash c and record (> log) the value. Type “nano c” to open a text editor to make changes. Once the document opens, the cursor (square white box) should automatically be on the first letter of the sentence. Hit the delete key to delete the first letter and hit “Ctrl” and “X” to exit. Press “Y” and “Enter” to save the changes and return to the terminal window. Rehash C and compare the hash value with the original hash value. Does the hash value change?
┌──(kali㉿kali)-[~/Desktop/ProfPriceLabs/Lab1/2]
└─$ cat log
fc148faff73af5acf4bcaf072754454b c
┌──(kali㉿kali)-[~/Desktop/ProfPriceLabs/Lab1/2]
└─$ md5sum c
45e4f19d12c122191d0087a6c9cc28c2 c
- Yes the hash changed since the contents of the file itself changed!
Answer: True
9. Which file has an MD5 hash that ends in 9815?
After trying the md5sum command on many files
┌──(kali㉿kali)-[~/Desktop/ProfPriceLabs/Lab1/1]
└─$ md5sum a
505a6d4420ac6231ec315e3b41d49815 a
Answer: a
8. What do computers eat for a snack?
┌──(kali㉿kali)-[~/Desktop/ProfPriceLabs/Lab1/4]
└─$ cat e
What do computers eat for a snack? Microchips
Answer: Microships
Tips:
If you want history not to show your commands, or you just want to type a command that does not appear in the history (like a hidden/private command) you just start with an space like:
┌──(kali㉿kali)-[~/Desktop/ProfPriceLabs/Lab1/2]
└─$ ls
Output:
...
76 cd 2/
77 ll
78 md5sum c
79 history