Help for owners
I found strange files on my hosting account and think it is infected
Short answer
Strange files, a host warning or visitors sent to other sites suggest a hosting account was compromised. cPanel's Virus Scanner can list infected files, but it only checks what you point it at and cannot clean the cause. Change passwords, keep a copy of everything, delete nothing yet and get the entry point found.
Does this sound like your situation?
- My host emailed me that malware was found on my account.
- There are files I did not upload, with odd names, in the website folders.
- Visitors land on casino, pharmacy or other unrelated pages from Google.
- My site was cleaned and the same files came back.
- My emails are being marked as spam, or my host says my account sends spam.
Why does this happen?
An old or weak entry point was used
Outdated plugins and themes, weak or reused passwords and leaked FTP details are the common ways in. The infected files are the result, not the cause.
Technical detail: wp-admin loads a completely blank page in WordPress
One account can hold many sites
Files on a hosting account are often shared across several sites, so an infection in one folder can reach the others. Cleaning only the visible site leaves a way back in.
A scan finds some things and misses others
cPanel's Virus Scanner uses ClamAV to scan your mail, your home directory, your public FTP space or your public web space, and lists any infected files it finds. Your hosting provider has to install the ClamAV plugin, and the page says nothing about how accurate the detection is or how to remove what it finds.
Confirmed by docs.cpanel.net
The scanner may not be there at all
cPanel states that providers can turn the Virus Scanner off in Feature Manager. If you do not see it in your account, your provider has not enabled it.
Confirmed by docs.cpanel.net
Deleting the files alone does not stop it
Hidden users, scheduled jobs and backdoor files let an attacker return. A clean-up that does not find the entry point is only temporary.
What can I do about it today?
- Change the passwords from a clean computerChange the hosting account password, then FTP, email, database and website admin passwords. Use a different password for each, kept in a password manager.
- Do not delete files yetDownload a copy of the whole account first, including the strange files. They show how the attack happened, and deleting the wrong file can break the site.
- Run the Virus Scanner if your cPanel has itOpen the Virus Scanner in cPanel and scan the web space and your mail. Save the list of infected files it shows. A clean result does not prove the site is clean.
- Read your host's message in fullNote what was flagged, the file paths and any deadline. Reply politely, say you are working on it and ask whether more time is possible.
- Tell your customers if their data could be involvedIf your site takes logins, orders or forms, the people affected should be told what happened. Ask a lawyer about your duties; I do not give legal advice.
- Check which plugins and themes are out of dateWrite the list with version numbers. Do not update everything blindly on an infected site.
When should I bring someone in?
- The files come back after you delete them.
- The site takes payments, logins or personal data.
- Your host has suspended the account or set a deadline.
How do I handle it?
- Keep the evidence and a full copyI copy the account and its logs before touching anything, so the original state is available.
- Find the way inI compare files with clean originals, check users and scheduled jobs and read the access logs for the first request that should not have happened.
- Clean and close the doorInfected files are replaced from clean sources, backdoors removed and software updated, then passwords and keys changed.
- Check every site on the accountEach site and mailbox on the same hosting account is checked, not only the one that was noticed.
- Set up detection for next timeFile change alerts, automatic updates where safe and a tested backup that lives away from the account.
The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.
What do owners ask about this?
Can the Virus Scanner clean my site?
cPanel's page says the scanner lists infected files and prompts you to act. It does not describe removal steps, and it does not explain how the files got there.
Do I need to rebuild the whole site?
Not always. It depends on how deep the infection goes. The decision is made after the files are compared with clean originals.
Will my host restore the account?
That is the host's decision. Reply to their notice and show what you have done.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Found a mistake? Tell me.