PermX
Executive summary — PermX chains an unauthenticated file upload in Chamilo LMS (CVE-2023-4220) with a credential reuse between the application's database and a system account, ending in a symlink abuse of a
sudoscript wrappingsetfacl— the script's path validation trusts that-fmeans "it's a file", but that's also true for a symlink pointing outside the allowed directory.
| Platform | Hack The Box |
| Operating system | Linux |
| Difficulty | Easy |
| Status | Retired |
| Target IP | 10.129.39.120 |
Attack map
[80] permx.htb — static "eLEARNING" template, no backend
│ vhost lms.permx.htb -> Chamilo LMS 1.11.24
▼
[80] lms.permx.htb — Chamilo LMS
│ CVE-2023-4220 — unauthenticated file upload (bigUpload.php)
▼
[RCE] www-data
│ configuration.php leaks DB credentials, reused as the SSH
│ password for the system user mtz
▼
[SSH] mtz (user.txt)
│ sudo NOPASSWD /opt/acl.sh -> setfacl follows symlinks,
│ the script only validates the path prefix (not the real type)
▼
[ROOT] symlink to /etc/shadow + setfacl -> overwrite root's hash
1. Reconnaissance
nmap -p- --min-rate 5000 -T4 -oN nmap_all_ports.txt 10.129.39.120
Only two open ports:
nmap -p22,80 -sC -sV -oN nmap_sc.txt 10.129.39.120
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.10 (Ubuntu Linux; protocol 2.0)
80/tcp open http Apache httpd 2.4.52
|_http-title: Did not follow redirect to http://permx.htb
echo "10.129.39.120 permx.htb" | sudo tee -a /etc/hosts
permx.htb turns out to be a static template for an "eLEARNING" company (Bootstrap, no real backend). A page like that makes it worth suspecting a subdomain tied to the business theme. A blind gobuster vhost produced a long list of false positives: the server answers with a generic 302 to permx.htb for any unconfigured vhost, and the tool didn't filter by response size. That output was discarded and manually verified against a random control vhost instead:
curl -s -o /dev/null -w "%{http_code} %{size_download}\n" -H "Host: lms.permx.htb" http://permx.htb/
# 200 19347 (vs 302 292 for a random, non-existent vhost)
echo "10.129.39.120 lms.permx.htb" >> /etc/hosts
curl -s -i http://lms.permx.htb/ | grep -iE "powered-by|generator"
X-Powered-By: Chamilo 1
<meta name="generator" content="Chamilo 1">
Resumen ejecutivo — PermX combina una subida de fichero no autenticada en Chamilo LMS (CVE-2023-4220) con una reutilización de credenciales entre la base de datos de la aplicación y una cuenta del sistema, para acabar en un abuso de symlink sobre un script de
sudoque envuelvesetfacl— la validación de ruta del script confía en que-fcomprueba "es un fichero", pero también es cierto para un enlace simbólico que apunta fuera del directorio permitido.
| Plataforma | Hack The Box |
| Sistema operativo | Linux |
| Dificultad | Easy |
| Estado | Retired |
| IP objetivo | 10.129.39.120 |
Mapa del ataque
[80] permx.htb — plantilla estática "eLEARNING", sin backend
│ vhost lms.permx.htb -> Chamilo LMS 1.11.24
▼
[80] lms.permx.htb — Chamilo LMS
│ CVE-2023-4220 — subida de fichero no autenticada (bigUpload.php)
▼
[RCE] www-data
│ configuration.php filtra credenciales de BD, reutilizadas como
│ contraseña SSH del usuario del sistema mtz
▼
[SSH] mtz (user.txt)
│ sudo NOPASSWD /opt/acl.sh -> setfacl sigue symlinks,
│ el script solo valida el prefijo de ruta (no el tipo real)
▼
[ROOT] symlink a /etc/shadow + setfacl -> sobrescribir hash de root
1. Reconocimiento
nmap -p- --min-rate 5000 -T4 -oN nmap_all_ports.txt 10.129.39.120
Solo dos puertos abiertos:
nmap -p22,80 -sC -sV -oN nmap_sc.txt 10.129.39.120
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.10 (Ubuntu Linux; protocol 2.0)
80/tcp open http Apache httpd 2.4.52
|_http-title: Did not follow redirect to http://permx.htb
echo "10.129.39.120 permx.htb" | sudo tee -a /etc/hosts
permx.htb resulta ser una plantilla estática de una empresa de "eLEARNING" (Bootstrap, sin funcionalidad de backend). Ante una página así, lo lógico es sospechar de un subdominio relacionado con la temática del negocio. Un gobuster vhost a ciegas produjo una lista larga de falsos positivos: el servidor responde con un 302 genérico a permx.htb para cualquier vhost no configurado, y la herramienta no filtró por tamaño de respuesta. Se descartó ese output y se verificó a mano contra un vhost aleatorio de control:
curl -s -o /dev/null -w "%{http_code} %{size_download}\n" -H "Host: lms.permx.htb" http://permx.htb/
# 200 19347 (vs 302 292 para un vhost aleatorio no existente)
echo "10.129.39.120 lms.permx.htb" >> /etc/hosts
curl -s -i http://lms.permx.htb/ | grep -iE "powered-by|generator"
X-Powered-By: Chamilo 1
<meta name="generator" content="Chamilo 1">
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.