That’s definitely the result of malicious action and there’s a very high chance that it was done through a WordPress admin compromise. Once they have your admin login, they want to upload files to increase their access privileges. This is done by uploading PHP shell files and can be done through the two most common methods AFTER they have the admin login:
1) Utilize the built-in theme editor to modify the source coding of your theme (this is what was likely used in your case)
2) Utilize the plugin uploader to upload a fake plugin that actually contains their PHP shells or other malware to increase access privileges for themselves
It looks like your login was compromised, theme editor used to inject malicious coding to the functions.php theme file and to be more specific it was coding for a file uploader so they could use it to gain further access. It looks like an amateur job.
If you don’t have a recent clean backup that you can restore from, then I would recommend contacting a specialist to handle this for you unless you are familiar with hosting environments. After cleaning, you will want to start by hardening your WP environment. By far the best two things would be the following:
– Disable theme editor through wp-config.php
– Implement two-factor authentication for wp-admin
P.S. If you are hosting multiple domains under a single user then they are also probably infected, or will be soon, through cross site contamination.
-
This reply was modified 8 years, 4 months ago by
g0tr00t. Reason: Forgot to mention cross-site contamination