Anonymous Proxy check
9
This routine checks a client's IP address against a few open lists of blacklisted IP addresses, returns TRUE if the ip is a known proxy.
//----------------------------------------------------------------
//IsProxy FUNCTION
//----------------------------------------------------------------
// What it does -
// Checks against public lists of blacklisted
// proxy addresses to make sure that $IP isn't one of
// them.
//
// Changes -
// [2006/12/07] - RaX :: Created.
//----------------------------------------------------------------
function IsProxy($IP)
{
$Result = FALSE;//Innocent until proven Guilty
$BlackList = array( 'http.dnsbl.sorbs.net',
'misc.dnsbl.sorbs.net',
'socks.dnsbl.sorbs.net',
'proxies.blackholes.easynet.nl',
'list.dsbl.org'
);
if (preg_match("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", $IP, $Matches))
{
foreach ($BlackList as $Server)
{
echo $Server;
$ServerHost = $Matches[4] . "." . $Matches[3] . "." . $Matches[2] . "." . $Matches[1] . "." . $Server;
$Resolved = gethostbyname($ServerHost);
if ($Resolved != $ServerHost)
{
$Result = TRUE;//GUILTY!
break;
}
}
}
return $Result;
}
//-----------------------------------------------------------------





The dot matches any character one time. So it could be an actual dot, or a number, or anything else. Try this instead.
"/([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/"