mahfuzreham/cpanel-cve-2026-41940

GitHub: mahfuzreham/cpanel-cve-2026-41940

专为 cPanel CVE-2026-41940 漏洞设计的应急响应与清理脚本,用于检测并清除 nuclear.x86 僵尸网络感染及相关 Webshell。

Stars: 1 | Forks: 1

# 🔒 cPanel CVE-2026-41940 — 完整安全工具包 ![Bash](https://img.shields.io/badge/Shell-Bash-green?style=flat-square&logo=gnubash) ![License](https://img.shields.io/badge/License-MIT-blue?style=flat-square) ![CVE](https://img.shields.io/badge/CVE-2026--41940-red?style=flat-square) ![CVSS](https://img.shields.io/badge/CVSS-9.8%20Critical-red?style=flat-square) ![Platform](https://img.shields.io/badge/Platform-cPanel%2FWHM-orange?style=flat-square) ![Imunify360](https://img.shields.io/badge/Supports-Imunify360-purple?style=flat-square) ## 👨‍💻 作者 | | | |---|---| | **姓名** | MD Mahfuz Reham | | **角色** | 系统管理员 \| Web 托管专家 | | **网站** | [MahfuzReham.Com](https://MahfuzReham.Com) | | **WhatsApp** | [+8801790614055](https://wa.me/8801790614055) | | **GitHub** | [github.com/mahfuzreham](https://github.com/mahfuzreham) | ## ⚠️ 漏洞概述 | 详情 | 信息 | |--------|------| | CVE ID | **CVE-2026-41940** | | CVSS 评分 | **9.8 — 严重** | | 受影响版本 | 所有受支持的 cPanel & WHM 版本 | | 漏洞利用 | 在公开披露之前已被积极利用 | | 恶意软件 | `nuclear.x86` Linux 僵尸网络 | | 攻击者 IP | `87.121.84.78` · `45.148.120.23` | ### 如何判断您的服务器是否被感染: ``` wget google.com # 如果显示 "Killed" → nuclear.x86 仍在运行 # 如果正常 download → 没有 malware 或已经死亡 ``` ## 📦 本工具包包含的内容 | 脚本 | 功能 | 何时使用 | |--------|-----|-------------------| | `cpanel_security_check.sh` | 完整的服务器审计、恶意软件清除、SSH 密钥轮换 | **首先运行此脚本** | | `imunify360_scan_clean.sh` | 使用 Imunify360 扫描所有账户并清理 webshell | **其次运行此脚本** | ## ⚡ 快速入门 — 同时运行两个脚本 ``` 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 ``` ## 🔍 脚本 1 — cpanel_security_check.sh ### 运行: ``` bash <(curl -s https://raw.githubusercontent.com/mahfuzreham/cpanel-cve-2026-41940/main/cpanel_security_check.sh) ``` ### 检查内容: | 检查项 | 描述 | |-----|-------| | 🦠 恶意软件进程 | 检测并终止正在运行的 nuclear.x86 进程 | | 🌐 wget/curl 测试 | 确认恶意软件是否处于活动状态 | | 🔌 攻击者 IP | 检查是否存在与 C2 IP 的连接 | | 📜 历史记录扫描 | 在 Shell 历史记录中搜索攻击特征 | | 📦 cPanel 版本 | 检查上次更新和补丁状态 | | 🔓 端口暴露 | 检查 2083、2087、2095、2096 端口是否开放 | | 🗝️ SSH 密钥 | 私钥有效期及 authorized_keys 审计 | | ⏰ Cron 任务 | 可疑的 cron 条目扫描 | | 🐚 Webshell | public_html 目录中的 PHP shell 扫描 | | 🔐 SUID 二进制文件 | 意外的 SUID 文件检测 | ### 自动清理内容: - 终止 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) ``` ### 执行操作: | 步骤 | 任务 | |-----|-----| | 1 | Imunify360 状态与服务检查 | | 2 | 恶意软件签名数据库更新 | | 3 | 所有 cPanel 账户的全面扫描 | | 4 | CVE-2026-41940 webshell 特征扫描 | | 5 | 自动清理 + 隔离 | | 6 | 删除可疑文件(包含备份) | | 7 | 启用实时防护 | | 8 | 设置每日自动扫描 cron 任务 | | 9 | 生成完整摘要报告 | ### 搜索的 Webshell 文件名模式: ``` wp-cache-*.php wp-check-*.php wp-sync-*.php wp-util-*.php admin-init-*.php upgrade-*.php class-wp-*.php task_*.php .*\.php (hidden) ``` ### Webshell 代码特征: ``` eval(base64_decode system($_ passthru($_ assert($_ exec($_ shell_exec($_ ``` ## 📋 系统要求 | | cpanel_security_check.sh | imunify360_scan_clean.sh | |--|--------------------------|--------------------------| | 操作系统 | CentOS / AlmaLinux / CloudLinux / Ubuntu | CentOS / AlmaLinux / CloudLinux / Ubuntu | | 面板 | cPanel & WHM | cPanel & WHM | | 权限 | Root SSH | Root SSH | | 软件 | — | Imunify360 (已授权) | ### 如果没有 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 ← Script 1 log /root/imunify360_cleanup_TIMESTAMP.log ← Script 2 log /root/imunify360_report_TIMESTAMP.txt ← Infected files list /root/webshell_backup/ ← Deleted files 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: ``` /scripts/upcp --force ``` ### 停止 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 run করুন ☐ imunify360_scan_clean.sh run করুন ☐ cPanel সব account এর password reset করুন ☐ সব FTP / email / MySQL password reset করুন ☐ wp-config.php / .env files update করুন ☐ Email Forwarders এ অজানা forward নেই তো? ☐ Cron Jobs এ অজানা job নেই তো? ☐ FTP Accounts এ অজানা account নেই তো? ☐ GitHub / GitLab থেকে পুরনো SSH key revoke করুন ☐ WordPress admin users এ অজানা user নেই তো? ☐ সব WordPress plugins ও themes update করুন ``` ## 🖥️ 兼容性 | 操作系统 | 状态 | |----|--------| | AlmaLinux 8/9 | ✅ | | CloudLinux 7/8 | ✅ | | CentOS 7 | ✅ | | Rocky Linux 8/9 | ✅ | | Ubuntu 20/22 (cPanel) | ✅ | ## 📚 参考 - [cPanel 安全公告 — CVE-2026-41940](https://support.cpanel.net/hc/en-us/articles/40073787579671-Security-CVE-2026-41940-cPanel-WHM-WP2-Security-Update-04-28-2026) ## 📄 许可证 MIT 许可证 — 可免费使用、分享和修改。 **分享时请保留作者署名。** ## 🆘 支持 - 🌐 [MahfuzReham.Com](https://MahfuzReham.Com) - 💬 WhatsApp: [+8801790614055](https://wa.me/8801790614055) - 🐙 GitHub: [github.com/mahfuzreham](https://github.com/mahfuzreham) **⚠️ 请与所有人分享此工具包 — 任何拥有 cPanel 服务器的用户都可能受到此漏洞的影响。**
标签:cPanel, CVE-2026-41940, Imunify360, IP 地址批量处理, Linux僵尸网络, Linux服务器, nuclear.x86, SSH密钥轮换, Webshell清理, Web主机管理, WHM, 子域名枚举, 库, 应急响应, 应用安全, 恶意软件清除, 服务器加固, 清理脚本, 漏洞修复, 系统安全, 结构化查询, 网络安全培训, 自动化安全, 高危漏洞(CVSS 9.8)