Press enter or click to view image in full size
The Mr. Robot CTF on TryHackMe is a medium-level challenge inspired by the famous TV series. If solved, you’ll also earn a special badge from TryHackMe.
In this walkthrough, we’ll go step by step, starting with reconnaissance, enumeration, exploitation, user access, and finally root escalation.
As with any CTF, the first step is reconnaissance. I started by scanning the target with nmap:
nmap -sCV -vv <target-ip>
Press enter or click to view image in full size
The output revealed that port 80 (HTTP) was open, which means there’s a web service running. That’s always a good place to start investigating. So, let’s move on to web enumeration.
Press enter or click to view image in full size
After confirming that port 80 was open, I browsed to the web application. The landing page looked interesting but didn’t immediately reveal anything useful.
To dig deeper, I used Gobuster for directory brute-forcing:
gobuster dir -u http://<target-ip> -w /usr/share/wordlists/dirb/common.txt
Press enter or click to view image in full size
Press enter or click to view image in full size
The scan revealed several useful directories, including:
/robots.txt
Press enter or click to view image in full size
Visiting:
http://<target-ip>/key-1-of-3.txt
Press enter or click to view image in full size
revealed the first flag ✅.
The /robots.txt
file also pointed to /fsocity.dic
. Accessing it revealed a large wordlist file — highly suspicious and likely intended for login brute-forcing later. Definitely something to keep in mind.
With the first flag secured and a potential wordlist for cracking, it was time to keep enumerating.
Press enter or click to view image in full size
Continuing with web enumeration, another interesting directory found by Gobuster was /license
. Visiting this path revealed an encoded string that stood out as a likely clue.
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
These credentials pointed towards a WordPress user account — likely elliot (the main character of the show).
With the decoded username and password, I accessed the WordPress login panel at:
http://<target-ip>/wp-login.php
After entering the credentials, I successfully logged in as user elliot. This granted access to the WordPress admin dashboard, which is perfect for moving forward with exploitation.
Press enter or click to view image in full size
With access to the WordPress dashboard as user elliot, it was time to leverage that privilege for code execution.
404.php
in the active theme (often TwentyFifteen
) with the reverse shell code.Press enter or click to view image in full size
nc -lvnp <chosen-port>
http://<target-ip>/wp-includes/themes/TwentyFifteen/404.php
which triggered the reverse shell and connected me to the target.
At this stage, I now had a shell on the target machine as the web server user.
Press enter or click to view image in full size
With a shell on the target, the next steps focused on exploring the system and escalating to a real user account.
Press enter or click to view image in full size
cd /home
ls
robot
.Press enter or click to view image in full size
cd robot
key-2-of-3.txt
, but did not have read permission.password.raw-md5
. Displayed its contents with:Press enter or click to view image in full size
Press enter or click to view image in full size
username: robot
password: abcdefghijklmnopqrstuvwxyz
Switched user with:
su robot
This granted access as user robot, and now I could read the second flag in key-2-of-3.txt
!
With access as user robot, the final step was to gain root privileges and capture the last flag.
sudo -l
but found nothing useful.
Press enter or click to view image in full size
Instead, searched for SUID binaries that could be abused:
find / -perm -4000 2>/dev/null
Press enter or click to view image in full size
Press enter or click to view image in full size
nmap --interactive
!sh
Press enter or click to view image in full size
cd /root
cat key-3-of-3.txt
Successfully completing the Mr. Robot CTF box on TryHackMe provides a comprehensive journey through classic CTF techniques and real-world exploitation steps.
This box is excellent for strengthening core penetration testing skills:
It’s also a fun homage to the Mr. Robot series — and earning that unique TryHackMe badge is a satisfying bonus!