Forum Moderators: open
spam trapper caught one tonight, but in checking the hit logs i get a sequence like this:
65.34.106.94 - 6534106hfc94.tampabay.rr.com - [22:43 04/14/03] - Mozilla/5.0 (Macintosh; U; PPC Mac OS X;
en-us) AppleWebKit/73 (KHTML, like Gecko) Safari/73 -
65.34.106.94 - 6534106hfc94.tampabay.rr.com - [22:43 04/14/03] - -
65.34.106.94 - 6534106hfc94.tampabay.rr.com - [22:44 04/14/03] - Mozilla/5.0
(Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/73 (KHTML, like Gecko) Safari/73
basically, it seems that it did a non-ua, then my trapper banned him, then he showed up here in my 403 log with the UA listed, then another no UA, then again with a UA.
is this a common thing for that macintosh browser to do?
is this a common thing for that macintosh browser to do?
Requests for favicon.ico by Apple Safari are usually sent with an empty HTTP_USER_AGENT string. I suggest that you exclude requests for .ico files from being banned when the HTTP_USER_AGENT string is empty. My description of what to do is a double negative but I think you get the picture. If this is not clear, let me know.
I don't ban requests with an empty HTTP_USER_AGENT string. I transparently redirect them to a quasi home page that has no links and no E-Mail addresses. If the request is for robots.txt or favicon.ico, I let them GET the requested file.
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^-?$ [OR] #no user agent
(other limiters i have in this space)
RewriteRule !^(.*)403\.shtml - [C]
RewriteRule !^(.*)404*\.shtml - [C]
RewriteRule !^(.*)trap\.cgi - [C]
RewriteRule !^(.*)spit\.cgi - [C]
RewriteRule !^(.*)robots\.txt - [C]
RewriteRule (.*) [my-cgi-bin...] [L]
would adding the following above the 403 line above fix the situation at hand?
RewriteRule !^(.*)\.ico - [C]
would adding the following above the 403 line above fix the situation at hand?
RewriteRule !^(.*)\.ico - [C]
Yes, you should be able to add that line anywhere in your [C] RewriteRule chain. I just use rewrite conditions:
# enable Apache mod_rewrite
RewriteEngine on
# redirect requests with empty User Agent string
# to quasi home page
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteCond %{REQUEST_URI} !^.*robots\.txt$
RewriteCond %{REQUEST_URI} !^.*\.ico$
RewriteRule ^.*$ /path/to/badrobot.html [L]