Nmap

PORT   STATE SERVICE VERSION
21/tcp open  ftp     vsftpd 3.0.5
| ftp-syst: 
|   STAT: 
| FTP server status:
|      Connected to 192.168.45.158
|      Logged in as ftp
|      TYPE: ASCII
|      No session bandwidth limit
|      Session timeout in seconds is 300
|      Control connection is plain text
|      Data connections will be plain text
|      At session startup, client count was 1
|      vsFTPd 3.0.5 - secure, fast, stable
|_End of status
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
| -rw-rw-r--    1 0        0            5637 Jun 14  2025 log_01.log
| -rw-rw-r--    1 0        0            7181 Jun 15  2025 log_02.log
| -rw-rw-r--    1 0        0            5627 Jun 14  2025 log_03.log
|_-rw-rw-r--    1 0        0            5687 Jun 14  2025 log_04.log
22/tcp open  ssh     OpenSSH 9.6p1 Ubuntu 3ubuntu13.5 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   256 f2:5a:a9:66:65:3e:d0:b8:9d:a5:16:8c:e8:16:37:e2 (ECDSA)
|_  256 9b:2d:1d:f8:13:74:ce:96:82:4e:19:35:f9:7e:1b:68 (ED25519)
80/tcp open  http    Apache httpd 2.4.58 ((Ubuntu))
|_http-server-header: Apache/2.4.58 (Ubuntu)
| http-methods: 
|_  Supported Methods: GET POST OPTIONS HEAD
|_http-title: Villa Agency - Real Estate HTML5 Template

Enumeration

FTP allows anonymous interaction, so we log in and grab the 4 log files.
We gather from the logs that this is a SeaCMS instance.

Looking at the logs, we notice some interesting tidbits
[2025-05-15 00:58:05] [ERROR] POST /th4o4p/database.php?cfg_dbpwd= exposed in request
[2025-06-15 00:28:49] [ERROR] POST /th4o4p/admin_safe.php?id=../etc/passwd

Going to these URLs on port 80 takes us nowhere.

Port 55743 is suspicious, it takes us to a page in a foreign language.
Going to the URLs in the logs works on port 55743.

/th4o4p/database.php?cfg_dbpwd=

Reveals:

$hidden_creds = [ 'ssh_user' => 'nicolas', 'ssh_password' => 'YoureGonnaMakeIt846' ];

We can now ssh into the box as nicolas.

Privilege Escalation

sudo -l shows us that we can run /bin/ps aux as sudo, but GTFOBins has no entry for ps.

Ran linpeas on the box.

Password in a php config file:

This happens to be the root user’s password.

Done.