Brooklyn 99 is a great machine to get started. It combines pretty realistic components with CTF challenges. Especially recommend this machine to B-99 fans!
NOTE: All passwords listed there are fake. Run listed commands to find real ones
Hello, unsolved case, let’s start.
Enumeration
Starting with nmap to determine what ports are open and what services are running.
I usually run with these options:
T4 {T<0-5>: Set timing template (higher is faster)}
p - {-p : Only scan specified ports, but in this case -p- will scan all ports (1-65535)}
A - Enable OS detection, version detection, script scanning, and traceroute
Full command and result of scanning:
After reviewing results of nmap scan we can create a plan for future actions:
ftp on port 21
http page on port 80
ssh on port 22
FTP
Nmap scan showed us that Anonymous FTP login allowed, so let’s use it.
We logged in ftp, found a file called note_to_jake.txt, downloaded it, and then read.
So Jake had a weak password, and something tells me he hasn’t changed it yet. Let’s make use of it.
“Sarge, with all due respect, I am gonna completely ignore everything you just said.” — Jake Peralta
Bruteforcing SSH
We can bruteforce a ssh account credentials using hydra. Syntax for this tool:
t - run TASKS number of connects in parallel, for SSH 4 is suggested
l - login, use only one username or a list
P - password wordlist
And, we got Jake’s password.
“Cool, cool, cool, cool, cool. No doubt, no doubt, no doubt.” — Jake Peralta
But let’s not jump into gaining shell yet.
We still have HTTP page unchecked.
HTTP
After accessing this page in browser we saw this:
Seems like nothing interesting here, but let’s check source code:
Hmmm, Steganography, exciting.
Steganography
Firstly I tried steghide on downloaded picture, but it was protected with password.
Then I looked up steganography brute-force tools and found StegCracker
And secret hidden in the picture was revealed to us.
“Oh, I’ve caused a problem. I think I am getting a text message. Bloop. Ah, there it is.” - Captain Holt
So we have Holt’s password too.
Gaining Shell and User flag
Since we have two variants of accessing this machine, let’s try both. Starting with Jake, cause we found his password first.
Jake
Access machine via ssh with Jake’s credentials.
Now let’s find user’s flag. Jake’s home directory was empty. In home directory we have 3 folders: Jake, Holt, Amy. User.txt was in Holt’s home directory.
Holt
We also could log in as Holt via ssh with his credentials and read user.txt
Privilege escalation and Root flag
Here we also have two ways for Privilege escalation