Nocturnal
Executive summary — Nocturnal is an Easy Linux box with a long, very realistic chain, a great example of how a "minor" web bug ends in full compromise. An IDOR in
view.phplets us enumerate users and read other accounts' files with zero authorisation checks; from one ofamanda's.odtdocuments we extract her password and reach the admin panel. There, an incomplete character filter in the backup function —it blocks; & | $and the space, but not the newline (%0a) or the tab (%09)— lets us inject commands and get a shell aswww-data. A local SQLite database exposestobias' MD5 hash; after cracking it we find he reuses the same password on ISPConfig, a panel that only listens on127.0.0.1:8080. With those credentials we exploit CVE-2023-46818 (PHP code injection in the language editor) to get a root shell. Path: IDOR → leaked credentials → command injection → SQLite → password reuse → CVE-2023-46818 → root.
| Platform | Hack The Box |
| Operating system | Linux |
| Difficulty | Easy |
| Status | Retired |
| Target IP | 10.10.11.64 |
Attack map
[80] nocturnal.htb → register + upload a file → view.php?username=&file= pattern
│ IDOR in view.php → enumerate users and read others' files
▼
[amanda] leaked privacy.odt → her password → admin.php panel
▼
[SHELL] backup with an incomplete filter (misses %0a/%09) → command injection → www-data
│ local SQLite → tobias' MD5 hash → cracked → su tobias (user.txt)
▼
[pivot] tobias' password reused → SSH tunnel → ISPConfig on 127.0.0.1:8080
▼
[ROOT] CVE-2023-46818 (ISPConfig code injection) (root.txt)
1. Reconnaissance
Before touching anything we enumerate services, and as soon as we see the site redirects to a domain, we resolve it locally so we see exactly what the server sees.
nmap -p- --min-rate 10000 10.10.11.64
22/tcp open ssh
80/tcp open http
nmap -p22,80 -sCV 10.10.11.64
Relevant results: OpenSSH 8.2p1, nginx 1.18.0, and a redirect to http://nocturnal.htb/. We add the host and check it loads:
echo "10.10.11.64 nocturnal.htb" | sudo tee -a /etc/hosts
curl -I http://nocturnal.htb
The site is a PHP-based file storage/sharing app. A feroxbuster run confirms some interesting paths:
feroxbuster -u http://nocturnal.htb -x php
/admin.php
/dashboard.php
/view.php
/backups/
/uploads* (blocked)
Resumen ejecutivo — Nocturnal es un Linux Easy con una cadena larga y muy realista, ideal para ver como una vulnerabilidad web "menor" termina en compromiso total. Una IDOR en
view.phppermite enumerar usuarios y leer ficheros ajenos sin ninguna comprobacion de autorizacion; de un documento.odtdeamandaextraemos su contraseña y llegamos al panel de administracion. Alli, un filtro de caracteres incompleto en la funcion de backup —bloquea; & | $y el espacio, pero no el salto de linea (%0a) ni el tabulador (%09)— permite inyectar comandos y obtener shell comowww-data. Una base SQLite local expone el hash MD5 detobias; tras crackearlo descubrimos que reutiliza la misma contraseña en ISPConfig, un panel que solo escucha en127.0.0.1:8080. Con esas credenciales explotamos CVE-2023-46818 (inyeccion de codigo PHP en el editor de idiomas) para obtener una shell como root. Recorrido IDOR → fuga de credenciales → command injection → SQLite → reutilizacion de contraseña → CVE-2023-46818 → root.
| Plataforma | Hack The Box |
| Sistema operativo | Linux |
| Dificultad | Easy |
| Estado | Retired |
| IP objetivo | 10.10.11.64 |
Mapa del ataque
[80] nocturnal.htb → registro + subida de fichero → patron view.php?username=&file=
│ IDOR en view.php → enumerar usuarios y leer ficheros ajenos
▼
[amanda] privacy.odt filtrado → su contraseña → panel admin.php
▼
[SHELL] backup con filtro incompleto (no bloquea %0a/%09) → command injection → www-data
│ SQLite local → hash MD5 de tobias → crackeado → su tobias (user.txt)
▼
[pivote] password de tobias reutilizada → tunel SSH → ISPConfig en 127.0.0.1:8080
▼
[ROOT] CVE-2023-46818 (inyeccion de codigo en ISPConfig) (root.txt)
1. Reconocimiento
Antes de tocar nada enumeramos servicios y, en cuanto vemos que la web redirige a un dominio, lo resolvemos localmente: asi vemos exactamente lo que ve el servidor.
nmap -p- --min-rate 10000 10.10.11.64
22/tcp open ssh
80/tcp open http
nmap -p22,80 -sCV 10.10.11.64
Resultado relevante: OpenSSH 8.2p1, nginx 1.18.0 y una redireccion a http://nocturnal.htb/. Añadimos el host y comprobamos:
echo "10.10.11.64 nocturnal.htb" | sudo tee -a /etc/hosts
curl -I http://nocturnal.htb
La web es un almacenamiento/compartición de ficheros en PHP. Un feroxbuster confirma rutas interesantes:
feroxbuster -u http://nocturnal.htb -x php
/admin.php
/dashboard.php
/view.php
/backups/
/uploads* (bloqueado)
This content is Root Access only. Everything else on the site — the free tier, the whole public library — stays open.
See Root Access plansNo account? Create one free then upgrade from your console.
Este contenido es solo para Root Access. Todo lo demás del sitio — el nivel gratuito, toda la biblioteca pública — sigue abierto.
Ver planes de Root Access¿Sin cuenta? Crea una gratis y luego mejora desde tu consola.