In late October 2024, a critical vulnerability in CyberPanel (CVE-2024-51567) let attackers run commands as root without authentication, through a flaw in how the panel's upgrademysqlstatus endpoint handled requests. Within days, automated worms were scanning the internet and dropping ransomware on unpatched servers. A few client servers I manage were running CyberPanel and got hit before I could patch them.

The first step on each affected server was pulling it off the network, or at minimum blocking inbound traffic at the firewall, before doing anything else. You don't want an active infection making more outbound connections while you're working. From there:
/usr/local/lscp and the web roots for unfamiliar files and recently modified timestamps
/etc/crontab, user crontabs, and systemd timers for anything that didn't belongauthorized_keys and any new user accounts

Once each server was clean, I applied the official patch CyberPanel released for the vulnerability, then went further:
CyberPanel's admin port (8090) should never be open to the entire internet. Restricting it to a VPN or a small allowlist of IPs would have stopped this particular worm regardless of the underlying vulnerability. That's the change I made across every server afterward: panel access goes through a VPN, full stop.