HackTheBox - Monitors
Last updated
Was this helpful?
Last updated
Was this helpful?
This box is one of my favourite one as it contains a lot of CVE related vulnerabilities. CVE means that it is related to Real World vulnerabilities. So let's get started.
Its always good to scan all the ports. I will be adding monitors.htb
to /etc/hosts file.
I will be using wpscan
tool which can help us identify potential vulnerable plugins and probable users.
The tool didn't gave us any vulnerable plugins, so I will manually try to browse the plugin directory. The directory is located at /wp-content/plugins/
We can FUZZ
the url parameter from this wordlist over here or we can try to manually FUZZ it. First thing to look for is Apache log poisoining followed by old school tricks. That didn't gave us anything. So next thing to look for is apache2.conf
file. Also another thing to look for is wp-config.php which might contain potential usernames and passwords.
There's also virtual hosting present. We can add cacti-admin.monitors.htb
into our /etc/hosts file.
We have credentials, maybe we can try default usernames like admin, administrator, guest, etc. I tried admin : BestAdministrator@2020!
and got access to it. (Lucky af)
The version of cacti used is 1.2.12. So let's search for any known vulnerabilities on google.
Read what the misconfiguration is and download the exploit. We need to provide credentials to exploit this vulnerability.
After getting the shell, I got stuck for a very long time. Then I decided to proceed with docker enumeration. (I checked it using ifconfig command)
So to search for other hosts present on docker interface, I grabbed the static nmap
binary from my machine using netcat. (As curl and wget not installed on the system)
Now we can use nmap to scan for ports as well but I like this script which is comparitively fast and easy.
Now I will be forwarding these ports to my local machine using chisel. You can get chisel from here.
So apache ofbiz is running on port 8443, we can check that by going to https://127.0.0.1:8443/catalog
Apache OFBiz is an open source enterprise resource planning system. It provides a suite of enterprise applications that integrate and automate many of the business processes of an enterprise. OFBiz is an Apache Software Foundation top level project.
We can look for known vulnerabilities out there on google. The version we are running is 17.12.01
. Got using ps aux
(which lists the running processes)
This one looks satisfying. To exploit this vulnerability, we need to send malicious serialized data to /webtools/control/xmlrpc
.
Intercept the request in Burp and change the request method to POST. Also change the Content-Type header to application/xml
Now to generate the serialized data, I will be using ysoserial.jar. Download the jar file from here. Use this website to generate reverse shell payloads for Java deserialization.
Copy the payload and paste it in Burp. Make sure you are listening on port you specified.
Now if you will check the capabilities, we have cap_sys_module
.(Check it using capsh --print
)
The CAP_SYS_MODULE capability allows loading modules from anywhere, rather than restricting the module search path to /lib/modules/..
We can exploit this to get root access on host machine. The above article explains it very well.
Now we need to listen on port 4444 before we insert this module.
And now insert the module using insmod command.