Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove .htaccess virus? [closed]

First time posting so bear with me please!

My friend's site has been hacked and the .htaccess file (which I really know nothing about) has been injected with a malicious redirect that forces search engines to the see the site as a "harmful website." If you look at the .htaccess file you can see it's Russian or at least ends in .ru. Seeing as I know very little about this stuff, I simply tried to restore the good .htaccess file back with his host. This doesn't work as the virus just recreates the infected .htaccess file.

When I searched through the rest of his directories, I can see the same bad .htaccess file in most of the folders.

I can't seem to help him get rid of this virus.

like image 615
bleepingcrows Avatar asked Dec 06 '25 10:12

bleepingcrows


1 Answers

  1. change the root password
  2. make sure that root is the owner of .htaccess (that's the default!)
  3. remove write permissions!
like image 108
Nir Alfasi Avatar answered Dec 08 '25 04:12

Nir Alfasi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!