PAVINDAS / Security Research
Loading... reads All Articles

Penetration Test Report: Mr. Robot

A thorough offensive security investigation of the Mr. Robot vulnerable machine. Follow the progressive attack path through network reconnaissance, sensitive disclosure, reverse shell injection, credential cracking, and SUID-based privilege escalation to complete root takeover.

Chapter 01 // Target Intelligence

Investigation Brief & Target Overview

Mr Robot CTF Logo Click to expand
Mr Robot CTF Logo
Figure: Mr Robot CTF Logo

The Mr. Robot vulnerable machine is an acclaimed Linux-based boot-to-root challenge themed after the USA Network television series. Designed to emulate real-world misconfigurations, this assessment evaluates web application security, credential hygiene, and Linux privilege containment.

Target Environment Specification

• Application Name: Mr Robot
• Target IP Address: 192.168.1.41 (Note: Target IP addresses depend on your local virtual network configuration; discovery steps are documented below).
• Challenge Goal: Locate and exfiltrate 3 hidden cryptographic key flags and establish root privilege.

Offensive Security Arsenal

The following toolset and open-source intelligence repositories were leveraged throughout this penetration test:

  • Nmap: Network discovery, service version detection, and vulnerability scripting engine.
  • Dirb: Content scanner and web path brute-forcing utility.
  • Burp Suite Community Edition: HTTP proxy, request inspection, and payload decoding.
  • Netcat: Raw TCP connection handler and reverse shell listener.
  • External Reference Hubs: revshells.com (Reverse Shell Generator), gtfobins.org (Unix Binaries for Privilege Escalation), and crackstation.net (Rainbow Table Hash Cracking).

Interactive Attack Chain Flow

Click any milestone or step through the exploitation kill chain
Privilege: UNAUTHENTICATED
Phase 01
Recon & Discovery
Access: Unauthenticated
Phase 02
Initial Access (RCE)
Access: User 'daemon'
Phase 03
Lateral Movement
Access: User 'robot'
Phase 04
SUID Root Takeover
Access: User 'root'
Step-by-step vector progression
Chapter 02 // Reconnaissance

Host Identification & Target Scoping

In a localized laboratory or black-box assessment, the engagement initiates with Layer 2/Layer 3 host discovery. Identifying active hosts on the subnet allows us to isolate the target virtual machine without generating unnecessary noise across unrelated network services.

Using tools like netdiscover or ARP scanning, the target IP was resolved to 192.168.1.41. With the host online and responding, we transition to in-depth service and port enumeration.

Methodology Insight

Thorough initial reconnaissance dictates the velocity of the entire penetration test. Prematurely launching heavy automated scanners can miss subtle web endpoints or cause denial-of-service in fragile environments.

Chapter 03 // Network Scanning

Port Scanning with Nmap

To identify listening TCP sockets and uncover running service banners, we execute a comprehensive Nmap scan utilizing default NSE scripts and service version detection.

bash — nmap port scan
$nmap -sV -sC 192.168.1.41

The scan reveals port 80 (HTTP) actively responding with an Apache web server, as captured below:

Evidence #01 — Nmap Scan Output Click to expand
Nmap scan terminal output showing open port 80
Figure 1: Port 80 is open, confirming an active HTTP service hosted on the target machine.

Navigating to http://192.168.1.41/ in a browser loads an interactive web terminal interface inspired by the Mr. Robot series:

Evidence #02 — Target Web Interface Click to expand
Browser view of the Mr. Robot web landing page
Figure 2: The web root reveals an interactive terminal simulation interface.
Chapter 04 // Content Discovery

Directory & Endpoint Enumeration

With HTTP confirmed on port 80, web directory brute-forcing is initiated using dirb. The objective is to discover hidden administrative portals, API routes, or exposed static assets.

bash — directory fuzzing
$dirb http://192.168.1.41/ -o dirbResult.txt
$grep "CODE:200" dirbResult.txt

Filtering the output for HTTP 200 (OK) response codes isolates valid, publicly reachable endpoints:

Evidence #03 — Dirb HTTP 200 URLs Click to expand
Filtered dirb output displaying discovered HTTP 200 endpoints
Figure 3: Extraction of all HTTP status 200 URLs, highlighting endpoints like /robots.txt, /license, and WordPress core paths.
Chapter 05 // Objective Exfiltration

Sensitive Information Disclosure & Key 1 of 3

Each discovered endpoint was systematically probed using Burp Suite to analyze HTTP request/response headers and raw payloads.

Evidence #04 — Burp Suite Inspection Click to expand
Burp Suite HTTP request and response inspection
Figure 4: Requesting enumerated paths and analyzing server responses in Burp Suite.

Inspecting /robots.txt exposed two intriguing disallowed entries: fsocity.dic (a wordlist file) and key-1-of-3.txt:

