Writeup by wook413

Enumeration

Nmap

As always, I started with a comprehensive TCP scan of all 65,535 ports.

Once the ports were identified, I followed up with a targeted TCP scan.

Lastly, I performed a UDP scan to check for any overlooked common services.

Initial Access

FTP 21

The FTP service on port 21 allows anonymous login. I discovered a directory named /pub where I have write privileges. I confirmed this by uploading a test image. This write access will likely be a crucial pivot point for gaining initial access.

HTTP 80

I initiated my web discovery by running the Nmap http-enum script. I’ve found this often catches leads that standard directory bursting tools miss.

image-20260129091552602

The robots.txt file revealed several interesting directories.

composer.json provided specific version information; while it might be a rabbit hole, I’ve noted it for potential exploit research later.

image-20260129091603361

I identified a login form at /login . By testing the form, I noticed inconsistent error messages. A random username returns “Username not found”, while the username “pablo” (found in the page footer) returns “Your username and password mismatch.” This confirms pablo is a valid user.

image-20260129091610402

image-20260129091618328

image-20260129091629153

image-20260129091640464

Redis 6379

Moving to port 6379, I found the Redis server allows null authentication, granting me access without credentials.

Following a “Load Redis Modue” exploit found on HackTricks, I attempted to compile a module for RCE.

image-20260129091648240

I clone the git repository listed on the page. The compilation initially failed. I resolved this by adding the missing headers: #include <string.h> ,#include <arpa/inet.h> , and #include <unistd.h> .

I uploaded the compiled module.so to the FTP /pub directory, loaded it into the Redis server, and successfully executed commands. From there, I established a reverse shell to my listener.

Shell as pablo

Found local.txt

Privilege Escalation

While searching for priv-esc vectors, I noticed /usr/local/lib/dev is globally writable. This directory is also included in the LD_LIBRARY_PATH environment variable.

image-20260129091657769

A system-wide cron job runs /usr/bin/log-sweeper every minute. When I attempted to execute this binary manually, it failed, citing a missing shared library: utils.so

Since the cron job runs as root and searches for utils.so in the directory listed in LD_LIBRARY_PATH , I can hijack the execution flow. By placing a malicious utils.so in the writable /usr/local/lib/dev directory, the cron job will execute my code with root privileges.

I developed a malicious C library designed to set the SUID bit on /bin/bash .

After adding #include <sys/types.h> to fix compilation errors, I moved the library to the target directory.

Shell as root

After waiting a minute for the cron job to trigger, I verified that /bin/bash now has the SUID bit set. I can not spawn a root shell.

Found proof.txt