Unroot
Last updated
Was this helpful?
Last updated
Was this helpful?
A webserver is open on port 80
Upon checking in the browser, looks like it is hosting PhpMyAdmin.
I tried to log in using the most common username and passwords for phpMyAdmin, but nothing works so I moved forward to directory busting instead.
After a few seconds of running, it has found /dev
directory.
There's an interesting file, called ping-test.php
.
After some experimentation, I figured the input parameter is vulnerable to Remote Code Execution. You can execute any bash command right after a semicolon (i.e. ;
)
First, craft a reverse shell payload with python
Set a netcat listener
Paste your payload in the input, and right after clicking run
. You should have received your initial shell.
Sweet, now we have able to pwn joe
user.
Running sudo --version
you can see that it is running on version 1.8.16, which is vulnerable to CVE2019-14287
.
To gain root, just execute sudo -u#-1 bash
Thanks for reading, and enjoy your day! :D