This has happened to several of my sites on two different shared hosts. Some sites were even completely up to date core files, plugins, and themes. Some were indexed in search engines and some were not. I use iThemes security on all of my sites and I have most of them set to autoupdate everything.
I’m not sure where the vulnerability is, but it is very annoying. The injected code was mostly wrapped in this comment /*visitorTracker*/ if you don’t have a complete backup of your website it can take awhile to find and destroy all of the add files and fix all of the modified files.
Here’s what I used to track down the files that were added and modified:
- Site Protection
- AntiVirus or Theme Authenticity Checker
If you have more than one theme installed then I would suggest using the “Theme Authenticity Checker” plugin. The Site protection plugin is very good, but you do need to be on a newer version of WP. It will list all of the core files that have been changed and where in the file the corrupt code has been added. If your site has this virus then your themes been modified, if you’re using a twenty-something theme delete the whole thing and install a new version, otherwise it’s probably just in your header.php and foot.php files just search for /*visitorTracker*/
Here is a list of plugins that were not up to date on one of my sites that have had reported vulnerabilities:
iThemes Security 3.0-4.6.12 – Stored Cross-Site Scripting (XSS) (fixed in 4.6.13)
MainWP Child <= 2.0.9.1 – Authentication Bypass (fixed in 2.0.9.2)
WordPress SEO by Yoast <= 2.1.1 – Authenticated Stored DOM XSS (fixed in 2.2)
I added the following plugins as well to track any changes made to files from now on. Hopefully the next time it happens I’ll have a better idea of where the vulnerability is.
- WP Changes Tracker
- WordFence