Overview
Mr. Robot is a TryHackMe machine inspired by the TV show. It involves web enumeration, WordPress exploitation, and Linux privilege escalation via SUID binaries. Three flags (keys) are hidden across the system.
Recon
Starting with an Nmap scan to identify open ports and services:
|
|
Results revealed ports 80 (HTTP) and 443 (HTTPS) open, both running Apache. SSH was filtered.
Enumeration
Visiting the web server showed an interactive terminal inspired by the TV show. Running Gobuster to enumerate hidden directories:
|
|
Key findings:
/robots.txt— contained two entries:fsocity.dic(a wordlist) andkey-1-of-3.txt/wp-login.php— confirmed WordPress installation/license— contained a Base64-encoded string
Flag 1: Found at
/key-1-of-3.txt—073403c8a58a1f80d943455fb30724b9
The fsocity.dic file was a massive wordlist with duplicates. After deduplication:
|
|
Reduced from 858,160 to 11,451 entries.
Exploitation
WordPress Username Enumeration
WordPress login gives different error messages for invalid usernames vs invalid passwords. Used Hydra to enumerate the username:
|
|
Found username: elliot
Password Brute Force
|
|
Found password: ER28-0652
Reverse Shell
Logged into WordPress admin and edited the 404.php template of the active theme with a PHP reverse shell. Set up a listener:
|
|
Triggered the shell by visiting a non-existent page. Got a shell as daemon.
Privilege Escalation
Found /home/robot/key-2-of-3.txt — readable only by user robot. Also found password.raw-md5 containing the MD5 hash of robot’s password.
|
|
Cracked password: abcdefghijklmnopqrstuvwxyz
Switched to user robot:
|
|
Flag 2:
822c73956184f694993bede3eb39f959
Root via SUID
Searched for SUID binaries:
|
|
Found /usr/local/bin/nmap with SUID bit set. Nmap versions 2.02-5.21 have an interactive mode:
|
|
Flag 3:
04787ddef27c3dee1ee161b21670b4e4
Flags
All three keys captured:
073403c8a58a1f80d943455fb30724b9822c73956184f694993bede3eb39f95904787ddef27c3dee1ee161b21670b4e4