If a file such as index.php has disappeared or been emptied and the site shows a 404 or a blank page, the most likely reason is an Imunify360 quarantine: the Imunify360 scan found the file infected and cleaned it or quarantined it. It means the protection worked, but also that someone managed to write malicious code to your site. Do not simply restore the same file. Replace it with a clean copy and find out how the code got in.
This guide is mainly about WordPress, but the same logic applies to any application on Konet hosting.
Why index.php or another site file disappeared
On Konet servers, Imunify360 checks every file that is uploaded or changed in real time, and also runs scheduled scans of the whole account. When it finds malicious code:
- If the code is part of a normal file, it removes the code and keeps the rest of the file.
- If the whole file is malicious, for example a backdoor with an innocent-looking name, it empties or isolates it.
- If a file is infected at the moment you upload it, e.g. a zip with a tampered plugin, the upload is blocked.
That is why you see symptoms such as a 404 on the home page, a blank page, a 500 error or a plugin that suddenly stopped working.
The server has no task that deletes customer files at regular intervals. If files disappear on the same day and time each time and there is no Imunify360 finding, check your own cron jobs in cPanel > Advanced > Cron Jobs and who else has FTP or administrator access to the site.
Where do I see what Imunify360 found
- Log in to cPanel and open Security > Imunify360.
- In the Malware Scanner tab you see the files that were found, their status and the date.
- In the History tab you see what Imunify360 did to each file, e.g. a cleanup.
Write down the path of each file. The path tells you where the problem came from. A file inside wp-content/plugins/plugin-name/ shows which plugin is infected. Files inside wp-content/uploads/ ending in .php should not exist at all. Files in the site root or in wp-includes mean WordPress itself was tampered with.
If Konet notified you about the finding by email, you will find the same files there.
What do I do to clean the site
- Do not restore the original file. The restore original option brings back the version before the cleanup, that is, together with the malicious code. It will be caught again in the next scan.
- If the file belongs to a plugin or theme, delete the whole plugin or theme from WordPress and install it again from the WordPress directory or from the developer. An infected plugin rarely has only one tampered file.
- If WordPress itself was tampered with, reinstall the current version from Dashboard > Updates. The reinstall replaces the WordPress files and does not touch your content or the database.
- If the file is your own, e.g. a custom theme or your own code, restore it from a backup dated before the infection, from cPanel > JetBackup 5 > Restore & Download > Home Directory. How to choose a restore point is explained in the JetBackup 5 guide. After the restore, Imunify360 checks the file again.
- Update WordPress, all plugins and the theme, and delete the ones you don't use. An inactive plugin stays on the server and its security hole can still be exploited.
- Change the passwords of cPanel, the FTP accounts and all WordPress administrators, from a computer you have checked for viruses.
- Check the users in Users > All Users for administrators you don't recognize and delete them. If you cannot log in, see how to get back into wp-admin.
If the site was tampered with in many places, redirects to unknown sites or you don't know where to start, follow the full WordPress hack recovery guide.
Why the file goes back into quarantine after I restore it
Usually for one of these reasons:
- You restored the original infected file or a backup from a date when it was already infected.
- The security hole that let the attacker in is still there, e.g. an outdated plugin, and the malicious code is rewritten automatically.
- There is a second hidden file (backdoor) that recreates the others.
- Someone logs in with real passwords, stolen by a virus on an administrator's computer.
In these cases another restore does not solve the problem. You need the clean reinstall of step 2 and the password change of step 6.
Nulled plugins and themes
Nulled plugins and nulled themes are pirated versions of commercial plugins and themes, distributed for free on various sites. Very often they already contain malicious code or a backdoor, and they get no security updates. Imunify360 recognizes and cleans them, which often breaks the site.
Konet's Terms of Use prohibit nulled software. If you have such a plugin or theme, uninstall it and buy the proper license from the developer, or find an alternative in the WordPress directory.
I received a notice about malicious code in the database
Imunify360 also scans the WordPress database. A finding in the database is usually:
- A spam comment or post with a link to an infected site.
- JavaScript code inside pages, posts or site settings that redirects visitors.
What you do:
- Check Users > All Users for unknown administrators. Security holes in plugins and themes let bots create their own administrators or change the password of the main administrator.
- Update WordPress, plugins and theme.
- In Comments, delete the spam comments and empty the trash.
- In Settings > Discussion, close comments if you don't need them, or set every comment to need your approval before it is published.
- Before any change directly in the database, take a copy from phpMyAdmin > Export.
If the notice says the automatic database cleanup failed, do not try to delete records blindly. Open a ticket and ask for a check.
When there is no need to worry
- A finding in cache files. If the file was inside a cache folder, e.g.
wp-content/cacheorwp-content/litespeed, clear the cache as we explain in clearing the cache. If a new scan finds nothing, the site is clean. - A single finding that was cleaned in a plugin you then updated or reinstalled, with no other signs, such as unknown users or redirects.
- A false positive. If you believe one of your own files is clean and Imunify360 catches it every time, don't upload it again and again. Open a ticket with the file path and we will check it.
What Konet does and what it doesn't
Konet keeps Imunify360 active on all servers, which automatically cleans common infections, and notifies you when a finding needs action from you. With a ticket you can ask for a full scan of the account. Let us know immediately if you suspect the site has been compromised.
Cleaning the code or the database of the site itself, reinstalling plugins and reconfiguring the site are not included in hosting. If you need them from us, they are done on request and charged. For prevention, see how to protect the admin login from brute force attacks on WordPress.
Frequently Asked Questions
Who deleted index.php from my site?
Almost always Imunify360, because the file contained malicious code. You can see it in cPanel > Security > Imunify360. If there is no finding there, check the account's cron jobs and who has access to the site.
Can I restore the file from the Imunify360 quarantine?
You can, but it will come back with the malicious code and be caught again. Put a clean copy in place instead: reinstall the plugin or theme, or restore a backup from before the infection.
The plugin stopped working after the cleanup, what do I do?
Delete the whole plugin and install it again from a trusted source. Its settings usually stay in the database.
Does the finding mean my site was hacked?
It means malicious code was written to a file or to the database. If it was found only in one plugin and cleared with a reinstall, that and updating are usually enough. If it was found in many places or there are unknown administrators, treat it as a hack.
Do I need to run a malware scan myself?
No, Imunify360 scans automatically. A security plugin in WordPress additionally helps with integrity checks of the WordPress files and with alerts.
Why did I get a database notice when the files are clean?
Because the malicious code can be only in database records, e.g. in spam comments. Follow the steps in the database section.