Machine Information#
- Name: Outbound
- Difficulty: Medium
- OS: Linux (Ubuntu 24.04.2 LTS)
- IP: 10.129.116.41
- Points: 30
Executive Summary#
Outbound is a medium-difficulty Linux machine featuring a vulnerable Roundcube webmail instance (CVE-2025-49113) and a privilege escalation vulnerability through the Below monitoring tool. The attack chain involves exploiting an insecure deserialization vulnerability in Roundcube to gain initial access, then leveraging a symlink race condition in Below’s logging mechanism to achieve root privileges.
Reconnaissance#
Port Scanning#
Initial Nmap scan revealed two open ports:
| |
Results:
| |
Service Enumeration#
Detailed service scan:
| |
Results:
| |
Key Findings:
- HTTP redirects to
mail.outbound.htb - Nginx web server running version 1.24.0
- OpenSSH 9.6p1 (relatively recent)
DNS Configuration#
Added domain to hosts file:
| |
Virtual Host Enumeration#
Discovered subdomains using ffuf:
| |
Notable subdomain found:
mail.outbound.htb(Status: 200) - Roundcube Webmail
Web Application Analysis#
Roundcube Webmail Discovery#
Accessing http://mail.outbound.htb revealed a Roundcube webmail login page.
Technology Stack (via Wappalyzer):
- Webmail: RoundCube 1.6.10
- Programming Language: PHP
- JavaScript Libraries: jQuery 3.5.1, jQuery UI 1.13.2
- UI Framework: Bootstrap 4.5.3
Roundcube Version Identification#
From the About section:
| |
Installed Plugins:
- archive (3.5)
- filesystem_attachments (1.0)
- jqueryui (1.13.2)
- zipdownload (3.4)
Credential Discovery#
From previous enumeration or default credentials, valid credentials were identified:
- Username: tyler
- Password: LhKL1o9Nm3X2
Initial Access - CVE-2025-49113#
Vulnerability Research#
Research revealed CVE-2025-49113 - a critical Remote Code Execution vulnerability in Roundcube Webmail 1.6.10.
Vulnerability Details:
- CVE ID: CVE-2025-49113
- CVSS Score: 9.9 (Critical)
- Type: Insecure Deserialization
- Requirements: Authenticated access
- Affected Versions: Roundcube 1.0.5 - 1.6.10
Exploitation Process#
1. Clone the Exploit#
| |
2. Understand the Exploit#
The exploit leverages PHP object injection through the file upload functionality. Key components:
| |
The exploit:
- Creates a serialized PHP object containing a command payload
- Uploads it as a filename through Roundcube’s attachment feature
- Triggers deserialization leading to command execution
3. Set Up Listener#
| |
4. Execute the Exploit#
| |
Output:
| |
5. Shell Received#
| |
Shell Stabilization#
| |
Post-Exploitation Enumeration#
Environment Discovery#
| |
Results:
| |
Key Observation: The system is running inside a Docker container (172.17.0.0/16 network).
Checking for Docker Environment#
| |
User Enumeration#
| |
All home directories are inaccessible to www-data.
Roundcube Configuration Analysis#
| |
Critical Findings:
| |
Database Exploitation#
MySQL Access#
| |
Database Enumeration#
| |
Tables of Interest:
users- User account informationsession- Active session data (contains encrypted passwords)
Extracting User Data#
| |
Results:
| |
Extracting Session Data#
| |
Jacob’s Session Data (Base64 encoded):
| |
Tyler’s Session Data (Base64 encoded):
| |
Decoding Session Data#
Using CyberChef to decode the Base64 session variables revealed serialized PHP session data containing encrypted passwords.
Password Decryption#
Roundcube includes a decryption utility:
| |
Decrypted Credentials:
- jacob: 595mO8DmwGeD
- tyler: LhKL1o9Nm3X2
Lateral Movement - Jacob#
Email Analysis#
Logging into Roundcube as jacob@outbound.htb revealed important emails:
Email 1: From Tyler#
Subject: Important Update
Date: 2025-06-07 17:00
| |
Email 2: From Mel#
Subject: Unexpected Resource Consumption
Date: 2025-06-08 15:09
| |
Key Intel:
- New password for jacob:
gY4Wr3a1evp4 - Below monitoring tool is in use
- Jacob has privileges related to Below
SSH Access#
| |
Success!
| |
User Flag#
| |
Privilege Escalation#
Sudo Privileges#
| |
Output:
| |
Analysis:
- Can run
belowwith any arguments as root - Cannot use
--config,--debug, or-dflags - This suggests a potential privilege escalation vector
Below Tool Analysis#
| |
Output:
| |
Investigating Below’s Log Files#
| |
Output:
| |
Key Observations:
error_jacob.logis owned by jacob with write permissionserror_root.logis owned by root with world-writable permissions (777)- This suggests a potential symlink attack vector
Exploitation Strategy#
The vulnerability lies in the fact that:
error_root.logis world-writable- When
belowruns as root, it writes to this log file - We can replace the log file with a symlink to
/etc/passwd - When root writes to the log, it will actually write to
/etc/passwd
Privilege Escalation Execution#
Step 1: Remove Existing Log File#
| |
Step 2: Create Symlink to /etc/passwd#
| |
Step 3: Verify Symlink#
| |
Step 4: Trigger Below to Write Error#
| |
Output:
| |
Note: The error occurs because below is already running, but this doesn’t matter - the race condition allows us to write to /etc/passwd.
However, this approach has a timing issue. A more reliable method:
Alternative Method: Direct Write to /etc/passwd via Symlink#
The key insight is that when Below writes error messages to error_root.log, and we control that file via symlink, we can’t directly inject our payload through Below’s errors.
Instead, we need to:
- Verify the symlink is writable
- Directly append our malicious user entry
| |
Since /etc/passwd isn’t directly writable, the symlink attack works because:
- Below runs as root
- It opens error_root.log for writing
- Following the symlink, it opens /etc/passwd as root
- We need to trigger an error message that contains our payload
Better Approach: Since the permissions are 777, we can write directly:
| |
Wait - this writes to the symlink which writes to /etc/passwd!
Step 5: Switch to Root User#
| |
Step 6: Verify Root Access#
| |
Success! We have root access!
Root Flag#
| |
Flags Summary#
- User Flag:
5bb1d003e93ea72a0cd955ea30f024e4 - Root Flag:
8fa05b1c8a7ae2ea2912fee51bf34382
Key Vulnerabilities Exploited#
1. CVE-2025-49113 - Roundcube RCE#
Vulnerability Type: Insecure Deserialization
Impact: Remote Code Execution as www-data
CVSS: 9.9 (Critical)
Root Cause: Roundcube’s file upload functionality allowed authenticated users to upload specially crafted filenames containing serialized PHP objects. When these objects were deserialized, they triggered command execution.
Mitigation:
- Update Roundcube to version 1.6.11 or later
- Implement input validation on file uploads
- Disable PHP deserialization of untrusted data
- Apply Web Application Firewall rules
2. Password Storage in Database#
Vulnerability Type: Weak Cryptographic Storage
Impact: Credential disclosure
Root Cause: While passwords were encrypted, the encryption key was stored in plaintext in the configuration file, and Roundcube provided a decryption utility accessible to any user with shell access.
Mitigation:
- Use stronger encryption mechanisms
- Implement proper key management
- Use hardware security modules (HSM) for key storage
- Implement password hashing instead of reversible encryption
3. Below Symlink Race Condition#
Vulnerability Type: Symlink Following / Race Condition
Impact: Arbitrary File Write as Root
Root Cause: The Below monitoring tool created world-writable log files (error_root.log) and did not properly validate file paths before writing. This allowed an attacker to replace the log file with a symlink to a sensitive file (/etc/passwd), causing the root process to write attacker-controlled data to that file.
Mitigation:
- Remove world-writable permissions on log files
- Implement proper file path validation (check for symlinks)
- Use
O_NOFOLLOWflag when opening files - Run logging with least privilege
- Implement proper access controls on log directories
Attack Chain Summary#
| |
Tools Used#
| Tool | Purpose |
|---|---|
| Nmap | Port scanning and service enumeration |
| ffuf | Virtual host discovery |
| CVE-2025-49113 Exploit | Roundcube RCE exploitation |
| Netcat | Reverse shell listener |
| MySQL Client | Database access and enumeration |
| CyberChef | Data decoding and analysis |
| SSH | Remote access |
References#
- CVE-2025-49113 Exploit Repository
- Roundcube Security Advisory
- OWASP - Insecure Deserialization
- CWE-59: Improper Link Resolution Before File Access (‘Link Following’)



