Initial impact: why the first restore seems to work
Investigation timeline: work backward to the earliest evidence
BASH
# Session records mentioning root (line format varies by cPanel version)
grep 'root' /usr/local/cpanel/logs/session_log | less
# WHM API calls: scan for account creation, password or token changes
grep 'json-api' /usr/local/cpanel/logs/access_log | less
# Successful SSH logins: /var/log/secure on RHEL-based systems,
# /var/log/auth.log on Debian and Ubuntu
grep 'Accepted' /var/log/secure | lessThe discovery: the backup was taken after the breach
BASH
# Default destination is often /backup; confirm in WHM Backup Configuration
ls -l --time-style=long-iso /backup/
# List a compressed account archive without extracting or restoring it
tar -tvzf /backup/YYYY-MM-DD/accounts/USERNAME.tar.gz | grep 'public_html' | grep '[.]php$' | lessTemporary mitigation while you pick a restore point
- Copy logs, and a snapshot of the server if your platform allows it, to another system before changing anything. Cleanup destroys evidence you may still need.
- Restrict WHM and cPanel ports (2087 and 2086 for WHM, 2083 and 2082 for cPanel by default) to known admin IPs. The trade-offs are covered in Should You Restrict WHM Ports with Host Access Control or a Firewall?.
- Update cPanel & WHM to a build that the vendor advisory lists as fixed, then confirm the installed version instead of assuming the update ran.
- Rotate the root password, revoke API tokens you do not recognize, remove unknown SSH keys, and end active WHM sessions.
- Suspend accounts the attacker created rather than deleting them, so they remain available as evidence.
