Thanks for the responses. Seems I'm not the only one affected. I put together some quick code to watch for this.
It checks to see if the country is DE (via geoip), if the search string is 'proxy list' and if the referring host is bing. This in theory will stop all false positives.
Here's the code:
Code:
<?php
function seQueryString($url = false) {
if(!$url) {
$url = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : false;
}
if($url == false) {
return '';
}
$parts = parse_url($url);
parse_str($parts['query'], $query);
$search_engines = array(
'bing' => 'q',
'google' => 'q',
'yahoo' => 'p'
);
preg_match('/(' . implode('|', array_keys($search_engines)) . ')\./', $parts['host'], $matches);
return isset($matches[1]) && isset($query[$search_engines[$matches[1]]]) ? $query[$search_engines[$matches[1]]] : '';
}
include_once('geoip.inc');
$gi = geoip_open('GeoIP.dat',GEOIP_STANDARD);
$country = geoip_country_name_by_addr($gi, $_SERVER["REMOTE_ADDR"]);
$url = parse_url($_SERVER['HTTP_REFERER']);
if ($country == "Denmark" && seQueryString() == "proxy list" && $url['host'] == "www.bing.com") {
echo "Detected invalid usage. If you have an issue with this please email webmaster at yourdomain dot net. Thanks!";
//error_log("A custom error has been triggered",1,"your@email.net","From: webmaster@yoursite.net");
die();
}
What I do then is add this to the very top of includes/functions.php after the <?php tag
Code:
include('searchtest.php');
searchtest.php is the file name of the code posted above.
Be sure to have geoip.inc and GeoIP.Dat in the includes/ folder
I did run into an issue with the /feed/index.php file would error out because it couldn't find the geoip files.
What I did to fix this (kind of a hack) is create symlinks from /feed/geoip.inc to ../includes/geoip.inc and /feed/GeoIP.dat to ../includes/GeoIP.dat and it seemed to resolve the issue.
Not the prettiest of resolutions but it works, and should be modifiable enough to suit your needs and not generate any false positives.
Hope this helps.
Thanks,
-nux
Bookmarks