Fix Missing Email Accounts in cPanel After a WordPress Hack
When email accounts disappear after a site compromise. This article explains how WordPress hacks can affect cPanel email accounts.
Issue: Email accounts missing from cPanel
Reason:The emails accounts get disappeared from cPanel due to the email account entry missing in the shadow file. In such cases, please check if there is any backup file named 'shadow.roottn.bak' inside /home/<user>/etc/<domain_name>. If yes, then it is a case of wordpress hacking where the hacker uploads a script inside the account by exploiting the vulnerability of outdated wordpress application. The script will rename the shadow file to shadow.roottn.bak and creates a new shadow file (possibly with different password) . The hacked file name will be wp-crop.php and wp-crops.php inside the wordpress installation folder.
Resolution: If you found any such instance, disable or remove such hacked files and restore the email accounts from shadow.roottn.bak file. Also update the customer to change the cPanel , wordpress password and upgrade the wordpress to latest versions along with the themes.