irwan

Anonymous Proxy check

Nov 15th, 2011
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.07 KB | None | 0 0
  1. function IsProxy($IP)
  2. {
  3.         $Result = FALSE;//Innocent until proven Guilty
  4.  
  5.         $BlackList = array(     'http.dnsbl.sorbs.net',
  6.                                         'misc.dnsbl.sorbs.net',
  7.                                         'socks.dnsbl.sorbs.net',
  8.                                         'proxies.blackholes.easynet.nl',
  9.                                         'list.dsbl.org'
  10.                                  );
  11.  
  12.         if (preg_match("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", $IP, $Matches))
  13.          {
  14.                 foreach ($BlackList as $Server)
  15.                 {
  16.                         echo $Server;
  17.                         $ServerHost = $Matches[4] . "." . $Matches[3] . "." . $Matches[2] . "." . $Matches[1] . "." . $Server;
  18.                         $Resolved = gethostbyname($ServerHost);
  19.                         if ($Resolved != $ServerHost)
  20.                         {
  21.                                 $Result = TRUE;//GUILTY!
  22.                                 break;
  23.                         }
  24.                 }
  25.          }
  26.         return $Result;
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment