CatSec.org

Ninja Skills

In this post, we will look into the room “Ninja Skills” from TryHackMe, which can be found on https://tryhackme.com

Task 1: Find the files owned by the ‘best-group’ group

find / -group best-group 2>/dev/null

Task 2: Find the file which contains an IP address

Googled online and found a regex expression to find IP addresses

Execute the following command while being in the same directory with all the files.

grep -E -o “(25[0–5]|2[0–4][0–9]|[01]?[0–9][0–9]?)\.(25[0–5]|2[0–4][0–9]|[01]?[0–9][0–9]?)\.(25[0–5]|2[0–4][0–9]|[01]?[0–9][0–9]?)\.(25[0–5]|2[0–4][0–9]|[01]?[0–9][0–9]?)” *

Task 3: Find the file with the given SHA1 hash

Execute the following command while being in the same directory with all the files.

for file in *; do echo '9d54da7584015647ba052173b84d45e8007eba94 '$file | sha1sum -c; done | grep OK

Task 4: Find the file with 230 lines

Execute the following command while being in the same directory with all the files.

wc -l * | grep 230

But, it did not return a result. By process of elimination, I inferred that the file that I couldn’t find is the file containing 230 lines.

Task 5: Find the file with the owner ID of 502

">cat places.txt | while read l;do ls -n $l; done | grep 502
-rw-rw-r-- 1 501 502 13545 Oct 23 2019 /mnt/D8B3
-rw-rw-r-- 1 501 502 13545 Oct 23 2019 /home/v2Vb
-rw-rw-r-- 1 502 501 13545 Oct 23 2019 /X1Uy

Task 6: Find the file executable by everyone

Execute the following command while being in the same directory with all the files. Then you simply have to read the file permissions for all the files.

ls -la