Forum Moderators: phranque
Most robots are missing headers; this one's sending too many. The rest get a 404-- not because those WP files don't exist, although they don't, but because I return a manual 404 to almost all .php requests. (It's the same amount of work for the server as a 403, and conveys no information--or, better yet, conveys false information--to the visitor.)
[edited by: TorontoBoy at 12:37 am (utc) on Mar 14, 2017]
ErrorDocument 404 default
which offers only a minimalist error message. RewriteCond %{THE_REQUEST} /includes
RewriteRule ^includes/ - [R=404]
RewriteCond %{THE_REQUEST} \.php
RewriteRule \.php$ - [R=404]
The second rule may require more detailed conditions if you've really got some URLs in .php. The purpose of the Condition is to pass internal requests for "index.php" and the like, or pages that are rewritten from .html URL to .php content. From what I understand, you return a 404 to 'bots instead of '403s. This might throw them off and I'd like the idea. How do you do this? Can you give me some htaccess code?
If the site has WordPress installed, it will use the Wordpress 404.php file even if you have a custom 404 page and have specified that custom error page before the WP section in the htaccess file.
RewriteCond %{REMOTE_ADDR} !^11\.22\.33\.44
RewriteRule (admin|user) - [R=404]
(no anchors, to allow for all possible options) or, if that's too fuzzy for your taste, RewriteCond %{REMOTE_ADDR} !^11\.22\.33\.44
RewriteRule ^(wp-login|bitrix|admin|user) - [R=404]
with no closing anchor. The REMOTE_ADDR is, of course, your own IP. That's assuming you are not on AOL dialup or something that similarly changes on every request. (Even then, try using just the first three numbers; how many botrunners live at your own ISP?) This, too, has to come before the WP section of htaccess--not because it won't work otherwise, but so the server doesn't have to do the resource-greedy -f test. After all, the whole point is that it doesn't matter if the file exists or not; all that matters is that the malign robot goes away thinking it doesn't exist. Any valid HTTP response status code may be specified, using the syntax [R=305], with a 302 status code being used by default if none is specified. The status code specified need not necessarily be a redirect (3xx) status code. However, if a status code is outside the redirect range (300-399) then the substitution string is dropped entirely, and rewriting is stopped as if the L were used.
SetEnvIf User-Agent "yoozBot" keep_out
order allow,deny
allow from all
deny from env=keep_out I tried this as well a couple of months ago. It did not work, because some of my RewriteConds in the parent are not applicable to the child and cause errors.Those are the rules that should be in the unique htaccess for each site. The global (general) rules should be at base level (htaccess in public_html.)
these vulnerability attempts come from thousands of compromised accounts that keep changing.
(wp-login|bitrix|admin|user)
Alias /wp-activate.php "/var/www/path/to/custom/404.php"
Alias /wp-admin "/var/www/path/to/custom/404.php"
Alias /wp-blog-header.php "/var/www/path/to/custom/404.php"
Alias /wp-check.php "/var/www/path/to/custom/404.php"
Alias /wp-checking.php "/var/www/path/to/custom/404.php"
Alias /wp-config.php "/var/www/path/to/custom/404.php"
i think you can also use an htacces file with ALIAS
Alias Directive
...
Context: server config, virtual host, directory
as I remember unless it was customized, wp-login was one of the standard pluginsOh, my bad if so. I thought wp-login was one of those files that only the site admistrator uses.