Help with htaccess security and multisite
-
Hi,
I’m hoping I can get some help on getting a htaccess directive to work with multisite. I’m not very experienced with the multi-site setup.
My sites have been hacked and I’ve cleaned up most and on my single sites I’ve stopped repeated hacks by using:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]in the htaccess file.
The problem is I have one multi site set up which I set up to experiment with and when I use this directive the sites go down and I get 500 error.
Any ideas what may be causing this?
I’m fairly sure that the hack is automated in some way and I’m not sure the access is coming via WordPress. I think it’s coming through the server. I clean up all the infected files – index files, config files and settings files and at approx 8.00pm each day all the files are reinfected and occasionally some plugin files get infected.
I’ve stopped the single files getting infected with the above directives but the multi site still gets infected each evening.
Once I can stop the sites getting infected I can then go through my logs and find out how the infection is getting through. I don’t see anything suspicious with wordpress logs which suggests that it is outside wordpresss. However they are getting in they cannot change the permissions of files. When I was first made aware of the hack (it’s just a redirection hack so when new visitors come to the site they get redirected to stuff like mobile phones sales) I set config and index to 600 and that’s when it started to infect settings.
I’m not sure they have full access to the server as I have it set up on 2 workspaces (Plesk) and only the sites on 1 workspace were being infected, the other workspace was clean.
If I can set up the above htacces directive on the multi-site and close down the injections then I can concentrate on finding the cause.
Thanks for any help.
The topic ‘Help with htaccess security and multisite’ is closed to new replies.