dimaslanjaka

Disable proxy

Oct 1st, 2017
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.41 KB | None | 0 0
  1. <?php //insert into <head></head>
  2. if(@fsockopen($_SERVER['REMOTE_ADDR'], 80, $errstr, $errno, 1))
  3. die("It would apprear you're using a proxy, so please, go fuck yourself!");
  4.  
  5. function checkProxy($ip){
  6.         $contactEmail="EMAIL";
  7.         $timeout=3;
  8.         $banOnProability=0.99;
  9.        
  10.         $ch = curl_init();
  11.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  12.         curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
  13.         curl_setopt($ch, CURLOPT_URL, "http://check.getipintel.net/check.php?ip=$ip");
  14.         $response=curl_exec($ch);
  15.        
  16.         curl_close($ch);
  17.        
  18.        
  19.         if ($response > $banOnProability) {
  20.                 return true;
  21.         } else {
  22.             if ($response < 0 || strcmp($response, "") == 0 ) {
  23.                 //The server returned an error, you might want to do something
  24.                 //like write to a log file or email yourself
  25.                 //This could be true due to an invalid input or you've exceeded
  26.                 //the number of allowed queries. Figure out why this is happening
  27.                 //because you aren't protected by the system anymore
  28.                 //Leaving this section blank is dangerous because you assume
  29.                 //that you're still protected, which is incorrect
  30.                 //and you might think GetIPIntel isn't accurate anymore
  31.                 //which is also incorrect.
  32.                 //failure to implement error handling is bad for the both of us
  33.             }
  34.                 return false;
  35.         }
  36. }
  37. $ip=$_SERVER['REMOTE_ADDR'];
  38. if (checkProxy($ip)) {
  39.     echo "It would apprear you're using a proxy, so please, go fuck yourself! <br />";
  40. }
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment