Forum Moderators: Robert Charlton & goodroi
The other site is apparently an attack site (says firefox) and has popups for about 5 more attack sites.
I get maybe 500 of these everyday
66.249.**.** - - [21/Jun/2009:09:02:26 -0400] "GET /cgi-bin/script.cgi?u=http://othersite/?q=Bad+Adult+Words HTTP/1.1" 302 - "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
The /cgi-bin/script.cgi is a script I use for tracking clicks on links and I definitely do not have any links for this site. I can't even find any info about it on google.
The other site is a .co.cc and has illegal adult content for sale on it.
For now all I know to do is just block this googlebot IP and hope it doesn't ruin my serp like it did last week when I accidentally blocked it because my GeoIP script said the IP was from Vietnam.
[edited by: tedster at 1:52 am (utc) on June 28, 2009]
[edit reason] obscure the specifics [/edit]
Possible solution:
#Turn on RewriteEngine (Unless previously open)
RewriteEngine on
#Deny Access from GoogleBot when Refer for "othersite" and refer contains badwords
RewriteCond %{REMOTE_ADDR} ^66\.249\.
RewriteCond %{HTTP_REFERER} othersite
RewriteCond %{HTTP_REFERER} (Bad¦Adult¦Words)
RewriteRule .* - [F]
Please note; Forum breaks pipe characters and they require correction prior to use.
Somehow googlebot is placing url's not found on my site in my script and redirecting to those sites.
The problem is that there is no referring url. The hits come in with no referrer, cookies are disabled for it and I can't figure out how to block these clicks to sites I do not link to.
#Turn on RewriteEngine (Unless previously open)
RewriteEngine on
#Deny Access from GoogleBot when Refer for "othersite" and refer contains badwords
RewriteCond %{REMOTE_ADDR} ^66\.249\.
RewriteCond %{REQUEST_uri} othersite
RewriteCond %{REQUEST_uri} (Bad¦Adult¦Words)
RewriteRule .* - [F]
Please note; Forum breaks pipe characters and they require correction prior to use.
If you don't mind if the search engines don't follow the links that use this script, you could always block the script in your robots.txt file. This wouldn't stop all of the attacks on the script, though.
The obvious immediate solution is to rename something so the script cannot be abused. It WILL be found again if you do not add other protection to it soon - insistence on a correct referer (ie your site/page) is an obvious one but perhaps better would be an additional header code in the calling script, preferably one that changes every usage in some way that the redirect script could verify.
Also, check to see if the visitor is a real browser and if not terminate the page with a suitable message (eg 403 go away).
It tracks all the redirects and clicks going thru the script and they're all just going to one domain so I blocked that domain like Wilderness suggested and it works.
RewriteCond %{QUERY_STRING} ^u=http://othersite
RewriteCond %{REQUEST_URI} !^/403forbidden\.php$
RewriteRule .* - [F]
The way I see it, even though my script is being exploited by redirecting to this bad site that google is also being exploited too since these "attacks" are coming directly from google and they continue to allow it to happen.
One of the most important security lessons is to check input in terms of exactly what you expect it to be, rather than by excluding a small set of bad patterns. You'll never catch all of those bad patterns, so you have to be as restrictive as possible about what you'll allow your script to redirect to.