Lazy Admin THM
IP
10.10.109.129Nmap inital scan
sudo nmap -sV -sC -A -oA nmap_inital 10.10.109.129
Nmap full scan
Ports
22:SSH
80:HTTP
Most likely Apache2's default page
Port 80 Apache 2.4.18
When we navigate to http://10.10.109.129:80 we are greeted with the following.

This of itself is an information disclosure, we now know for sure we are dealing with a Ubuntu host.
Let's perform some directory busting and see if we can find anything interesting
Within our results, we find a
when we download the MySQL backup file we can find a password hash.

we can take this hash to https://crackstation.net/, we now have a password

Lets see if we can SSH into the target
It didntDidnt work
Back to our ferox results we do find a

seems like a website management system, it does mention a dashboard
back in our directory results we also find
we can use our creds we found earlier
we are bought to sweet rice's dashboard.

we do have the sweet rice version 1.5.1
having a quick google we can find this version is vulnerable to Arbitrary File Upload we can refer to the following
https://www.exploit-db.com/exploits/40716
if we look at wappalyzer we can tell sweet rice uses PHP, meaning we can upload a PHP reverse shell and hopefully get shell on the system

For this, we can use pentest monkey's php reverse shell
we can use wget and download the file
then we need to modify the script slightly

Let's start a Netcat listener
we also need to change the php extention from .php to .php5 for the exploit to take effect
Now lets upload the file
within the Post -> create

we want to add a file

Now we can upload the file

when we navigate to
we will see our rev.php5 file sitting in the dictionary

when we click on the file, we should receive a call back from the target and establish a reverse shell.

Privilege Escalation via www-data
Lets stabilize our shell
first thing let's check our privileges

We can run Perl as sudo with no password on a specific file
backup.pl let's read the script and get a better idea of what it does

it looks like the script is using sh to execute another script

as you can see we have the write permission set meaning we can alter the file.
well simply edit the file and tell it to run bash
now when we run
we have a root shell

Last updated