Evidence #05 — Exposed /robots.txt Click to expand
Robots.txt contents showing fsocity.dic and key-1-of-3.txt
Figure 5: /robots.txt discloses the path to access the first key flag and a custom dictionary.

Navigating directly to http://192.168.1.41/key-1-of-3.txt successfully retrieves the first key flag without requiring authentication:

Evidence #06 — Key 1 of 3 Retrieval Click to expand
Exfiltration of Key 1 of 3
Figure 6: Retrieval of the plaintext secret flag for Key 1.
Objective Acquired — Key 1 of 3 STATUS: CAPTURED
073403c8a58a1f80d943455fb30724b9
Chapter 06 // Weaponization & Foothold

Initial Access, Credential Recovery & Reverse Shell

Further examination of /license uncovered an encoded string. Inspecting and decoding it via Burp Decoder (or our interactive decoding sandbox below) reveals a valid administrative credential pair:

Evidence #07 — /license Decoding Click to expand
Burp Decoder decoding Base64 string from /license
Figure 7: Base64 decoding of the string inside /license yields credentials elliot:ER28-0652.
Ready to decode. Click "Decode Payload" above.
Enter an MD5 hash and click "Query Rainbow Table".

We proceed to the WordPress administrative portal at /wp-login.php:

Evidence #08 — WordPress Login Portal Click to expand
WordPress login interface on /wp-login.php
Figure 8: Navigating to the WordPress authentication gateway.

Submitting the recovered credentials (elliot:ER28-0652) successfully authenticates us into the WordPress administrator dashboard:

Evidence #09 — Administrative Access Granted Click to expand
Logged into WordPress dashboard as elliot
Figure 9: Administrative session established within the WordPress backend.

Weaponizing the Theme Editor (Remote Code Execution)

In WordPress installations where file editing is not explicitly restricted via DISALLOW_FILE_EDIT, administrators have write privileges over active theme templates.

Accessing /wp-admin/theme-editor.php?file=404.php&theme=twentyfifteen allowed us to replace the default 404 error template with a PHP reverse shell payload sourced from revshells.com:

Evidence #10 — Injected Theme 404 Template Click to expand
Modifying WordPress 404.php template with PHP reverse shell
Figure 10: Replacing the contents of twentyfifteen/404.php with a pentest reverse shell payload.

Before executing the trigger, we spawn a local Netcat listener to intercept the incoming TCP connection:

Evidence #11 — Netcat Listener Setup Click to expand
Netcat listening on local port
Figure 11: Netcat listener running on attacking machine.

Requesting any non-existent URI on the server causes WordPress to invoke the weaponized 404.php file:

Evidence #12 — Triggering Payload Execution Click to expand
Sending GET request to non-existent route to execute 404 template
Figure 12: Triggering the payload by issuing an HTTP GET to a non-existent route.

The reverse shell catches immediately, granting us interactive command execution under the daemon service account:

Evidence #13 — Shell Foothold Acquired Click to expand
Interactive reverse shell session obtained as daemon
Figure 13: Shell established as user daemon. Initial foothold achieved!
Chapter 07 // Lateral Movement

Local Privilege Escalation & Key 2 of 3

Enumerating local file systems, we navigate to /home/robot:

Evidence #14 — Inspecting /home/robot Click to expand
Listing directory contents of /home/robot
Figure 14: Navigating to /home/robot reveals key-2-of-3.txt and password.raw-md5.

Attempting to read key-2-of-3.txt directly as daemon fails due to strict discretionary access controls:

Evidence #15 — Permission Denied Click to expand
Access denied when attempting to cat key-2-of-3.txt
Figure 15: key-2-of-3.txt is only readable by user robot.

However, the companion file password.raw-md5 had world-readable permissions. Reading it revealed an MD5-hashed credential string:

Evidence #16 — Exposed MD5 Hash Click to expand
Reading password.raw-md5 containing MD5 hash
Figure 16: password.raw-md5 contents: robot:c3fcd3d76192e4007dfb496cca67e13b.

Submitting the MD5 hash c3fcd3d76192e4007dfb496cca67e13b to CrackStation immediately matched a precomputed rainbow table entry:

Evidence #17 — CrackStation Hash Lookup Click to expand
Cracking MD5 hash on CrackStation to reveal alphabet plaintext
Figure 17: Plaintext password recovered: abcdefghijklmnopqrstuvwxyz.

With the credential pair robot:abcdefghijklmnopqrstuvwxyz, we switch user identity to robot:

Evidence #18 — Switching User to Robot Click to expand
Executing su robot and switching context
Figure 18: Successfully transitioning to user robot.

Now authorized, we read key-2-of-3.txt and secure the second objective:

Evidence #19 — Key 2 of 3 Retrieval Click to expand
Reading key-2-of-3.txt
Figure 19: Exfiltrating Key 2 of 3.
Objective Acquired — Key 2 of 3 STATUS: CAPTURED
822c73956184f694993bede3eb39f959
Chapter 08 // Privilege Escalation

