TryHackMe — Ninja Skills writeup :

Naman Thakur
3 min readJul 13, 2020

Hello guys , this is my first writeup and I’m going to show how to solve the Ninja Skills room on TryHackMe.

This room main focus on the use of find command so it’s better to solve The find command room first. We can execute various other commands with Find command.

syntax — find <file-name> -exec <command> \;

Link:- https://www.tecmint.com/35-practical-examples-of-linux-find-command/

Deploy the room and connect to it by ssh port with given credentials (new-user as the username and password.)

ssh new-user@10.10.216.206
find / -type f \( -name 8V2L -o -name bny0 -o -name c4ZX -o -name D8B3 -o -name FHl1 -o -name oiMO -o -name PFbD -o -name rmfX -o -name SRSq -o -name uqyw -o -name v2Vb -o -name X1Uy \) 2>>/dev/null

Above command will print all the files we searched, (2>>/dev/null ) used to ignore any files that throw up errors when we try to read them) , With -type, you can use d to only find directories, and f to only find files. The -name flag is used to specify a name or pattern.Use this command along with -exec to solve the challenge.

TASK1: Which of the above files are owned by the best-group group

find / -type f \( -name 8V2L -o -name bny0 -o -name c4ZX -o -name D8B3 -o -name FHl1 -o -name oiMO -o -name PFbD -o -name rmfX -o -name SRSq -o -name uqyw -o -name v2Vb -o -name X1Uy \) -exec ls -ilrt {}\; 2>>/dev/null

TASK 2: Which of these files contain an IP address?

-> grep -Eo "([0-9]{1,3}[\.]){3}[0-9]{1,3}" 
(used to print the ip address from the files)
-> grep -Eo "([0-9]{1,3}[\.]){3}[0-9]{1,3}" *
(* used to print the file name and dir)

Link:- https://www.shellhacks.com/regex-find-ip-addresses-file-grep/

TASK 3: Which file has the SHA1 hash of 9d54da7584015647ba052173b84d45e8007eba94?

-exec sha1sum {} \;

TASK 4: Which file contains 230 lines?

-exec wc -l 230 {} \;

Reference: https://www.tecmint.com/wc-command-examples/

Only one file is not available here ,so that file contain 230 lines.

TASK 5: Which file’s owner has an ID of 502?

-exec ls -ln {} \;

TASK 6: Which file is executable by everyone?

You can use ls -ln command (list information about the FILEs) to find out the file / directory owner and group names.
It is written in -rwx-rwx-rwx format where r is read , w is write , x is execute

Leave a comment below if you’ve any queries or you can connect me at Linkedin

--

--