Sharpen your ninja skills on linux Initial Access
SSH Credentials
Copy username: new-user
password: new-user
Preparation
First get the list of files that are available to us
Copy cd files && touch thm-files.txt
## copy and paste the file names into something like, thm-files.txt
The list should look something like this
Copy 8V2L
bny0
c4ZX
D8B3
FHl1
oiMO
PFbD
rmfX
SRSq
uqyw
v2Vb
X1Uy
Next get the paths of the files which we can later use for reference purpose
Copy cat thm-files.txt | while IFS = read line ; do find / -name "$line" -type f 2> /dev/null ; done | tee files.txt
Tasks
Question 1 : Which of the above files are owned by the best-group group(enter the answer separated by spaces in alphabetical order)
Copy cat files.txt | while IFS = read line ; do ls -laSh $line; done | grep "best-group"
Question 2 : Which of these files contain an IP address?
Copy # Get the IP address along with the file name
cat files.txt| while IFS= read -r line; do grep -E -o '([0-9]{1,3}\.){3}[0-9]{1,3}' "$line" 2>/dev/null && echo "$line"; done
Question 3 : Which file has the SHA1 hash of 9d54da7584015647ba052173b84d45e8007eba94 ?
Copy cat files.txt | while IFS = read -r line ; do sha1sum $line; done | grep "9d54da7584015647ba052173b84d45e8007eba94"
Question 4 : Which file contains 230 lines?
Copy cat files.txt | awk -F/ '{print $NF}' | sort -u > a.txt
cat thm-files.txt | sort -u > b.txt
diff a.txt b.txt
## the one file that is missing is marked with >
Question 5 : Which file's owner has an ID of 502?
Copy cat files.txt | while IFS = read -r line ; do ls -ln $line; done
# check the 3rd column which has all the IDs
# -rw-rw-r-- 1 502 501 14K Oct 23 2019
Question 6: Which file is executable by everyone?
Copy cat files.txt | while IFS = read -r line ; do ls -ln $line; done
### Look for -rwxrwxr-x