🔒 cPanel CVE-2026-41940 — 完整安全工具包

适用于受 CVE-2026-41940 / nuclear.x86 影响的 cPanel 服务器的完整安全工具包。
包含两个脚本 — 一个执行全面审计,另一个通过 Imunify360 实现自动清理。
支持正版授权及绕过/共享授权 — 两种服务器上均可运行。
👨💻 作者
⚠️ 漏洞概述
如何判断您的服务器是否已被感染:
wget google.com
# 显示 "Killed" → nuclear.x86 仍在运行
# 正常下载完成 → 没有恶意软件,或已被清除
📦 本工具包包含内容
| 脚本 | 功能 | 使用时机 |
|---|
cpanel_security_check.sh | 服务器全面审计、终止恶意软件、SSH 密钥轮换 | 请先运行此脚本 |
imunify360_scan_clean.sh | 使用 Imunify360 扫描所有账户并清理网页木马 | 随后运行此脚本 |
⚡ 快速开始 — 同时运行两个脚本
cd /root && \
wget -O cpanel_security_check.sh \
https://raw.githubusercontent.com/mahfuzreham/cpanel-cve-2026-41940/main/cpanel_security_check.sh && \
wget -O imunify360_scan_clean.sh \
https://raw.githubusercontent.com/mahfuzreham/cpanel-cve-2026-41940/main/imunify360_scan_clean.sh && \
bash cpanel_security_check.sh && \
bash imunify360_scan_clean.sh
⚠️ 必须以 root 身份运行
🔍 脚本 1 — cpanel_security_check.sh
运行方式:
bash <(curl -s https://raw.githubusercontent.com/mahfuzreham/cpanel-cve-2026-41940/main/cpanel_security_check.sh)
检查项:
自动清理功能:
- 终止 nuclear.x86 进程
- SSH 密钥轮换(含备份)
- 更新 cPanel(
/scripts/upcp --force)
🛡️ 脚本 2 — imunify360_scan_clean.sh
运行方式:
bash <(curl -s https://raw.githubusercontent.com/mahfuzreham/cpanel-cve-2026-41940/main/imunify360_scan_clean.sh)
功能说明:
扫描的网页木马文件名特征:
wp-cache-*.php wp-check-*.php wp-sync-*.php
wp-util-*.php admin-init-*.php upgrade-*.php
class-wp-*.php task_*.php .*\.php (hidden)
网页木马代码特征:
eval(base64_decode system($_ passthru($_
assert($_ exec($_ shell_exec($_
📋 环境要求
如未安装 Imunify360,请执行:
wget https://repo.imunify360.cloudlinux.com/defence360/imunify-deploy.sh
bash imunify-deploy.sh --key YOUR_LICENSE_KEY
📁 输出文件
/root/cpanel_security_audit_TIMESTAMP.log ← 脚本 1 日志
/root/imunify360_cleanup_TIMESTAMP.log ← 脚本 2 日志
/root/imunify360_report_TIMESTAMP.txt ← 受感染文件列表
/root/webshell_backup/ ← 已删除文件的备份
🚨 紧急手动命令
终止恶意软件:
pkill -9 -f "nuclear.x86"
ps auxf | grep nuclear
封锁 cPanel 端口(在发布补丁前):
iptables -I INPUT -p tcp --dport 2083 -j DROP
iptables -I INPUT -p tcp --dport 2087 -j DROP
iptables -I INPUT -p tcp --dport 2095 -j DROP
iptables -I INPUT -p tcp --dport 2096 -j DROP
更新 cPanel:
停止 cPanel 服务:
whmapi1 configureservice service=cpsrvd enabled=0 monitored=0 && \
whmapi1 configureservice service=cpdavd enabled=0 monitored=0 && \
/scripts/restartsrv_cpsrvd --stop && \
/scripts/restartsrv_cpdavd --stop
✅ 清理检查清单
☐ 运行 cpanel_security_check.sh
☐ 运行 imunify360_scan_clean.sh
☐ 重置 cPanel 所有账户的密码
☐ 重置所有 FTP / 邮箱 / MySQL 密码
☐ 更新 wp-config.php / .env 文件
☐ Email 转发器中没有未知转发吧?
☐ 定时任务中没有未知任务吧?
☐ FTP 账户中没有未知账户吧?
☐ 从 GitHub / GitLab 撤销旧 SSH 密钥
☐ WordPress 管理员用户中没有未知用户吧?
☐ 更新所有 WordPress 插件和主题
🖥️ 兼容性
| 操作系统 | 状态 |
|---|
| AlmaLinux 8/9 | ✅ |
| CloudLinux 7/8 | ✅ |
| CentOS 7 | ✅ |
| Rocky Linux 8/9 | ✅ |
| Ubuntu 20/22(cPanel) |
📚 参考
📄 许可证
MIT 许可证 — 可自由使用、分享和修改。
分享时请保留作者署名。
🆘 支持
⚠️ 请将此工具包分享给所有人 — 任何使用 cPanel 服务器的人都可能受到此漏洞的影响。
❤️ 支持本项目
如果这个工具包帮助您加固了服务器或节省了时间,请考虑支持未来的开发与安全研究。
☕ 捐赠 / 支持
🔗 捐赠链接:
https://pay.shurjopayment.com/d21kNExwjP
您的支持将用于:
- 🔐 安全研究与恶意软件分析
- 🛠️ 维护 cPanel 安全脚本
- 🚀 为主机服务商提供免费社区工具
- 📚 发布新的安全公告与修复
每一份贡献都有助于让托管服务器更加安全。感谢您支持本项目 ❤️