root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat pandora.md
// writeups

Pandora

8 Jan 2022 · 24 min read · root access
Pandora - maquina de Hack The Box

Executive summary — Pandora punishes lazy recon: the public web server on port 80 is an untouched Bootstrap template, a total decoy. The real vector sits on 161/UDP, where SNMP with the default community public leaks, through hrSWRunParameters, the full command line of a running process — credentials included. From there, a reused SSH login leads to an internal vhost bound to localhost running Pandora FMS 7.0NG.742, vulnerable to CVE-2021-32099 (a pre-authenticated SQL injection that forges an admin session). With that session, the panel's file manager uploads a webshell with no extension filter at all, and a SUID backup binary with a relative-path system() call — plus a setreuid() with swapped arguments — closes the chain with root.

PlatformHack The Box
Operating systemLinux (Ubuntu 20.04 LTS "Focal Fossa")
DifficultyEasy
StatusRetired
Target IP10.129.59.207

Attack map

[161/UDP] SNMP community "public" — hrSWRunParameters exposes process argv
   │  cleartext leak: daniel:HotelBabylon23
   ▼
[22] SSH — daniel (uid 1001)
   │  /etc/apache2/sites-enabled/pandora.conf: vhost pandora.panda.htb
   │  bound to localhost:80, PHP runs as matt (AssignUserID)
   ▼
[SSH -L 8000:127.0.0.1:80]  tunnel into the internal vhost
   │  Pandora FMS 7.0NG.742 — CVE-2021-32099
   │  SQLi in chart_generator.php -> session_decode() -> forged admin $_SESSION
   ▼
[RCE]  admin file manager uploads a .php webshell, no extension filter
   │
   ▼
[www]  uid=1000(matt)  ⇒ user.txt
   │  SUID /usr/bin/pandora_backup -> system("tar ...") with no absolute path
   │  PATH hijack + setreuid(0,1000) with swapped arguments -> ruid=0
   ▼
[ROOT]  bash without -p does setuid(getuid())=setuid(0) -> euid=0  ⇒ root.txt

1. Reconnaissance

ping -c 2 -W 3 10.129.59.207
PING 10.129.59.207 (10.129.59.207) 56(84) bytes of data.
64 bytes from 10.129.59.207: icmp_seq=1 ttl=63 time=37.1 ms
64 bytes from 10.129.59.207: icmp_seq=2 ttl=63 time=36.6 ms

A ttl=63 is an initial 64 (Linux/BSD) minus the single VPN hop of HTB: the target is Linux before a single scan runs, which already narrows down wordlists and escalation techniques worth prioritizing.

sudo nmap -p- --min-rate 3000 -T4 -Pn -oN scans/allports.txt 10.129.59.207
Not shown: 65533 closed tcp ports (reset)
PORT   STATE SERVICE
22/tcp open  ssh
80/tcp open  http

closed (reset) on the remaining 65,533 ports means nothing is filtering: the TCP surface is genuinely exhausted with just those two ports. If the vector isn't there, it isn't in TCP at all.

sudo nmap -p22,80 -sCV -oN scans/services.txt 10.129.59.207
22/tcp open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    Apache httpd 2.4.41 ((Ubuntu))
|_http-title: Play | Landing

OpenSSH 8.2p1 + Apache 2.4.41 pins Ubuntu 20.04 LTS. Neither version has a known pre-auth RCE, so the path runs through content, not server software. The page's <head> confirms the suspicion: it's UIdeck's free "Play" template, with not a single dynamic file. A feroxbuster pass with several wordlists (directories, extensions php,html,txt) and a vhost fuzz against *.htb both come back empty — only the template's static assets.

With TCP exhausted, UDP is next — the step a plain nmap never covers, since it needs explicit -sU:

sudo nmap -sU --top-ports 100 -T4 -Pn -oN scans/udp.txt 10.129.59.207
Not shown: 58 closed udp ports (port-unreach), 41 open|filtered udp ports (no-response)
PORT    STATE SERVICE
161/udp open  snmp

161/udp answers unambiguously (unlike the 41 open|filtered ports, reached by elimination): there's an SNMP daemon listening, and that's the real entry vector.

🔒 Clearance required

This content is Root Access only. Everything else on the site — the free tier, the whole public library — stays open.

See Root Access plans

No account? Create one free then upgrade from your console.