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

Vault

3 Nov 2018 · 21 min read · root access
Vault - maquina de Hack The Box

Executive summary — Vault doesn't hinge on a single exploit but on a pivoting chain through a segmented network of virtual machines hosted behind the entry box. A blacklist upload filter that forgets .php5 gives the first foothold; credentials left in cleartext on a user's desktop open an SSH hop into an internal VM where an OpenVPN configurator executes whatever .ovpn file gets uploaded to it as root; and the real target — "The Vault" — sits isolated behind a firewall that filters by source port, an access-control mechanism that authenticates nothing and is bypassed by simply spoofing that port. Root's flag is also GPG-encrypted, so the compromise isn't done until the encrypted file, the private key and the passphrase are all gathered — each one sitting on a different host in the chain.

PlatformHack The Box
Operating systemLinux (Ubuntu 16.04 Xenial)
DifficultyMedium
StatusRetired
Target IP10.129.49.29

Attack map

[80/HTTP] "Slowdaddy" decoy portal -> /sparklays/ (hidden path)
   |  changelogo.php: unauthenticated file upload, blacklist filter misses ".php5"
   v
[RCE www-data] .php5 webshell -> /home/dave/Desktop in cleartext
   |  ssh: dave / Dav3therav3123 -- key: GPG passphrase "itscominghome"
   v
[SSH host ubuntu] dave -> internal KVM network 192.168.122.0/24 (virbr0)
   |  DNS VM .4: vpnconfig.php saves and runs an .ovpn file as ROOT
   v
[RCE root DNS VM] OpenVPN "up" directive -> user.txt + Vault creds (dave:dav3gerous567)
   |  firewall .5 only allows src-port 53/4444 into 192.168.5.0/24
   v
[Firewall bypass] ncat -p 53 -> Vault SSH 192.168.5.2:987 (rbash)
   v
[ROOT] base32 exfiltrates root.txt.gpg -> decrypted on ubuntu with dave's GPG key + passphrase -> root.txt

1. Reconnaissance

sudo nmap -Pn -sCV -p- -T4 -oN nmap-allports.txt 10.129.49.29
22/tcp open  ssh   OpenSSH 7.2p2 Ubuntu 4ubuntu2.4 (Ubuntu Linux; protocol 2.0)
80/tcp open  http  Apache httpd 2.4.18 ((Ubuntu))
|_http-server-header: Apache/2.4.18 (Ubuntu)

Only two ports: SSH and HTTP. The OpenSSH 7.2p2 + Apache 2.4.18 combo places the system on Ubuntu 16.04 (Xenial), long out of support — useful context, but the real surface is in the web content.

curl -s http://10.129.49.29/
<b>Welcome to the Slowdaddy web interface</b>
We specialise in providing financial orginisations with strong web and database
solutions and we promise to keep your customers financial data safe.
We are proud to announce our first client: Sparklays
(Sparklays.com still under construction)

Identification note: this 299-byte placeholder cover page is identical to another HTB box's (Bank), and enumerating against that wrong "map" — hunting for /balance-transfer/, /login.php, a BIND service on port 53 — leads to wrongly concluding the machine is broken. The real signal on Vault is the name "Sparklays" quoted right in the page text: that's where the hidden path lives. Against an ambiguous fingerprint, confirm the exact machine name and enumerate directories before assuming a platform failure.

for p in /sparklays/ /sparklays/login.php /sparklays/admin.php \
         /sparklays/design/ /sparklays/design/design.html \
         /sparklays/design/changelogo.php /sparklays/design/uploads/; do
  printf "%-40s " "$p"
  curl -s -m 8 -o /dev/null -w "code=%{http_code} size=%{size_download}\n" "http://10.129.49.29$p"
done
/sparklays/                          code=403 size=297
/sparklays/login.php                 code=200 size=16    -> "access denied"
/sparklays/admin.php                 code=200 size=615   -> login form (rabbit hole)
/sparklays/design/                   code=403 size=304
/sparklays/design/design.html         code=200 size=72
/sparklays/design/changelogo.php      code=200 size=484   -> UPLOAD FORM  <--
/sparklays/design/uploads/            code=403 size=312

design.html links straight to the vulnerable functionality (<a href="changelogo.php">Change Logo</a>), a file-upload form with no authentication in front of it whatsoever. admin.php (a login form) and login.php ("access denied") are deliberate decoys: the real vector is the upload at changelogo.php.

🔒 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.