HTB-Beep Write-Up

Lame

Reconnaissance

I used nmap to see what ports/services were showing as up and running.

Nmap_scan

Doing basic recon on what is showing as up from the scan, there appears to be a web server with a database backend and some sort of mailserver. The next thing I did was pull up the website.

Website_pull

We have a website running Elastix with a database backend storing username and passwords for access to this site.

Enumeration

I ran a quick Gobuster scan to see what directories are available on the website that I could glean more information from.

GoBuster_scan

A couple of directories sparked my interest here… the /admin, the /recordings, and the /vtigercrm.

Website_VTiger

Website_admin

Website_Recordings

So it appears to be an online voicemail mailbox system. I decided to look up some exploits for Elastix on searchsploit to see what’s out there.

Searchsploit_search

Exploitation

The most interesting one that caught my eye here was the Elastix 2.20 - ‘graph.php’ Local File Inclusion. I looked up the source code for this so I can get a better understanding of what it does.

Searchsploit_LFI

This part of the exploit stuck out to me because enumerating the directories told me that there was already a /vtigercrm directory. So I decided to paste the code and see what happened.

LFI_Exploit

This was pretty unreadable. So I decided to view the source code to see if it is formatted better. It looks like the exploit worked and provided a wealth of information that I can use to get into the system.

LFI_Exploit

This is a lot more readable.

Post-Exploitation

LFI_Exploit

The exploit revealed the admin password. I decided to try to ssh in to the system using the admin password for root to see if I could root the box immediately.

SSH_root

That worked and I was able to get the root flag.

SSH_root

From there, I went to the home directory to find the users and found the user flag.

SSH_root

Results Analysis

Elastix is prone to a local file-include vulnerability because it fails to properly sanitize user-supplied input. The exploit took advantage of this and supplied information to pull local data. This data contained what was need to root the box.

Written on March 10, 2020