I have a blog on wordpress and is hosted on godaddy. I continously getting few of the core wordpress files changed automatically. My blog project is on git so I can figure it out easily and reset the git commit version. Even I can see few new .ico files are added. I am really frustrated out of it. The google ads and google adverts are getting blocked due to these files. How can I get rid of this auto change of files. I have tried wordfence plugin but it did not stop files being edited but can send me notifications.

  • what is the path of these files ? – mmm May 1 at 6:58
  • What is the content of these files? – Mat May 1 at 11:06
  • Files which get usually changed are: prnt.sc/jcppg9 – Umar May 2 at 10:52
  • # . modified: index.php # modified: wp_files/index.php # modified: wp_files/wp-settings.php – Umar May 3 at 5:36
  • What are the git diffs? Your question has way to few information to try to answer it. Please update by adding git-diff / files infected – Clemens Tolboom May 5 at 13:00

It's really hard to give you a 100% solid answer, because there is not much info in your question, but... Let me do some educated guesses...

The files that are mentioned in your question are very often used by attackers to put some malware code. Why? Almost all WP sites have these files. Most of sites don't block access to these files, so after infecting them it's easy to run malware code on the server.

Why does it happen over and over again?

If it is really an infection, then it's pretty clear why does it come back. I assume that you get original files from GIT and put them on server. It solves the problem. At least the visible part of it - files are original again.

But... The cause of the problem is still on the site/server. If anyone was able to modify these files, then replacing them with original ones won't block that possibility. Most probably there is some backdoor placed on your site, or some hidden admin account or one of your plugins/themes is vulnerable...

Why Wordfence doesn't protect my site?

Because it is impossible for plugin to protect site that is already infected. Wordfence is just a plugin. If attacker is able to modify WP core files, then he can do whatever he wants with your site (he can disable plugins, change their behavior and so on; few years ago I've shown how easy it is to infect site with only few lines of code and make Wordfence to show "You are secure, you are secure" in it's log).

So what should I do now?

  1. Take a look at these modified files and check what are the changes.
  2. If the site is infected, you'll have to remove all infected files, backdoors, hidden users. Then check for vulnerabilities in plugins/themes you're using on that site and repair all of them. At the end you should harden your site properly (and get rid of Wordfence, since it doesn't do much, to be honest).
  • any method to check the hidden users or backdoors entries? – Umar Oct 11 at 10:36

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.