Intentions
Executive summary — Intentions is an image gallery built on Laravel (PHP backend) with a single-page Vue frontend, and none of its steps rely on a public CVE: the whole chain is built by stringing together application-specific logic and design flaws. An administration JavaScript bundle leaked without any access control reveals a privileged API v2. A second-order SQL injection in the user's genre-preference flow extracts the administrators' bcrypt hashes — hashes that, thanks to a login endpoint that compares the client-supplied hash instead of the password, turn straight into working credentials without ever needing to be cracked. With an admin session, abusing ImageMagick's pseudo-protocols (
vid:/msl:/caption:) delivers remote code execution aswww-data. The.envfile and the git history leak a developer's real password for the jump to a system user, and the final escalation abuses thecap_dac_read_searchLinux capability on a "copyright scanner" binary, turning it into an MD5 oracle that rebuilds root's private SSH key one byte at a time, never reading it directly.
| Platform | Hack The Box |
| Operating system | Ubuntu 22.04 (Jammy) — nginx 1.18.0 + PHP/Laravel, MySQL, ImageMagick (Imagick) |
| Difficulty | Hard |
| Status | Retired |
| Target IP | 10.129.229.27 |
Attack map
[80/HTTP] Laravel SPA -- admin.js leaked without authorization
| reveals the API v2 (admin) routes
v
[2nd-order SQLi] genres -> feed -- space filter (/**/) and # terminator
| UNION SELECT ... from users -> bcrypt hashes for steve and greg (admin=1)
v
[AUTH] POST /api/v2/auth/login {email,hash} -- compares the SUPPLIED hash
| logs in as steve WITHOUT cracking bcrypt -> admin session
v
[RCE] /api/v2/admin/image/modify -- path=vid:msl:/tmp/php* + MSL file
| Imagick processes the upload as a script -> webshell -> www-data
v
[POST-EXP] .env + git history (HOME=/tmp) -- test commit
| greg's real password leaked -> SSH -> user.txt
v
[ROOT] /opt/scanner/scanner (cap_dac_read_search) -- byte-by-byte MD5 oracle
| /root/.ssh/id_rsa rebuilt without ever reading it -> SSH root -> root.txt
1. Reconnaissance
A ttl≈63 on the ping suggests Linux (initial TTL 64, one router hop). Full high-rate TCP port scan:
sudo nmap -p- --min-rate 3000 -T4 -Pn -oN nmap-allports.txt 10.129.229.27
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
Only two ports. Version and script detection against both:
sudo nmap -p22,80 -sCV -Pn -oN nmap-services.txt 10.129.229.27
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.1 (Ubuntu Linux; protocol 2.0)
80/tcp open http nginx 1.18.0 (Ubuntu)
|_http-title: Intentions
OpenSSH 8.9p1 Ubuntu 3ubuntu0.1identifies Ubuntu 22.04 (Jammy). With only SSH and nginx exposed, the real attack surface is entirely HTTP — SSH will be the destination once credentials are obtained, not the way in.
Resumen ejecutivo — Intentions es una galería de imágenes construida sobre Laravel (backend PHP) con un frontend Vue de página única, y ninguno de sus pasos depende de un CVE público: la cadena entera se construye encadenando fallos lógicos y de diseño propios de la aplicación. Un bundle JavaScript de administración filtrado sin control de acceso revela una API v2 con endpoints privilegiados. Una inyección SQL de segundo orden en el flujo de géneros del usuario extrae los hashes bcrypt de los administradores — hashes que, gracias a un endpoint de login que compara el hash aportado por el cliente en vez de la contraseña, se convierten en credenciales de acceso directo sin necesidad de crackearlos. Con sesión de administrador, un abuso de los pseudo-protocolos de ImageMagick (
vid:/msl:/caption:) da ejecución remota de código comowww-data. El.envy el historial de git filtran la contraseña real de un desarrollador para el salto a usuario, y la escalada final abusa de la Linux capabilitycap_dac_read_searchsobre un binario de "escaneo de copyright" para convertirlo en un oráculo MD5 que reconstruye la clave privada SSH de root byte a byte, sin leerla nunca directamente.
| Plataforma | Hack The Box |
| Sistema operativo | Ubuntu 22.04 (Jammy) — nginx 1.18.0 + PHP/Laravel, MySQL, ImageMagick (Imagick) |
| Dificultad | Hard |
| Estado | Retired |
| IP objetivo | 10.129.229.27 |
Mapa del ataque
[80/HTTP] Laravel SPA -- admin.js filtrado sin autorizacion
| revela rutas de la API v2 (administracion)
v
[SQLi 2o orden] genres -> feed -- filtro de espacios (/**/) y terminador #
| UNION SELECT ... from users -> hashes bcrypt de steve y greg (admin=1)
v
[AUTH] POST /api/v2/auth/login {email,hash} -- compara el HASH aportado
| login como steve SIN crackear bcrypt -> sesion de admin
v
[RCE] /api/v2/admin/image/modify -- path=vid:msl:/tmp/php* + fichero MSL
| Imagick procesa el upload como script -> webshell -> www-data
v
[POST-EXP] .env + historial git (HOME=/tmp) -- commit de tests
| contrasena real de greg filtrada -> SSH -> user.txt
v
[ROOT] /opt/scanner/scanner (cap_dac_read_search) -- oraculo MD5 byte a byte
| /root/.ssh/id_rsa reconstruida sin poder leerla -> SSH root -> root.txt
1. Reconocimiento
Un ttl≈63 en el ping sugiere Linux (TTL inicial 64, un salto de router). Escaneo completo de todos los puertos TCP a alta tasa:
sudo nmap -p- --min-rate 3000 -T4 -Pn -oN nmap-allports.txt 10.129.229.27
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
Sólo dos puertos. Detección de versiones y scripts sobre ambos:
sudo nmap -p22,80 -sCV -Pn -oN nmap-services.txt 10.129.229.27
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.1 (Ubuntu Linux; protocol 2.0)
80/tcp open http nginx 1.18.0 (Ubuntu)
|_http-title: Intentions
OpenSSH 8.9p1 Ubuntu 3ubuntu0.1identifica Ubuntu 22.04 (Jammy). Con sólo SSH y un nginx expuestos, toda la superficie de ataque real está en el HTTP — SSH será el destino tras obtener credenciales, no la entrada.
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.