Gaming Server CTF
- Running Nmap
-> all ports are filtered -> for more detailed NMAP scan:
-> fuzzing directories through FFUF
ffuf -u http://10.10.165.228/FUZZ -w /usr/share/seclists/Discovery/Web-Content/raft-medium-files-lowercase.txt
-> searching directories through gobuster
gobuster dir -u http://10.10.165.228 -u /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
- looking at the side's page source we find the username john :
- as shown by the gobuster moving to the directory /secret give the ssh private key however login is not successful since it contains passphrase
- trying to bruteforce the ssh private key
- i googled a bit and found this tutorial on how to crack ssh private key
- first i downloaded the ssh2john and converted the private key to hash
gives me the password: letmein
now sshing to the shell
ssh -i priv_key [email protected]
passphrase:letmein
cat user.txt returns a5c2ff8b9c2e3d4fe9d4ff2f1a5a6e7e
running id shows user running lxd which lets escalate our privilege I don't know much about lxd so I took help of google and got this awesome page lxd_privesc and lxd-another-technique
the sequence of commands that i ran with the help of website are:
which gives me rootflag.txt ---> 2e337b8c9f3aff0c2b3e8d4e6a7c88fc