SUID Binary Exploitation & Complete Root Takeover

User robot does not possess sudo privileges. To achieve complete host compromise, we search for executables with the SetUID bit configured, allowing non-privileged users to execute binaries with the effective permissions of the file owner (root).

bash — SUID discovery audit
$find / -perm -u=s -type f 2>/dev/null
Evidence #20 — SUID Binaries Enumeration Click to expand
Output of SUID discovery revealing /usr/local/bin/nmap
Figure 20: SUID audit exposes an elevated nmap binary located at /usr/local/bin/nmap.

Consulting gtfobins.org confirms that older versions of Nmap support an interactive execution shell mode (--interactive) which can escape to an interactive root subshell via !sh:

Evidence #21 — GTFOBins Nmap Vector Click to expand
GTFOBins documentation on escaping Nmap interactive mode
Figure 21: Researching the SUID escape technique on GTFOBins.

Executing nmap --interactive and issuing !sh immediately drops us into an unrestricted root shell:

Evidence #22 — Root Shell Spawning Click to expand
Interactive nmap escape yielding root shell
Figure 22: Full administrative privileges obtained. UID=0 (root).

With root authority confirmed, we navigate into /root and open key-3-of-3.txt to complete the CTF objective:

Evidence #23 — Final Key Exfiltration Click to expand
Reading /root/key-3-of-3.txt to capture final flag
Figure 23: Exfiltration of the final flag, Key 3 of 3.
Final Objective Acquired — Key 3 of 3 STATUS: COMPLETE ROOT COMPROMISE
04787ddef27c3dee1ee161b21670b4e4
Chapter 09 // Security Assessment

Formal Findings & Remediation Advisory

The following section compiles the four core vulnerabilities discovered during the assessment, categorized according to the OWASP Top 10 framework with remediation guidelines for system administrators.

1. Sensitive Information Disclosure
OWASP A02:2021 — Cryptographic Failures
High Severity

Sensitive endpoints, dictionary wordlists, and encoded credentials were stored in publicly accessible web directories without access control.

Affected Assets /robots.txt, /license, /fsocity.dic
Impact Allows remote unauthenticated attackers to harvest administrative credentials and sensitive files without brute-force requirements.
Remediation & Mitigation
• Remove sensitive credentials and wordlists from public document roots.
• Implement strict HTTP authentication on configuration assets.
• Ensure robots.txt does not advertise confidential endpoints.
2. Insecure WordPress Configuration
OWASP A05:2021 — Security Misconfiguration
Critical Severity

The built-in WordPress theme and plugin editor was enabled, permitting authenticated administrators to overwrite server-side PHP templates with arbitrary executable code.

Affected Endpoint /wp-admin/theme-editor.php
Impact Direct pathway from administrative login to arbitrary Remote Code Execution (RCE) on the underlying operating system.
Remediation Snippet
Enforce file editor hardening in wp-config.php:
define('DISALLOW_FILE_EDIT', true);
3. Remote Code Execution (Reverse Shell)
OWASP A03:2021 — Injection
Critical Severity

Server executed attacker-supplied reverse shell code via weaponized 404 handler, yielding an interactive command-line session under service user daemon.

Impact Full interactive command execution on the host server and unrestricted file system read access across several user directories.
Remediation & Mitigation
• Disable dangerous PHP process execution functions (exec, passthru, shell_exec, system) in php.ini.
• Deploy a Web Application Firewall (WAF) to intercept outbound reverse TCP sockets.
• Run web services in containerized, unprivileged sandboxes with read-only root filesystems.
4. Privilege Escalation via SUID Binary
OWASP A05:2021 — Security Misconfiguration
Critical Severity

The legacy Nmap binary at /usr/local/bin/nmap possessed the SUID permission bit owned by root, allowing standard users to break out of interactive mode into an unconfined root shell.

Affected Binary /usr/local/bin/nmap
Impact Immediate escalation from unprivileged local user to root, resulting in total server compromise.
Remediation Snippet
Strip the SUID permission from the binary immediately:
# chmod -s /usr/local/bin/nmap
Chapter 10 // Retrospective

Conclusion & Defensive Key Takeaways

The Mr. Robot challenge illustrates how minor operational oversights — such as leaving sensitive documentation in web roots, neglecting WordPress hardening, and granting unnecessary SUID privileges — can be chained together by an adversary to transition from zero network access to absolute root control.

Hands-on penetration testing is the ultimate teacher. If you are following this guide, I highly encourage spinning up the machine locally in VirtualBox or VMware and replicating the steps independently. Experiment with different reverse shell payloads, practice manual hash cracking, and write your own automated scripts.

Author's Note

Thank you for taking the time to read through this technical report! I hope this walkthrough helps demystify the offensive methodology. Keep sharpening your skills, stay curious, and best of luck on your cybersecurity journey!

01. Target Overview • 0%
Investigation Chapters