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

TwoMillion

7 Jun 2023 · 10 min read · user access
TwoMillion - maquina de Hack The Box

Executive summary — TwoMillion is an Easy Linux box recreating the old Hack The Box site and its famous invite code. The registration JavaScript hides an endpoint that leaks the generation instructions (ROT13-encoded) for a code that itself arrives Base64-encoded; once registered, the admin API doesn't validate privileges and lets us self-assign is_admin=1, and the VPN-generation endpoint suffers a command injection in the username parameter giving RCE as www-data. A .env file leaks a password reused for SSH, and root comes via CVE-2023-0386 (OverlayFS/FUSE), hinted at in an internal system mail. An invite code (ROT13/Base64) → registration → admin API (is_admin=1) → command injection → www-data → .env → SSH admin → OverlayFS → root path.

PlatformHack The Box
Operating systemLinux
DifficultyEasy
StatusRetired
Target IP10.129.7.225

Attack map

[22,80] nmap → 2million.htb (clone of the old HTB site)
   │  obfuscated JS → /invite/how/to/generate (ROT13) → /invite/generate (b64 code)
   │  register → enumerate /api/v1 → PUT /admin/settings/update (is_admin=1)
   │  POST /admin/vpn/generate → command injection (username)
   ▼
[RCE]  www-data → .env (admin:SuperDuperPass123) reused
   ▼
[SSH]  admin  (user.txt)
   │  internal mail → OverlayFS/FUSE hint → CVE-2023-0386 (SUID)
   ▼
[ROOT]  root.txt

1. Recon

A fast full-port scan first, then a detailed scan on just the open ports: faster than running -sCV against all 65535 ports at once.

nmap -p- --min-rate 10000 -T4 10.129.7.225 -oN nmap.txt
22/tcp open ssh
80/tcp open http
nmap -sCV -p22,80 10.129.7.225
22/tcp OpenSSH 8.9
80/tcp nginx

The web server redirects to a vhost that doesn't exist yet in our local DNS:

http://2million.htb
echo '10.129.7.225 2million.htb' | sudo tee -a /etc/hosts
ping -c1 2million.htb
🔒 Free account required

This is USER ACCESS content — free to unlock, no payment. The rest of the write-up (and everything else at this level) opens up once you're signed in.

Create a free account