TwoMillion
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 theusernameparameter giving RCE aswww-data. A.envfile 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.
| Platform | Hack The Box |
| Operating system | Linux |
| Difficulty | Easy |
| Status | Retired |
| Target IP | 10.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
-sCVagainst 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
Resumen ejecutivo — TwoMillion es un Linux Easy que recrea la antigua web de Hack The Box y su famoso código de invitación. El JavaScript del registro esconde un endpoint que revela las instrucciones (cifradas en ROT13) para generar un código (codificado en Base64); ya registrados, la API de administración no valida privilegios y nos deja auto-asignarnos
is_admin=1, y el endpoint de generación de VPN sufre una inyección de comandos en el parámetrousernameque da RCE comowww-data. Un fichero.envfiltra una contraseña reutilizada para SSH, y el root llega con CVE-2023-0386 (OverlayFS/FUSE), cuya pista aparece en un correo interno del sistema. Recorrido invite code (ROT13/Base64) → registro → API admin (is_admin=1) → command injection → www-data → .env → SSH admin → OverlayFS → root.
| Plataforma | Hack The Box |
| Sistema operativo | Linux |
| Dificultad | Easy |
| Estado | Retired |
| IP objetivo | 10.129.7.225 |
Mapa del ataque
[22,80] nmap → 2million.htb (clon de la web antigua de HTB)
│ JS ofuscado → /invite/how/to/generate (ROT13) → /invite/generate (código b64)
│ registro → enumeración /api/v1 → PUT /admin/settings/update (is_admin=1)
│ POST /admin/vpn/generate → command injection (username)
▼
[RCE] www-data → .env (admin:SuperDuperPass123) reutilizada
▼
[SSH] admin (user.txt)
│ correo interno → pista OverlayFS/FUSE → CVE-2023-0386 (SUID)
▼
[ROOT] root.txt
1. Reconocimiento
Un escaneo rápido de todos los puertos primero, y uno detallado después solo sobre los abiertos: más rápido que lanzar
-sCVsobre las 65535 puertas de golpe.
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
El servidor web redirige a un vhost que no existe todavía en nuestro DNS local:
http://2million.htb
echo '10.129.7.225 2million.htb' | sudo tee -a /etc/hosts
ping -c1 2million.htb
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 accountEsto es contenido de nivel USER ACCESS — se desbloquea gratis, sin pago. El resto del writeup (y todo lo demás de este nivel) se abre en cuanto inicies sesión.
Crear una cuenta gratis