HTB Write Up: Monitors

As promised in my LinkedIn post, this is my detailed write up to one of the recently retired Hack The Box Labs Machine: Monitors. Monitors is a hard difficulty Linux Machine that required detailed enumeration and exploiting several web vulnerabilities that allowed us to gain initial foothold. The root, however, will require us to replicate a common CVE exploit manually but there is an option for us to use Metasploit. So in this write up, I will demonstrate both methods to gain root.


We see here that Port 22 and Port 80 is open. Based on the OpenSSH version, we know that we are dealing with Ubuntu Linux Bionic (18.04). With this in mind, let’s explore Port 80 which is running Apache httpd 2.4.29.

Information Gathering

Initially as we access the IP address on our web browser:

We need to add “monitors.htb” into our /etc/hosts and then visiting it again:

After Gobuster, we found wp-includeswhich confirms the fact that we are dealing with a wordpress site. wp-includesfolder contains all the remaining files and folders required for your website to function properly. Browsing the directory listing on wp-includes:

Using wpscan, we see that the upload directory is enabled, this actually led me to a rabbit hole with the upload functionality on the wordpress site but it was just a rabbit hole and we could only use it to get file from remote place but there is no code execution there:

But what is interesting is the plugin present:

Insecure WP Plugins are known to be ways to gain footholds into Wordpress Sites

Checking on this version for vulnerabilities, we found a CVE for wp-with-spritz:

We see that this leads us to a RFI exploit! Trying this Exploit, we will be able conduct Path Traversal and find the /etc/passwd file:

Obtained read to /etc/passwd file

Now that we have RFI, we are able to read files and execute files if we can find an upload functionality to exploit with. Let’s see what files can we read. One of the interesting file in WP is the configurations file which may contain the password we need to login as admin! Once we are admin, it is possible to upload a shell and use RFI to trigger it.

First, we know that the readme.html and the wp-config.php file are on the same web level. From our scan, we know readme.html for this site is on the web root side, and the wp-config.php file, based on information online, is found on the web root folder as well. 3 ../ will get us where we want to go:

README.html that is commonly found on Wordpress root folder

Getting to wp-config.php feels like something got chopped off:

Using Burp Suite, we are able to see the remaining contents of this file and we obtained password of admin: wpadmin:BestAdministrator@2020! However, even after logging in as admin, we cannot really do anything much to help us to get through. So, let’s take a step back and see where else can we read information that maybe useful for us.

Through fuzzing for files related to apache2:

As we go through the configuration files or log files with relations to apache2:

we notice that there is actually another subdomain! Adding cacti-admin.monitors.htb to our host file and visiting it:

Using the username and password we found earlier:

And we are in. Now that we are in, before we starting flipping through, let’s see what this cacti tech is and possible CVEs. We see the version 1.2.12.

Cacti is a complete network graphing solution designed to harness the power of RRDTool’s data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex networks with thousands of devices.

We also found a possible CVE available for this version of cacti software.


We see that it is using some kind of SQL injection to execute command through the update settings ability of the SQL. The payload is set to a path which is then triggered when the vulnerable URL is visited.

Checking our listener:

Checking if we can take user.txt:

We see that we are not successful. This means we need to get in fully as marcus user to secure our foothold as user. Notice there is a .backup folder that is only executable. Using grep, we find marcus since this .backup is an interesting folder which might be a result of some service or program running. After trying several root folders:

Checking out this file that executes the

we have write permissions on this symlink. Furthermore, we know that exists in .backups in marcus home directory. Let’s try reading that file:

Looking at the command, we see that the backup are zipped and transferred with the scp. The config_pass VerticalEdge2020 seems to be the password for the ssh to be successful. We see that because of the use of the scp command which seems to copy the backup of cacti file which is zipped to an internal private IP address.

Knowing this, we can attempt an ssh in with the credentials we just obtained.

And we are in as marcus . We can grab user.txt.

Privilege Escalation to Root

Information Gathering

We transferred and ran it to enumerate more information about the machine:

We see that root seems to be running some processes with relations to Java:

It seems to use Gradle to deploy something in apache. But we know the front end earlier was not Apache Tomcat. This gives hint of something internal.

We look further and confirm that port 8443 is open. We should investigate this.

When we attempt to use netcat to inspect the port:

It says the port requires TLS. This is mostly likely another internal web service running on https. But how can we access it since it is only available internally The correct answer is to forward the port!

Checking our browser:

We see that we are indeed dealing with Apache Tomcat version 9.0.31. Using gobuster:

Going to /content, we are redirected to a login page for a software called OfBiz, in which the name appeared in our enumeration earlier!

Visiting /webtools will redirect us to an interesting page:

Tried to login with several variations of credentials. Instead, let’s try looking at Tomcat and the version and this Apche_ofbizto see if there are any already known vulnerabilities we can exploit with:

There are two ways to do this, one via metasploit, and one without:

Non-Metasploit Exploit

Creating our script:

Attempt to load our script using this exploit:

Generate our serialised object encoded in base64:

Then using the command below:


Checking our python server:

Now let’s try executing the script:


Checking our listener:

And we are root!

Metasploit Exploit

Just simply look for the exploit linux/http/apache_ofbiz_deserialization and use it and put in the appropriate values to create your reverse shell:

Now that we are in as root, we realise root.txt does not exist here! This is because we are in the container that is hosting the vulnerable apache tomcat server. So we need to think of a way to escape docker!

Checking for capabilities, some capabilities will give us the ability to escape Docker:

We see that it is known to be possible to breakout of docker with cap_sys_module, so let’s try it. Creating the C file:

Creating the Makefile:

Transferring it into the container:

Notice we can make on the container here. Then we use make:

Then load the module:

Then on our listener:

We successfully escaped out of the container and is root! We grab the root.txt and we successfully pwned the machine.


This box highlights a lot of enumeration and a lot of “trying harder” moments. If we google the right things, and understand the functionalities that exists on the box, it will help us to effectively gauge which vulnerability is more exploitable. Exploring the non-metasploit route also allowed me to have a better understanding on how to exploit the insecure deserialisation vulnerability on the web application. Hope you enjoy this write up! Do drop me a DM if you have got any questions.




OSCP | CTF Player | Penultimate Information System Student in SMU | Major in Cybersecurity

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to connect Coinbase Wallet to Uniswap?

SoJourn: The Journal that Journalists Trust to Keep Their Secrets Secret

Spotlight on the CyRise Teams: The Scram Story

The Talus Payments Team Reveals 16 Tips to Stay Safe When You Shop Online

4 Vital Cyber Security Checkpoints for Businesses | Cybriant

📢DISCIPLINA LP-reward program review

How to create an atomic drops to mint NFTs on demand

{UPDATE} Absolute RC Buggy Race Off-Road Rally Championship Hack Free Resources Generator

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Louis Low

Louis Low

OSCP | CTF Player | Penultimate Information System Student in SMU | Major in Cybersecurity

Port Knocking

How I Passed CEH with 88.8%

[EN] TryHackMe 25 Days of Cyber Security: Day 9 Walkthrough

Capstone Challenge [TryHackMe] Writeup