How to Secure a cPanel Server from Phishing Attacks
- Ankush Dawar
- 15 hours ago
- 9 min read
Phishing attacks are one of the most common ways attackers gain access to cPanel accounts, email accounts, websites, and hosting servers. A single stolen cPanel password can allow an attacker to upload malicious files, create fake login pages, send spam, compromise websites, or abuse email accounts.
A properly secured cPanel server should use multiple layers of protection rather than relying only on a strong password. This guide explains practical ways to protect a cPanel & WHM server against phishing, credential theft, malicious websites, email spoofing, and account compromise.

Important: Phishing is primarily a social-engineering attack. Server security controls can reduce the impact of stolen credentials, but administrators should also protect users from fraudulent emails, fake login pages, and malicious links.
What Is a Phishing Attack?
Phishing is an attack in which criminals attempt to trick users into revealing sensitive information such as:
cPanel usernames and passwords
WHM administrator credentials
Email passwords
FTP credentials
Database credentials
Two-factor authentication codes
API credentials
Credit-card or payment information
A typical attack may begin with an email claiming that a hosting account has been suspended or that an invoice needs to be paid.
The victim clicks a link and is taken to a fake login page that looks almost identical to the legitimate cPanel or webmail login page. When the victim enters their username and password, the attacker receives the credentials and may then use them to access the real account.
Why cPanel Servers Are Attractive Targets
cPanel servers often host multiple websites, email accounts, databases, FTP accounts, and applications.
If an attacker compromises one account, they may attempt to:
Upload phishing pages.
Send fraudulent emails.
Steal website credentials.
Modify DNS or website files.
Create additional FTP or email accounts.
Install malware.
Send spam through compromised mailboxes.
Attack other websites hosted on the same server.
This makes phishing protection an important part of overall cPanel server security.
1. Enable Two-Factor Authentication
One of the most effective protections against stolen cPanel credentials is Two-Factor Authentication (2FA).
With 2FA enabled, knowing the username and password is not enough to log in. The user must also provide a temporary authentication code.
Current cPanel documentation supports 2FA for cPanel and WHM environments, including TOTP-based authentication.
Enable 2FA in WHM
Depending on your cPanel version, navigate to:
WHM → Security Center → Two-Factor Authentication
Enable the 2FA security policy.
After enabling the server-wide policy, individual cPanel users can configure 2FA from:
cPanel → Security → Two-Factor Authentication
Administrators should strongly consider requiring 2FA for:
Root/WHM administrators
Reseller accounts
Hosting administrators
High-value hosting accounts
Email administrators
2FA is particularly valuable when a user accidentally submits their password to a phishing website.
2. Protect the WHM Root Account
The WHM root account provides extremely powerful access.
If an attacker obtains root credentials, the consequences can be much more serious than the compromise of a single hosting account.
Use the following practices:
Use a long, unique root password.
Enable 2FA.
Avoid sharing root credentials.
Use SSH keys where appropriate.
Restrict administrative access by IP where practical.
Avoid logging into WHM from untrusted computers.
Never enter root credentials into links received through unsolicited email.
Do not use the same password for WHM, email, FTP, databases, or other services.
3. Enable cPHulk Brute Force Protection
Phishing and credential theft often work together with automated login attempts.
If an attacker obtains a username and password combination, they may attempt to use it repeatedly against cPanel services.
cPHulk Brute Force Protection can help protect cPanel, WHM, mail services, FTP, and SSH against brute-force attacks.
You can manage it from:
WHM → Security Center → cPHulk Brute Force Protection
Enable cPHulk and configure its settings according to your server's access requirements.
Important: Whitelist trusted administrative IP addresses carefully so legitimate administrators do not accidentally lock themselves out.
cPHulk is not a replacement for 2FA. The two controls address different aspects of account security.
4. Use Strong and Unique Passwords
A phishing attack can steal even a very strong password.
Nevertheless, strong passwords remain essential because they reduce the effectiveness of password guessing and credential stuffing.
Create unique passwords for:
WHM
cPanel accounts
Email accounts
FTP accounts
SSH
Databases
CMS administrators
Control panels
Third-party applications
Avoid passwords based on:
Company names
Domain names
Employee names
Telephone numbers
Birth dates
Common words
Sequential numbers
A password manager can make it easier to create and maintain unique credentials.
cPanel also provides password-strength configuration capabilities, and its documentation recommends increasing minimum password strength to reduce the likelihood of password guessing.
5. Keep cPanel & WHM Updated
Outdated software can expose vulnerabilities that attackers may exploit after gaining access to an account.
Keep the following updated:
cPanel & WHM
Operating system
Apache
PHP
MySQL/MariaDB
WordPress
Drupal
Joomla
Plugins
Themes
Web applications
Security software
Regularly review:
WHM → Security Center → Security Advisor
cPanel's Security Advisor scans the server and provides recommendations for addressing identified security issues.
Security updates should be treated as part of routine server administration rather than an occasional task.
6. Enable ModSecurity
ModSecurity provides an additional web application security layer for Apache-based websites.
It can help detect and block certain malicious HTTP requests and attacks against web applications.
cPanel provides ModSecurity configuration and rule-management functionality through WHM.
Navigate to:
WHM → Security Center → ModSecurity
Install and maintain an appropriate ruleset.
ModSecurity should be tested carefully because overly aggressive rules can cause legitimate applications to stop working.
7. Protect Websites from Being Used as Phishing Pages
A compromised website is frequently used to host phishing pages.
For example, an attacker may upload directories such as:
/public_html/login/
/public_html/secure/
/public_html/webmail/
/public_html/account/
/public_html/verify/
The pages may imitate banking, email, social-media, payment, or hosting login screens.
To reduce this risk:
Keep CMS software updated.
Remove unused plugins and themes.
Use strong administrator passwords.
Enable 2FA wherever available.
Restrict file permissions.
Monitor newly created files.
Scan websites for malware.
Review unfamiliar PHP files.
Monitor changes to .htaccess.
Remove abandoned applications.
If your server provides a malware-scanning solution, schedule regular scans.
cPanel's Virus Scanner interface can scan cPanel accounts when the required ClamAV components are installed and enabled.
8. Monitor for Newly Created Phishing Files
One of the most useful techniques for hosting administrators is monitoring filesystem changes.
Unexpected files in locations such as:
public_html/
wp-content/uploads/
tmp/
images/
cache/
administrator/
may deserve investigation.
Look for suspicious files containing:
Obfuscated PHP
Hidden redirects
Fake login forms
Password collection scripts
Encoded JavaScript
Unusual .php files inside upload directories
Recently modified files
Unknown .htaccess changes
For example, administrators can investigate recently modified files with:
find /home -type f -mtime -1
Or search for recently modified PHP files:
find /home -type f -name "*.php" -mtime -1
These commands should be used as investigation aids, not as proof that a file is malicious.
9. Monitor Outgoing Email
A compromised cPanel account may be used to send thousands of phishing emails.
Monitor:
Exim mail queues
Email delivery reports
Unusual outbound volume
SMTP authentication failures
Large numbers of bounced messages
Unknown email accounts
Suspicious login activity
A sudden increase in outgoing email can be an early indication that an account has been compromised.
cPanel also provides recommendations for preventing email abuse, including strong passwords and cPHulk protection.
10. Configure SPF, DKIM and DMARC
Email authentication is an important component of phishing defense.
SPF
Sender Policy Framework (SPF) identifies which servers are authorized to send email for a domain.
DKIM
DomainKeys Identified Mail (DKIM) adds a cryptographic signature to outgoing messages.
DMARC
Domain-based Message Authentication, Reporting, and Conformance (DMARC) allows domain owners to publish a policy for handling messages that fail authentication checks.
cPanel's documentation explains that SPF and DKIM help authenticate legitimate mail, while DMARC uses SPF and DKIM alignment to help receiving servers handle suspicious messages.
For domains hosted on your server, check:
cPanel → Email → Email Deliverability
Correctly configured SPF, DKIM, and DMARC records can make it harder for attackers to successfully impersonate your domain in email.
11. Disable Unnecessary Services
Every unnecessary service can increase your attack surface.
Review services running on your server and disable those that are not required.
Pay particular attention to:
FTP
Telnet
Unused mail services
Unused development tools
Unused network services
Legacy software
Unnecessary ports
cPanel's security guidance recommends reducing unnecessary services and using firewall controls to restrict unwanted access.
12. Configure a Firewall
A properly configured firewall provides another security layer.
A firewall can restrict access to services based on:
Port
Protocol
IP address
Network
Connection type
Make sure the firewall permits only services that your hosting environment actually requires.
Before changing firewall rules on a production server, make sure you have console or out-of-band recovery access available.
An incorrect firewall rule can lock administrators out of the server.
13. Restrict SSH Access
SSH is one of the most important administrative services on a Linux server.
Recommended practices include:
Use SSH keys where possible.
Disable password authentication where operationally appropriate.
Restrict SSH access to trusted IP addresses when feasible.
Disable direct root login where your administration model permits it.
Monitor authentication logs.
Use strong account credentials.
Avoid exposing unnecessary SSH services.
cPanel includes security settings for SSH password authorization and related server security controls.
14. Secure FTP Accounts
FTP credentials are frequently targeted because compromised FTP accounts can allow attackers to upload phishing files.
Whenever possible, use secure alternatives such as:
SFTP
FTPS
Review FTP accounts regularly and delete accounts that are no longer required.
Never give an FTP account broader access than necessary.
If a website only needs access to a particular directory, configure the account accordingly.
15. Educate cPanel Users About Phishing
Technology alone cannot stop every phishing attack.
Users should know how to identify suspicious messages.
Teach users to be cautious when an email:
Creates an urgent deadline.
Requests a password.
Requests a 2FA code.
Claims that a domain will be suspended.
Requests payment through an unusual method.
Contains a suspicious attachment.
Uses a slightly misspelled domain.
Redirects users through an unfamiliar URL.
A hosting company should never rely solely on a warning such as "Don't click phishing links."
Users should be encouraged to access cPanel by manually entering the known server address or using a trusted bookmark rather than clicking an unexpected login link.
16. Monitor Login Activity
Regularly review authentication activity for unusual behavior.
Look for:
Logins from unfamiliar countries
Unusual IP addresses
Multiple failed logins
Successful logins at unusual times
New FTP accounts
New email accounts
Unexpected password changes
Unexpected forwarding rules
Newly created API tokens
Changes to DNS
New administrator accounts
Unexpected successful authentication can be more important than repeated failed attempts.
17. Protect Email Forwarders
Attackers who compromise email accounts may create forwarding rules that silently send messages to an external address.
This can expose:
Password-reset emails
Customer information
Business correspondence
Invoices
Authentication messages
Confidential documents
Regularly review email forwarders and remove those that users did not intentionally create.
18. Use Least-Privilege Access
Users should receive only the access they need.
Avoid giving every administrator:
Root access
Full WHM access
Shell access
Unlimited FTP access
Use separate accounts and appropriate privileges.
The principle is simple: the less access an account has, the less damage an attacker can cause if that account is compromised.
19. Maintain Reliable Backups
Backups will not prevent phishing attacks, but they can dramatically reduce recovery time after a compromise.
Maintain backups of:
Website files
Databases
Email where required
DNS configuration
cPanel account data
Server configuration
Ideally, maintain backups outside the production server.
A backup stored on the same compromised server may also be deleted or modified by an attacker.
Test restoration periodically. A backup that has never been restored should not automatically be considered a reliable backup.
20. What to Do If a cPanel Account Is Compromised
If you discover that a cPanel account has been compromised, act quickly.
Step 1: Reset the Password
Immediately change the compromised password.
Also change any other account that used the same password.
Step 2: Enable 2FA
Enable two-factor authentication if it was not already configured.
Step 3: Review FTP Accounts
Remove unknown FTP users and rotate credentials.
Step 4: Review Email Accounts
Check for:
Unknown mailboxes
Forwarders
Filters
Auto-responders
Suspicious login activity
Step 5: Scan Website Files
Search for malicious files and recently modified files.
Step 6: Review DNS
Check for unauthorized DNS changes.
Step 7: Inspect Outgoing Email
Determine whether the compromised account was used to send spam or phishing messages.
Step 8: Check for Persistence
Look for:
Cron jobs
SSH keys
API tokens
New users
Backdoors
Modified .htaccess
Suspicious PHP files
Step 9: Review Server Logs
Determine how the attacker obtained access and what they did after authentication.
Step 10: Remove the Root Cause
Simply deleting the phishing page is not enough.
If the original vulnerability remains, the attacker may return.
A Practical cPanel Anti-Phishing Security Checklist
Use this checklist when hardening a production cPanel server:
Enable 2FA for WHM administrators.
Encourage or require 2FA for cPanel users.
Use unique, strong passwords.
Protect the WHM root account.
Enable cPHulk.
Keep cPanel & WHM updated.
Keep the operating system updated.
Run Security Advisor regularly.
Enable and properly configure ModSecurity.
Scan websites for malware.
Monitor recently modified files.
Monitor Exim and outbound email activity.
Configure SPF.
Configure DKIM.
Configure DMARC.
Use a properly configured firewall.
Restrict SSH access where practical.
Avoid unnecessary FTP access.
Remove unused hosting accounts.
Review email forwarders.
Monitor successful login activity.
Maintain off-server backups.
Test backup restoration.
Educate hosting users about phishing.
Investigate unexpected administrative changes immediately.
Final Thoughts
Securing a cPanel server from phishing attacks requires more than installing a firewall or changing passwords.
The strongest approach combines 2FA, strong authentication, cPHulk, ModSecurity, malware scanning, email authentication, firewall controls, regular updates, monitoring, backups, and user awareness.
The most important principle is to assume that phishing will eventually be attempted against your users. The goal is to make stolen credentials difficult to use, limit the damage caused by compromised accounts, detect suspicious activity quickly, and recover reliably when an incident occurs.




Comments