Reconnaissance
First, I added the new host to my known ones:
First I performed a Nmap scan:
I decided to take a look at the webpage:
After inspecting the source code, I didnโt find anything, so I took a look at the login page:
Letโs capture the request to admin:admin
and pass it to Sqlmap ๐ชฒ:
Unfortunately, it didnโt work. So letโs try the same at the forgot_password.php
:
Bingo!
It seems that the account recovery page is vulnerable to time-base blind sql injection:
So I inspected monitorsthree_db
:
Letโs check users
:
It took a freaking year to finish -_-
Now itโs time to crack the passwords. Iโll use Crackstation:
So now weโve got admin:greencacti2001
. We can login inside the application:
After some inspection, I didnโt find an entry point. So I decided to take a step back and perform a subdomain enumeration with Ffuf ๐ณ:
So I added to my known hosts and search it:
I tried the credentials I obtained before:
Iโm in!
Weaponization
I searched for โcacti 1.2.26 cveโ and found CVE-2024-25641-CACTI-RCE-1.2.26, an authenticated RCE.
Exploitation
Weโve got a reverse shell :D
Stabilize it:
Unfortunately, weโve got no read permissions inside marcus directory, so letโs run linpeas:
Weโve got a user to access the local database catiuser:cactiuser
:
Letโs try to crack marcus password hash (it seems to be bcrypt):
We can now login as marcus and get user flag:
Privilege Escalation
Iโll run linpeas again (alternative with ss- tlnp
):
What is behind port 8200? I decided to forward that port traffic to my machine:
I got this error: marcus@monitorsthree.htb: Permission denied (publickey).
, so I generated a public key:
The -N
and -f
are to not generate a ssh session. Now just search for it:
Letโs search for โDuplicati login bypassโ: Medium article
- I downloaded the Duplicati configuration to my machine:
- I downloaded sqlitebrowser
- I opened the configuration:
sqlitebrowser Duplicati-server.sqlite
- I checked the
Option >> Data
:
I converted it from base 64 to hex:
Then I crafted this in the browser console:
And I forwarded it as url encoded password:
As Duplicati is a backup web app run by root, wee can create a backup of our ssh public key and then restore that backup into /root/.ssh
.
Click on Run Now:
Then click on Restore and you can now login as root.
We are root now and got root flag :D
Machine pwned