Tabby
Last updated
Last updated
Nmap scan:
We would have to add megahosting.htb
to our /etc/hosts
file to view port 80. Afterwards, we would just see something like this on the page:
When we press the Compare button, we would be brought to /news.php?file=statement
. I tested for LFI, and it worked!
Tomcat was running on port 8080, and we would need to somehow get the manager password to upload a .war reverse shell. Since we have LFI, we can read it at /usr/share/tomcat9/etc/tomcat-users.xml
.
The password is $3cureP4s5w0rd123!
. Then, we can login to the admin dashboard, create a .war reverse shell using msfvenom
, upload it, and execute it via curl
:
When looking aroun the file system, I found this backup file here:
This waws password protected, so let's transfer this back to our machine via nc
and then use john
on it:
The backup file had nothing on it...which was weird. Since we have a password, might as well try su
, and it worked to getting to ash
:
When we check the id
of ash
, we see that they are part of the lxc
group.
This exploitable because we can create a container and mount it with root access to the main machine.
Following the resource above, we can spawn a root shell:
Rooted!