Writeup by wook413

Recon

Nmap

As always, I kicked off the machine with scanning all 65,535 TCP ports.

Then I ran one more TCP scan but this time only on the discovered ports with -sC and -sV flags.

Finally, I performed a UDP port scan on the top 10 ports.

Initial Access

HTTP 80 7742 8080

Before going in-depth for enumeration, I like to run http-enum script on the ports running HTTP. As you can see from the output, two directories were found on port 7742.

HTTP 7742

image-20260128231919427

Navigating to /zipfiles in the browser, I see four .zip files are being hosted.

image-20260128231927804

Downloaded all of the files locally.

Using unzip -l , I inspected the contents of max.zip without extracting it and identified a SSH private key, and a backup file, tomcat-users.xml.bak , containing credentials.

image-20260128231938513

Although I had obtained a private key, my SSH login attempts were repeatedly denied, instead returning the scp usage help page.

Investigation of scp_wrapper.sh revealed a restricted shell environment that explicitly forces the use of scp .

To bypass this, I audited the authorized_keys file and removed the command= prefix that was forcing the wrapper script.

All of the prefix is removed.

However, the connection still failed with an error.

I pulled up the man page of scp and found the following option: -O . This option allows you to use the legacy SCP protocol for file transfers instead of the SFTP protocol. Let’s give this a try.

image-20260128231951392

Shell as max

I finally was able to authenticate in.

Found local.txt in /home/dennis

Privilege Escalation

start-stop-daemon has a SUID bit set to its binary, which is very unusual.

GTFObins confirms it could be an attack vector for privesc.

image-20260128232001510

Shell as root

Take a look at the euid , I’m root!

Found proof.txt