€ EUR
cPanel Hacks: How to Protect Your cPanel Account
  • Monday, 15th September, 2025
  • 08:01am

cPanel is widely recognized as a robust hosting panel, yet without the implementation of appropriate safety measures and configurations, it can become susceptible to various attacks. Understanding these vulnerabilities and how to safeguard against them is crucial for maintaining the integrity of your web presence.

cPanel-hacks-How-to-protect-your-cPanel-account

How Does a cPanel Hack Affect Clients?

how does cPanel hack look for clients

A cPanel compromise can have severe consequences, often leading to client domains or the server's IP address being blacklisted. This can occur due to malicious activities such as spam email campaigns or other illicit actions originating from the compromised account. Such blacklisting can result in significant financial and reputational damage to a business, as search engines may penalize or de-list affected domains. The process of removing a site from blacklists can be lengthy and complex. Therefore, proactive security measures are paramount to prevent cPanel hacks before they occur.

How Can a cPanel Account Be Hacked?

how does cPanel hack look for clients

Several methods can be employed by malicious actors to gain unauthorized access to a cPanel account. Understanding these common attack vectors is the first step in fortifying your security posture.

Hacking Through Password Recovery

icon_password

It's important to note that information regarding password resets using the .contactemail file is outdated. In cPanel version 106 and later, contact emails have been relocated to /var/cpanel/users/$USER and can now only be modified by the account administrator. However, historical vulnerabilities or interconnected compromises can still pose a risk.

A cPanel account hack can sometimes be a consequence of a compromised website, and vice-versa. In practice, there have been instances of unauthorized access achieved through exploiting password recovery systems. By leveraging a vulnerability or using compromised access, an attacker might attempt to manipulate the email address associated with password recovery. If the option "Reset Password for cPanel accounts" is enabled on the server, an attacker could potentially reset the account password and gain full access to the cPanel account.

Simply scanning or changing credentials may not be sufficient if you suspect a breach. It is crucial to verify that the contact email address associated with your account is legitimate and has not been altered by an attacker.

As an indicator of compromise, you might observe a request originating from 127.0.0.1 in the log file /usr/local/cpanel/logs/access_log. The user-agent in such requests may vary.

Hacking through password recovery

Legitimate requests to cPanel for this specific URL from 127.0.0.1 should generally not occur. If such requests are present in your logs, it strongly suggests they were initiated by automated hacking tools.

To disable the password recovery functionality, you can navigate to WHM >> Tweak Settings. Unchecking the option 'Allow cPanel users to reset their password via email' and saving the settings will prevent users from resetting their passwords through the 'you can reset your password by entering your username' link.

cPanel password reset

Frequently, after gaining unauthorized access to a cPanel account, attackers proceed to create mailboxes for spam distribution, upload doorway pages to the server, or establish subdomains for phishing attempts. Advanced security solutions often include features like a Web Application Firewall (WAF) and Proactive Defense mechanisms to prevent such malicious activities. Additionally, real-time file upload scanners can monitor and clean up malicious files uploaded via cPanel, blocking harmful actions initiated through the cPanel File Manager.

Brute-Force Attack

icon_bruteforce

Since a password recovery hack can often be a consequence of an initial compromise, a brute-force attack is a common method employed by attackers. A brute-force attack involves an attacker systematically submitting numerous password combinations in the hope of eventually guessing the correct one. One of the most effective defenses against this is to use strong, complex passwords. However, robust passwords alone may not always be sufficient. In such scenarios, an additional security solution specifically designed to counter brute-force attacks can be invaluable. These solutions typically monitor authorization attempts and automatically block attackers upon detecting abusive patterns, significantly enhancing protection.

API Tokens

icon_apitoken

In cases where the server's root access is compromised, attackers can establish backdoors using API tokens. If you suspect that your server has been breached, it is crucial to inspect the "Development" → "Manage API Tokens" section for any unauthorized or suspicious tokens. Hackers often issue tokens with root privileges, which they then use to log in and create sessions within cPanel, allowing them to maintain persistent access and control.

How to Secure WHMCS/cPanel Accounts After a Hack?

How to secure WHMCS/cPanel accounts if you have been hacked?

If you discover that accounts have been compromised, immediate action is necessary. You must change all associated credentials, thoroughly scan files for malicious code, and diligently check databases for any unauthorized modifications. Attackers might also create new accounts within content management systems (CMS) to facilitate future uploads of malicious code. A comprehensive clean-up and hardening process is essential.

Here is a detailed checklist of actions to take following a security breach:

  • Change Your cPanel Account Password: Immediately update your cPanel password. Ensure the new password is strong, combining uppercase and lowercase letters, numbers, and symbols. It should not be tied to personal information or common dictionary words.
  • Update Other Credentials: Also change passwords for all associated MySQL, FTP, and SSH accounts.
  • Verify Contact Emails: Check the files ~/.contactemail and ~/.cpanel/contactinfo to confirm the correct email addresses are listed and have not been altered.
  • Inspect Cron Jobs: Review all cron jobs for any suspicious or malicious injections that could be running unauthorized tasks.
  • Identify Fraudulent CMS Users: In the case of WordPress, examine the wp_users table for any unauthorized or fraudulent user accounts. These accounts could be used by attackers to continue uploading malicious code to the server.
  • Scan and Clean Files and Databases: Perform a thorough scan and cleanup of all files and databases for any malicious code. Specialized tools, such as a Malware Database Scanner, can assist in identifying and removing threats from databases. For a more comprehensive approach to cPanel security, refer to guides detailing numerous ways to enhance cPanel security.

Conclusion: Enhancing cPanel Security

Conclusion: Forget about cPanel Hacks with Imunify360

With advanced security features like cPanel Upload Scanners, it is now possible to gain robust control over file uploads within cPanel. Such features can effectively block malicious file uploads via the cPanel File Manager and prevent content modification that could lead to malware injections. Beyond basic antivirus and Web Application Firewall (WAF) functionalities, comprehensive security suites often combine an Intrusion Prevention and Detection System, an Application Specific Web Application Firewall, Real-time Antivirus protection, a Network Firewall, and Patch Management components into a single solution. These fully-automated solutions typically collect all relevant statistics and present them through an intuitive dashboard, simplifying security management.

Implementing such advanced security measures helps ensure your servers remain secure and operational, allowing you to significantly reduce the risk of cPanel hacks. Focusing on a multi-layered security approach can provide peace of mind and robust protection against evolving cyber threats.

« Back