Blocking Proxy IP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Blocking Proxy IP

    Hello, I need a code that can block proxy server from accessing my WAP site.
    I use this code:
    Code:
    if ($_SERVER['HTTP_X_FORWARDED_FOR']
       || $_SERVER['HTTP_X_FORWARDED']
       || $_SERVER['HTTP_FORWARDED_FOR']
       || $_SERVER['HTTP_CLIENT_IP']
       || $_SERVER['HTTP_VIA']
       || in_array($_SERVER['REMOTE_PORT'], array(8080,80,6588,8000,3128,553,554))
       || @fsockopen($_SERVER['REMOTE_ADDR'], 80, $errno, $errstr, 30))
    {
        exit('Proxy detected');
    }
    but doesn't working. Anyone have working script please post here. Thanks.
    Wait...
    sigpic

    #2
    try getenv instead of server maybe it will work

    if (getenv("HTTP_X_FORWARDED_FOR"))
    {
    proxy is detected
    }

    Comment


      #3
      PHP Code:
      <?
      IF(ISSET($_SERVER['HTTP_X_FORWARDED_FOR']) || ($_SERVER['HTTP_USER_AGENT']=='') || ($_SERVER['HTTP_VIA']!='')){
              DIE("Proxy servers not allowed.");
      }
       
      $proxy_headers = ARRAY(   
           'HTTP_VIA',   
           'HTTP_X_FORWARDED_FOR',   
           'HTTP_FORWARDED_FOR',   
           'HTTP_X_FORWARDED',   
           'HTTP_FORWARDED',   
           'HTTP_CLIENT_IP',   
           'HTTP_FORWARDED_FOR_IP',   
           'VIA',   
           'X_FORWARDED_FOR',   
           'FORWARDED_FOR',   
           'X_FORWARDED',   
           'FORWARDED',   
           'CLIENT_IP',   
           'FORWARDED_FOR_IP',   
           'HTTP_PROXY_CONNECTION'   
              );
      FOREACH($proxy_headers AS $x){
           IF (ISSET($_SERVER[$x])) DIE("You are using a proxy.");
              EXIT;
      }
      ?>
      Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
      Visit: WapMasterz Coming Back Soon!
      _______
      SCRIPTS FOR SALE BY SUBZERO
      Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
      FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
      _______
      Info & Tips
      php.net
      w3schools.com

      Comment


        #4
        anyone tried this? If it dnt work, change the $_SERVER[$x] bit to getenv($x)

        Comment


          #5
          Originally posted by Anshul View Post
          try getenv instead of server maybe it will work

          if (getenv("HTTP_X_FORWARDED_FOR"))
          {
          proxy is detected
          }
          No no no! Not working!!!
          I created a file named proxy.php like this
          PHP Code:
          <?
          if(getenv("HTTP_X_FORWARDED_FOR"))
          {
          print "proxy is detected";
          }else
          print "no proxy";
          ?>
          in my general opera pc browser it outputs
          Code:
          no proxy
          when I use a proxy it also outputs the same.
          Peoxy I used: ▶ ShadowSurf Free Anonymous Proxy
          ===============
          Now tell me my errors.
          Wait...
          sigpic

          Comment

          Working...
          X