THM-Ninja Skills-Writeup
Practise your Linux skills and complete the challenges.
Find This Room: Ninja Skills
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.)
To determine which files are owned by the best-group
group, you need to check the group ownership of each file using the ls -l
command in a Unix-based system:
TASK1: Which of the above files are owned by the best-group group
To find the required files with the owner’s and group information, you can use -xec with LS -l as follows:
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 -l {} + 2>>/dev/null
TASK 2: Which of these files contain an IP address?
To check the files that contain the IP address, we can use the next thing in Linux:
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 grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' {} + 2>>/dev/null
TASK 3: Which file has the SHA1 hash of 9d54da7584015647ba052173b84d45e8007eba94?
To check any file that contains the required Sha1 (9D54DA7584015647Ba052173B84D45E8007BA94), the following command can be used in Linux:
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 sha1sum {} + 2>>/dev/null | grep 9d54da7584015647ba052173b84d45e8007eba94
TASK 4: Which file contains 230 lines?
To check any file that contains 230 lines, the next thing can be used in Linux:
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 wc -l {} + 2>/dev/null
Only one file is not available here ,so that file contain 230 lines.
TASK 5: Which file’s owner has an ID of 502?
The order to search for the file owned by Uid 502:
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 \) -uid 502 2>/dev/null
TASK 6: Which file is executable by everyone?
To check any file from the list, it can be implemented by everyone, you can use the following command:
The order to search for the files that can be implemented by everyone (X for the owner, the group and the others):
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 \) -perm -111 2>/dev/null
Support This Writeup & Follow Me :