Soulmate CTF Writeup - Hack The Box

Soulmate Cover

1. Box Overview

Soulmate from Hack The Box was a challenging box that involved enumerating a web application, exploiting a vulnerability in CrushFTP for initial access, discovering credentials to pivot to a user account, and leveraging an RCE in Erlang OTP SSH for root privileges. It tested skills in web enumeration, vulnerability exploitation, credential hunting, and advanced privilege escalation techniques.

2. Resources Used

Here are the resources that guided me through this challenge:

3. My Approach to Pwning Soulmate

Here’s a step-by-step breakdown of how I tackled the Soulmate box, from initial reconnaissance to capturing both flags.

Starting with Nmap Recon

I started with an Nmap scan using nmap -Pn -n -sS -T4 10.129.24.106 --open, which revealed open ports 22 (SSH) and 80 (HTTP). A more detailed scan with nmap -Pn -sV -sC -p 80,22 10.129.24.106 showed SSH as OpenSSH 8.9p1 and HTTP as nginx 1.18.0, redirecting to http://soulmate.htb/.

Adding Domain to /etc/hosts

I added soulmate.htb to /etc/hosts to resolve the domain.

Soulmate website

Exploring the Website

The website at http://soulmate.htb was an online dating site.

Soulmate website

Web Enumeration with Whatweb

Running whatweb confirmed technologies like Bootstrap, PHPSESSID cookie, nginx 1.18.0.

Subdomain Enumeration with Gobuster

Using gobuster vhost -u http://soulmate.htb -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-20000.txt --append-domain -r, I discovered ftp.soulmate.htb.

Gobuster results

Finding CrushFTP Version

On ftp.soulmate.htb, viewing source code (Ctrl+U) revealed CrushFTP version 11.w.657.

CrushFTP version in source

Researching Vulnerabilities

Searched for CrushFTP 11 vulnerabilities. Tried CVE-2025-54309 without success, but CVE-2025-31161 worked for authentication bypass.

CrushFTP version in source

Running PoC for CVE-2025-31161

Used the PoC from GitHub to create a new account.

CrushFTP PoC execution

Logging in as New User

Logged in with the newly created credentials.

CrushFTP login Editing admin account

Editing Admin Account for Upload Access

Edited the admin account to allow uploads to the web app directory for Soulmate.

Editing admin account

Uploading and Executing PHP Shell

Uploaded a PHP reverse shell to the web app directory and executed it by visiting the file, gaining a www-data shell.

Editing admin account Editing admin account /etc/passwd

User Enumeration

As www-data, ran cat /etc/passwd and found user 'ben'.

/etc/passwd

Searching for Passwords

Grepped "grep --color=auto -rnw "/" -ie "PASSWORD=" --color=always 2> /dev/null for passwords in accessible files and found 'HouseH0ldings998' for ben.

Password search Password search

SSH as Ben and Capturing User Flag

SSH'd as ben:HouseH0ldings998 and captured the user flag.

SSH as ben

Privilege Escalation Enumeration

Enumerated listening ports; port 2222 caught attention. NC banner grab showed Erlang 5.2.9.

SSH as ben

Researching Erlang Vulnerability

Found CVE-2025-32433, a logic issue allowing unauthenticated RCE via post-auth messages not being dropped.

SSH as ben

Confirming Vulnerability with PoC

Used GitHub PoC to confirm; it wrote to /lab.txt meaning it was vulnerable.

Exploiting RCE for Root Shell

Used another PoC to execute a reverse shell, gaining root and capturing the root flag.

Erlang PoC execution Erlang PoC execution Erlang PoC execution

4. Remediation of Vulnerabilities

Here’s how to remediate the key vulnerabilities exploited in this challenge:

5. Lessons Learned and Tips

Here’s what I took away from the Soulmate box:

6. Conclusion

Completed badge

Soulmate was an exciting HTB challenge that combined web exploitation with advanced RCE techniques. From bypassing auth in CrushFTP to exploiting Erlang SSH for root, it was a great learning experience. Ready for the next one!

7. Additional Notes