Beep Writeup
Beep is a linux based htb machine having a very large list of running services. The machine can be a little overwhelming for some as there are many potential attack vectors.

Vulnerability Exploited: FreePBX 2.10.0 / Elastix 2.2.0 - Remote Code Executio (CVE-2012-4869)
System Vulnerable: 10.10.10.7
Vulnerability Explanation: The callme_startcall function in recordings/misc/callme_page.php in FreePBX 2.9, 2.10, and earlier allows remote attackers to execute arbitrary commands via the callmenum parameter in a c action.
Vulnerability Fix: Applying the patch Unofficial Patch is able to eliminate this problem. The bugfix is ready for download at archives.neohapsis.com. A possible mitigation has been published before and not just after the disclosure of the vulnerability.
Privilege Escalation Vulnerability: Misconfiguring permissions can lead to disastrous consequences.
Vulnerability Fix: The developer should have conformed to the principle of least privilege and the concept of separation of privileges.
Severity: Critical
An initial nmap scan revealed the Apache version 2.2.3 running on port 80.
The Elastic initial page

Searching for Elastic public exploits using searchsploit

https://www.exploit-db.com/exploits/18650
Download the exploit script from the following link: https://github.com/infosecjunky/FreePBX-2.10.0---Elastix-2.2.0---Remote-Code-Execution/blob/master/exploit.py, then apply the needed changes as follow:
Launch a nc listener on the local machine and execute the exploit
Receiving a reverse shell as asterisk user
Spawn a shell using python
user.txt
Run sudo -l command to determine what permissions the user asterisk had.
The user asterisk can run nmap command without a password.
Run nmap on interactive mode and escalate to root privilege.
root.txt
Lessons Learned
I presented three ways of rooting the machine. I know of at least two other way (not presented in this writeup) to root the machine including a neat solution by ippsec that involves sending a malicious email to a user of the machine and then executing that email using the LFI vulnerability we exploited in solution #2. I’m sure there are also many other ways that I didn’t think of.
Last updated