MonitorsThree

Recon

nmap_scan.log|h-50%_styled
└─$ grep moni /etc/hosts
10.129.48.221	monitorsthree.htb	cacti.monitorsthree.htb

HTTP (80)

Enumeration

Writeup.png

Nothing on main page, seems like a placeholder. Enumerate subdomains:

Feroxbuster found /admin on main domain, but nothing further.

Deeper inspection on /admin route:

There was no way Cacti was going to let us in without credentials, considering it has 2024 CVE with PoC which was just released, so I continued enumerating the base domain.

Writeup-1.png

SQLi

SQL error on /forgot_password

Writeup-2.png

Brute manually because slowmap can't find anything except time based garbage, but blind exists just like him.

Note: First 2 queries wasn't even required, I just messed up on my success message 👍😭

Writeup-3.png

Creds: admin:greencacti2001

CVE-2024-25641

Metasploit module: https://www.rapid7.com/db/modules/exploit/multi/http/cacti_package_import_rce/arrow-up-right

www-data

Admin database dump

SSH signing via password is disabled, only keys. Password with su didn't work.

Cacti database dump

Linpeas found cacti mysql config:

Crack password

Crack marcus hash as he's the only user:

Privilege Escalation (marcus)

User.txt

Privilege Escalation (root)

Duplicati

Something is running with Docker

Inspect the config files:

Auth Bypass

Interesting find in Duplicati server database:

Writeup-4.png

Tunnel the port

Find interesting post about Duplicati: Bypassing Login Authentication With Server-passphrasearrow-up-right

Writeup-6.png

Steps:

  1. Intercept on

  2. Send any input

  3. Catch response to FIRST request

  4. Do Javascript stuff

  1. Send halted request

  2. Replace password with noncedpwd

  3. Pwned!

Backups

Writeup-5.png

We can include a script to run before any actions. I added globally because we really don't care about single project.

The script has to be added in cacti directory by www-data! marcus doesn't have any write permissions, gotta go down permissions chain and then back up.

Writeup-7.png

The important step is to prefix the output path for file exfiltration with /source because that's the mount point on host. /tmp/rootbash is container, /source/tmp/rootbash is the host.

Root.txt

Last updated