Brooklyn Nine Nine - TryHackMe Walkthrough

2 min read

A step-by-step walkthrough of the TryHackMe Brooklyn Nine Nine room - covering FTP enumeration, SSH brute-forcing with Hydra, and privilege escalation via less.

TryHackMeCTFWrite-Up
Brooklyn Nine Nine - TryHackMe Walkthrough

Try it out: TryHackMe - Brooklyn Nine Nine

[Task 1] Deploy and Get Hacking

Let's go ahead and deploy the machine as usual.

Task 1

First, let's run an nmap scan:

nmap -sS -sV -sC -Pn <YOUR_MACHINE_IP>

nmap

After performing the nmap scan, I found 3 open ports:

  • 21 FTP
  • 22 SSH
  • 80 HTTP

Getting the User Flag

Logged in with FTP anonymous login.

ftp

Linux CLI FTP defaults to using active-mode FTP.

ftpactivemode

Try switching to passive mode with the pass command.

ftpdir

I found a text file called note_to_jake.txt and copied it to my system using the get command.

ftpget

I read the text file using cat and saw three usernames: Amy, Jake & Holt - which might be useful ahead.

Since it was Jake's account and I didn't know the password required for SSH login, and as Amy mentioned, Jake's password was indeed weak - so I used Hydra to brute-force the password.

hydra -l jake -P /usr/share/wordlists/rockyou.txt ssh://machine_ip

hydra

Got the password. So we can login with that.

ssh jake@machine_ip

Password is 987654321.

I checked the home directory for the user.txt file and found three directories named after the users above. I checked Holt's directory first, found user.txt, and got the user flag.

userflag

Privilege Escalation - Getting the Root Flag

Check our privileges by running:

sudo -l

sudo-l

Seems like we are allowed to run less with sudo rights. For checking exploits I used GTFOBins and searched for less.

I found the following exploit for /usr/bin/less:

https://gtfobins.github.io/gtfobins/less/#sudo

sudo

So let's try this:

sudo less /etc/profile
!/bin/sh

root1

Got root access.

rootaccess

Checked the root directory & got the root flag.

rootflag

Hope you all enjoyed going through this walkthrough.

Happy Hacking!

Back to Blog