Let's solve an interesting Tryhackme lab named "Brooklyn Nine Nine" , it's theme is based on the TV series Brooklyn Nine Nine. Ps : You don't have to watch the whole series to solve the lab, but it would be a fun to watch.

Let's connect to our VPN and start the machine.

None

Let's copy the IP and use our first tool, Nmap.

nmap -A -p 0-10000 <IP address> -Pn
None

Okay we some interesting results of nmap scan.

We can observe that FTP with user ftp, SSH and HTTP is open. Let's see the easiest one first, HTTP.

We get this image :

None
Such a beautiful image(Fan of B99)

Lets inspect the page using dev tools and see what other things we can see.

None

Okay, this is an interesting message. looks like we can do some steganography.

strings <filename>
None

so looking at the results, there is nothing we can find interesting. maybe it could be a distraction.

Let's move on to FTP. we know that the user here is "ftp". You can use filezilla, but I am going to write the command in CLI.

ftp <IP address>
None

woah! no password, even better. direct ftp, we'll do ls and we see a file inside it. let's download it and see it's contents.

None

we can see some names here; jake, amy and holt.

let's try our luck on ssh now.

ssh user@<IP address>
None

hmm, so we don't know the password. We'll do hydra now.

hydra -l jake -P <wordlist path> ssh://<IP address>
None

boom, we got the password. (how did I sound like Charles Boyle)

let's login again using ssh

None

now we are in jake's machine.

let's roam in a bit to see find user flag.

None

there we have it, User flag. let's enter and move to find root flag.

let's try sudo su to see whether we can get root access.

None

so we have to find some other way. let's do sudo -l, to see what set of commands we can run without root privileges

None

okay we can run less command as less command with root privileges to gain root access. For this we have to go to GTFO bins to find the best method.

None

so we have to use the first command

sudo less /etc/hosts

then we have to write this line at the end

None

yayy, we have got the root shell now. let's cd to root directory and see the root flag.

None

there we go, we found the flag.

Our lab is completed now.

Thanks for reading my article. hope you have enjoyed.