Forum Moderators: open
70.16.148.** - - [28/Jun/2006:16:32:53 -0400] "GET /webpage.html HTTP/1.1" 200 9729 "http://www.mydomain.com" "-"
How does one combat this?
RewriteCond %{HTTP_USER_AGENT} ^-?$ [NC,OR]
Though there could be a better way, but it works for me.
There's also this thread:
[webmasterworld.com...]
never got Jim's example to work for me though :(
Small sampling:
66.148.68.x 2uigq2oecesvv2nwso rwiakBsBue Bobgw2nuB
202.125.44.x efeSthqvkr11ticgo1iovjjrdwakbbd
66.148.68.x emwx4cxnd pedafhfpac
66.148.68.x ymdexin7xpebtulwnxew
202.125.44.x pepgfu wjdjqrxckulhwiflmrdsmkc mjvldn
84.180.94.x mairwthe Ifirpl8tiwotwyi lsu
84.180.94.x r9Hreiynmkxmpjh ioHmmknpdmid
66.148.68.x ewoqaohlcegoD emkdywx
66.148.68.x obtDrqhxogxsewDfcDktb
209.190.21.x bedmdFjkFhc4a noFjajakffieapvngdtpwxk
209.190.21.x gdouk6Ss6nnykg66hvojc6txjsecuu
209.190.21.x aphErvbtijj vulgctlslo
209.190.21.x jgbhwntsdlprxcwogijI8orrw b8
209.190.21.x DrbspcgyubxrpeikfiihxD mh
209.190.21.x jvAhnviAjwwud8gymvewtcqhehgbAcytyqdxq
209.190.21.x cvwkvl6kfujhqlujqblFl dffrepmrxdspmdFjq
I'd like to see that rewrite rule ;)
I'd like to see that rewrite rule wink
Course it's not one however it may be reduced to three lines.
However, from my own point of view (and with frequent visitors from Ohio and Columbus interested in my pages), the fourth line a bit too extreme (even for me!)
deny from 202.
deny from 84.
RewriteCond %{REMOTE_ADDR} ^66\.148\.(6[4-9]¦[7-9][0-9]¦1[01][0-9]¦12[0-7])\. [OR]
RewriteCond %{REMOTE_ADDR} ^209\.190\.([0-9]¦[1-9][0-9]¦1[01][0-9]¦12[0-7])\. [OR]
RewriteCond %{HTTP_USER_AGENT} ^$ [OR]
80 HEAD requests from an AOL IP address were blocked because of blank UA, but I think a lot of bad guys get an AOL account to do their mischief believing that we won't block them for fear of loosing legit hits from AOL users.
So - I am wondering about the downside about blocking blank UA. Any opinions?
I get random UA's from all over the place so blocking by IP won't fly as you can't block comcast, roadrunner, AOL, etc.
Just tossed it in for amusement factor because there is no rewrite rule for that, it was a trick problem :)
Pointing out why I do opt-in rules, not opt-out rules, as opt-in rules trap the random UAs, blank UAs, and everything else you've never seen before.
[edited by: incrediBILL at 8:48 pm (utc) on June 29, 2006]
RoadRunner only has a few ranges which seem to cluster all the "pests" together.
AOL is somebody on their own planet. Their cache requests are for the most part Mozilla and version number in the UA, however the Blank UA is frequently used for their HEAD requests.
The majority of my own pages are no cache in the meta tags and I see no reason to give any bot the chance to deviate from what I desire.
As a result I've been using the BLANK UA method (bob) provided since (I don't know when, long time.)
Don
However, since there are two other code-related problems posted here, I'll just toss these out:
For blank referrer and UA:
# BLOCK blank referer -AND- UA (except for HEAD and favicon requests
RewriteCond %{REQUEST_METHOD} !^HEAD$
RewriteCond %{HTTP_REFERER}<>%{HTTP_USER_AGENT} ^<>$
RewriteRule !\.ico$ - [F]
# Block random-letter. non-Mozilla user-agents
RewriteCond %{HTTP_USER_AGENT} !^Mozilla
# 15 or more chars with no "/.{};" characters
RewriteCond %{HTTP_USER_AGENT} ^[a-z0-9\ ]{15,}$ [NC]
# no vowels after 5 characters
RewriteCond %{HTTP_USER_AGENT} [b-df-hj-np-tvwxz]{5,} [NC]
RewriteRule .* - [F]
Jim
I first saw something similar with my main site, and I knew the pages hit were not accessible from the main URL. So I added these and the bad guys were 403-goners:
# Stop fake referers (note carat placement)
SetEnvIfNoCase Referer "^example.com" no_way
SetEnvIfNoCase Referer "^www.example.com" no_way
# Stop misconfigured URLs -> errors (note dot before slash)
SetEnvIfNoCase Referer "^http://example.com./" no_way
SetEnvIfNoCase Referer "^http://www.example.com./" no_way
Alas, I can't get either of the next variations to work for my little triplet to be complete. The difference between the two sets is the last slash:
SetEnvIfNoCase Referer "^http://example.com/:80" no_way
SetEnvIfNoCase Referer "^http://www.example.com/:80" no_way
SetEnvIfNoCase Referer "^http://example.com/:80/" no_way
SetEnvIfNoCase Referer "^http://www.example.com/:80/" no_way
I know this isn't the Apache forum but does anybody see where I'm goofing up with either set? TIA for telling me!
But if I have the code to solve a simple problem that's posted, then I'll post it without trying to convert folks to my preferred overall implementation. Besides, that would be one extremely long post...
Those random-user-agent guys used to really bug me on a site that -due to its readership- needed to be very 'open', making a whitelist too large and cumbersome. So, after analyzing their 'so-called random' UAs, I found that simple solution.
---
Having diverted Keyplayer's thread far enough, the only thing I can suggest for now is Key_master's and AlexK's bad-bot scripts (posted in the WebmasterWorld PERL and PHP libraries, respectively). Either of those would likely have stopped the downloader after a few pages.
Jim
Another thing: instead of a `RewriteRule .* - [F]`, a silent rewrite to a valid alternate page with some short broken content would give "them" a nice '200' and the feeling that their scipts work fine and everything seems OK, instead of a harsh '403' return code, which would make "them" aware that we are aware of them -- but I see no need to tell them.
Kind regards,
R.
On XP, it's at C:\Program Files\Windows NT\hypertrm.exe
You connect using your IP address, on port 80 (typically), and using TCP/IP (Winsock) as set up under Files->Properties in HyperTerm.
Example:
Host: www.example.com <Enter>
User-agent: <Whatever you want to test, as long as it's valid><Enter>
HEAD /page_name.html HTTP/1.1<Enter,Enter>
Using HyperTerm is primitive, and it's not the easiest tool to use, but it lets you send *any* request you like.
Jim
I get random UA's from all over the place so blocking by IP won't fly as you can't block comcast, roadrunner, AOL, etc.Just tossed it in for amusement factor because there is no rewrite rule for that, it was a trick problem :)
Wiz