Brooklyn Nine Nine Walkthrough

Prajwal T
3 min readJul 31, 2021

--

A writeup about TryHackMe room “Brooklyn Nine Nine”

Brooklyn Nine Nine room

Challenge

Task

Scanning Output

$ rustscan -a <Target IP> — ulimit 5000 — -A

rustscan output

Looking at the scanning results, 3 ports are opened on the target machine.
1. 21 (ftp) also note anonymous ftp login is allowed
2. 22 (ssh)
3. 80 (http)

ftp(21) enumeration

anonymous ftp login
note_to_jake.txt

From ftp enumeration, looks nothing much in the file that we downloaded to local machine. Lets try port 80 (http) enumeration

http(80) enumeration

Home page
source code of home page

From the source code of the home page, we get some hints about steganography. So, lets change our focus towards steganography.

First, download the image that is displayed in the home page and we can hunt down the flags.

image

Stegcracker
It is a steganography brute-forcing tool to uncover hidden information in the files/images

stegcracker

Looks like we got credentials of “holt” user. We can try sshing to target machine with the credentials that we got.

user.txt

Successfully logged into to the target machine with credentials that we got in previous step. Once logged into to machine, look for user.txt to get the user flag.

Privilege Escalation

sudo -l

From “sudo -l” command we can see that “holt” can run nano as root user without password. We can use this flaw and escalate to root user. Best place to look is GTFOBins. Search for nano in GTFOBins

GTFOBins

We can either use (a) or (b) to escalate privilege.

privesc
root.txt

Yayy!! We rooted the machine.

Cool Cool Cool

In summary, this was a beginner machine which had anonymous ftp login allowed. On enumerating further, we got to know it was related steganography, therefore moved with that flow and using “stegcracker” we got user’s credentials. On performing vertical privilege escalation by taking advantage of “nano” that was allowed to run sudo without password by the normal user. Hence, got the root access to machine and was able to find root.txt.

Bye!

--

--

Prajwal T
Prajwal T

Written by Prajwal T

Master’s in Information Security @ UCalgary | CCSK | CKA | GCP-PCA,ACE | RHCSA

No responses yet