Writeup by wook413

Recon

Nmap

As always, I began by performing three Nmap scans. The first scan covered all 65,535 TCP ports, while the second was a targeted service scan of the discovered open ports. The final scan focused on the top 10 UDP ports.

Initial Access

HTTP 80

The structure of the web page on port 80 was somewhat unusual. It appeared to be missing an index.html file in the web root, as it displayed a directory listing containing only a single directory named grav-admin .

image-20260204224522755

Navigating to /grav-admin revealed the Grav CMS introduction page.

image-20260204224528416

I performed directory bursting using Gobuster and checked /robots.txt to enumerate any meaningful files or directories.

I searched for ‘Grav CMS’ in Searchsploit , which returned several exploits. Since I hadn’t obtained any credentials yet, I opted for an unauthenticated exploit: Arbitrary YAML Write/Update.

Analyzing the code, I found it leads to a reverse shell. Note that /grav-admin must be appended to the target IP address for the exploit to work.

Shell as www-data

image-20260204224541476

Privilege Escalation

After gaining the initial access, I explored the system and discovered a cronjob. This job was executing Grav's scheduler feature via the PHP binary.

While the cronjob didn’t directly lead to privilege escalation, a search for SUID binaries revealed that php7.4 had the SUID bit set.

Shell as root

Leveraging GTFOBins, I executed the following command to exploit the binary and obtain a root shell.