One-shot detection and remediation for cPanel/WHM servers compromised via CVE-2026-41940, including IOC checks, malware cleanup, C2 blocking, and patching.
One-shot detection and remediation for cPanel/WHM servers compromised via CVE-2026-41940 and the
nuclear.x86botnet campaign.
On 28 April 2026, cPanel disclosed a pre-authentication authentication-bypass vulnerability (CVE-2026-41940, CVSS 9.8) affecting all supported cPanel & WHM versions after 11.40. A single HTTP request to port 2087 lets an unauthenticated attacker inject a user=root session and walk straight into WHM.
Exploitation has been seen in the wild since at least 23 February 2026 — six weeks before the patch dropped. The campaign we've cleaned up on multiple servers drops a Linux botnet called along with an XMRig-based crypto-miner.
nuclear.x86This repo contains a single Bash script that:
/scripts/upcp --forceIt is designed for hosting providers, sysadmins, and cPanel resellers who need to triage a fleet quickly.
If wget or curl return Killed when you try to download things, the malware is still running — nuclear.x86 actively kills download tools to prevent cleanup. Run the kill-step first (the script does this for you in --fix mode).
If you can't download this script because of that, copy-paste it via SSH from your laptop, or use scp.
# As root, on the cPanel server:
cd /root
wget https://raw.githubusercontent.com/shahidmallaofficial/cpanel-cve-2026-41940-fix/main/fix-cpanel-cve-2026-41940.sh
chmod +x fix-cpanel-cve-2026-41940.sh
Or with curl:
cd /root
curl -fsSLO https://raw.githubusercontent.com/shahidmallaofficial/cpanel-cve-2026-41940-fix/main/fix-cpanel-cve-2026-41940.sh
chmod +x fix-cpanel-cve-2026-41940.sh
One-liner (review the script first, then run):
cd /root && \
curl -fsSLO https://raw.githubusercontent.com/shahidmallaofficial/cpanel-cve-2026-41940-fix/main/fix-cpanel-cve-2026-41940.sh && \
chmod +x fix-cpanel-cve-2026-41940.sh && \
less fix-cpanel-cve-2026-41940.sh
# After reviewing, run it:
./fix-cpanel-cve-2026-41940.sh
Verify before running. This script runs as root and modifies system state. Open it and read it first. Do not pipe random scripts from the internet directly into
bash.
# 1. Scan only (default, no changes — always safe to run)
./fix-cpanel-cve-2026-41940.sh
# 2. Scan + remediate, with a confirmation prompt for each destructive action
./fix-cpanel-cve-2026-41940.sh --fix
# 3. Full auto: fix + cPanel update + cache clear + light hardening
./fix-cpanel-cve-2026-41940.sh --auto
# 4. Unattended (no prompts — for cron, jump-boxes, fleet scripts)
./fix-cpanel-cve-2026-41940.sh --auto -y
# 5. Help
./fix-cpanel-cve-2026-41940.sh --help
| Code | Meaning |
|---|---|
0 | Clean — no IOCs detected |
2 | Compromise indicators detected (review the report) |
1 / other | Pre-flight failure (not root, not a cPanel server, etc.) |
/var/log/cpanel-cve-fix/scan-<TIMESTAMP>.log/var/log/cpanel-cve-fix/report-<TIMESTAMP>.txt/root/cve-cleanup-backup-<TIMESTAMP>/| # | Check | What it catches |
|---|---|---|
| 1 | cPanel build vs patched releases | Vulnerable hosts (lists all 6 patched builds) |
| 2 | Running processes | nuclear.x86, xmrig, cpuminer, minerd, xmr-stak, 4thepool_miner |
| 3 | Active network connections | The three known C2 IPs + mining-pool ports |
| 4 | Shell history files | IOC commands in bash_history / zsh_history |
| 5 | Firewall sanity | The iptables -F sabotage step |
| 6 | cPanel session raw dir | Forged user=root session files |
| 7 | /tmp, /var/tmp, /dev/shm | Recently dropped executables |
| 8 | Cron entries | Persistence (system + per-user) |
| 9 | authorized_keys files | New SSH keys — read-only audit |
| 10 | cPanel access logs | Go-http-client / python-requests exploit signatures |
| 11 | Critical binaries | Tampered wget / curl / ls / ps (mtime + RPM verify) |
/var/cpanel/sessions/raw/* (with tar.gz backup first)cpsrvd, cpdavd, cphulkd, queueprocd, dnsadmin/scripts/upcp --force (only in --auto)rndc flush), old journal logsLF_INTEGRITY if availableThese would do more harm than good when run unattended over SSH, so they go in the manual-action report instead:
/home/*/public_htmlFor sweeping many servers from a jump-box:
mkdir -p reports
while read -r host; do
echo "=== $host ==="
scp fix-cpanel-cve-2026-41940.sh "root@${host}:/root/" >/dev/null
ssh "root@${host}" '/root/fix-cpanel-cve-2026-41940.sh --auto -y'
scp "root@${host}:/var/log/cpanel-cve-fix/report-*.txt" "reports/${host}.txt" 2>/dev/null
done < servers.txt
Then grep the reports:
grep -l "COMPROMISE INDICATORS PRESENT" reports/*
The script will list these in its report. None of them can be safely automated.
/etc/shadow)wp-config.php, .env, config.php, etc./home/*/public_html for web-shells (recently modified .php files)You need to be at or above one of these builds:
| Track | Patched build |
|---|---|
| 110.0.x | 11.110.0.97 |
| 118.0.x | 11.118.0.63 |
| 126.0.x | 11.126.0.54 |
| 132.0.x | 11.132.0.29 |
| 134.0.x | 11.134.0.20 |
| 136.0.x | 11.136.0.5 |
| WP² | 11.136.1.7 |
Check yours with /usr/local/cpanel/cpanel -V.
| Type | Indicator |
|---|---|
| IP | 87.121.84.78 (nuclear.x86 drop) |
| IP | 45.148.120.23 (nuclear.x86 alt drop) |
| IP | 31.57.109.131 (miner script) |
| File | nuclear.x86 (Mirai-derivative ELF) |
| Process | nuclear.x86 xd |
| Script | 4thepool_miner.sh |
| User-Agent | Go-http-client/1.1 hitting port 2087 |
| User-Agent | python-requests/* hitting port 2087 |
| Pattern | New file in /var/cpanel/sessions/raw/ containing user=root without matching successful login in login_log |
| Pattern | Empty / flushed iptables ruleset |
Is it safe to run on a healthy server? Yes. Default mode is scan-only and makes no changes. The fix and auto modes are idempotent.
Will it cause downtime?
--fix causes a brief WHM/cPanel interruption when it restarts cpsrvd (~10 seconds). --auto runs /scripts/upcp --force which can take 10–30 minutes — websites stay up during this, but WHM is briefly unavailable at the end.
My cPanel version isn't in the patched list — am I safe? If you're on a track older than 110.0.x, you're on an end-of-life version. cPanel will not ship a patch. Treat the host as compromised until proven otherwise and upgrade urgently.
The script says Killed when it tries to do anything.
That's nuclear.x86 actively killing your tools. Run the kill step manually first:
pkill -9 -f nuclear.x86
Then re-run the script.
Does this work on AlmaLinux / Rocky / CloudLinux / CentOS? Yes — all standard cPanel platforms. Tested on AlmaLinux 8, Rocky 9, CloudLinux 7+.
Will it touch my customer websites?
No. The script does not modify anything in /home/*/public_html. It only touches OS-level config, cPanel sessions, firewall rules, and known-bad processes.
PRs welcome — particularly for:
Please don't add anything that auto-rotates credentials or deletes user data — keeping the destructive surface narrow is intentional.
MIT. Use it, fork it, integrate it into your own tooling. Attribution appreciated but not required.
Built by WHMCSPilot.com — SM.
Vulnerability research credit: cPanel security team, watchTowr Labs, Rapid7, KnownHost, and the broader hosting community who shared IOCs as the campaign unfolded.
This script is provided as-is, without warranty. It is a first-response triage tool — not a substitute for a full incident-response engagement. If you handle PII, payment data, or other regulated data, consult your DPO and a qualified IR firm before declaring a compromised box clean.
If a server has been actively compromised, the safest path is always to rebuild from a known-good backup, not to clean in place.