PHP proxy redirect script?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Klen
    • Aug 2006
    • 32235

    #1

    PHP proxy redirect script?

    Anyone have script which you can use to mass include to several sites with purpose to redirect proxy traffic somewhere else.
  • AdultKing
    Raise Your Weapon
    • Jun 2003
    • 15601

    #2
    Use iptables redirect.

    Comment

    • u-Bob
      there's no $$$ in porn
      • Jul 2005
      • 33063

      #3
      Originally posted by AdultKing
      Use iptables redirect.
      then he'll have to know the IPs of the proxies....

      Comment

      • AdultKing
        Raise Your Weapon
        • Jun 2003
        • 15601

        #4
        http://www.maxmind.com/app/geoip_country

        Comment

        • fris
          Too lazy to set a custom title
          • Aug 2002
          • 55679

          #5
          Originally posted by KlenTelaris
          Anyone have script which you can use to mass include to several sites with purpose to redirect proxy traffic somewhere else.
          you can check for the proxy header.
          Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

          Comment

          • GrouchyAdmin
            Now choke yourself!
            • Apr 2006
            • 12085

            #6
            Originally posted by fris
            you can check for the proxy header.
            ...and you can run a wordpress platform, but that doesn't mean it's gonna work out, either.

            (See what I did there? Custom response, just for you, buddy.)

            Comment

            • Klen
              • Aug 2006
              • 32235

              #7
              I got perl script with solution,but i need php version.
              PHP Code:
               if (
              
                           $ENV{HTTP_X_FORWARDED_FOR} ||
              
                     $ENV{HTTP_VIA} ||
              
                 $ENV{HTTP_CACHE_CONTROL} ||
              
                        $ENV{HTTP_PROXY_CONNECTION}
              
                 ) {
              
                  print "<script>document.location = 'http://';</script >";
              
               #proxy traff
              
               } else {
                    print "<script>document.location = 'http://';</script >"; 
              

              Comment

              • fris
                Too lazy to set a custom title
                • Aug 2002
                • 55679

                #8
                Originally posted by GrouchyAdmin
                ...and you can run a wordpress platform, but that doesn't mean it's gonna work out, either.

                (See what I did there? Custom response, just for you, buddy.)
                so much hate for everything.

                why dont you give us some input on what you would do since you are so advanced in the developing field.

                if all you do is give negative feedback, why bother.
                Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

                Comment

                • Klen
                  • Aug 2006
                  • 32235

                  #9
                  Found another here:
                  http://www.phpbuddy.com/article.php?id=22
                  but not sure does it work since it's kind a tricky to test it.

                  Comment

                  • fris
                    Too lazy to set a custom title
                    • Aug 2002
                    • 55679

                    #10
                    Originally posted by KlenTelaris
                    Found another here:
                    http://www.phpbuddy.com/article.php?id=22
                    but not sure does it work since it's kind a tricky to test it.
                    Code:
                    <?php
                    
                    $test = new proxyCheck();
                    $test->serverVar = $_SERVER;
                    $header = $test->checkHeader();
                    
                    class proxyCheck {
                    	  
                    	  var $serverVar = array();
                    	  
                    	  private $proxyHeader = array();
                    	  
                    		function checkHeader() {
                    			
                    			  if(isset($this->serverVar['HTTP_X_FORWARDED_FOR'])) {
                    			  		$this->proxyHeader['HTTP_X_FORWARDED_FOR'] = $this->serverVar['HTTP_X_FORWARDED_FOR'];
                    			  }
                    			  
                    	  	  if(isset($this->serverVar['HTTP_X_FORWARDED'])) {
                    	  			  $this->proxyHeader['HTTP_X_FORWARDED'] = $this->serverVar['HTTP_X_FORWARDED'];
                    			  }
                    			  
                    			  if(isset($this->serverVar['HTTP_FORWARDED'])) {
                    	  			  $this->proxyHeader['HTTP_FORWARDED'] = $this->serverVar['HTTP_FORWARDED'];
                    			  }
                    			  
                    			  if(isset($this->serverVar['HTTP_PROXY_AGENT'])) {
                    	  			  $this->proxyHeader['HTTP_PROXY_AGENT'] = $this->serverVar['HTTP_PROXY_AGENT'];
                    			  }
                    			  
                    			  if(isset($this->serverVar['HTTP_VIA'])) {
                    	  			  $this->proxyHeader['HTTP_VIA'] = $this->serverVar['HTTP_VIA'];
                    			  }
                    			  
                    			  if(isset($this->serverVar['HTTP_PROXY_CONNECTION'])) {
                    	  			  $this->proxyHeader['HTTP_PROXY_CONNECTION'] = $this->serverVar['HTTP_PROXY_CONNECTION'];
                    			  }
                    			  
                    			  if(isset($this->serverVar['HTTP_CLIENT_IP'])) {
                    	  			  $this->proxyHeader['HTTP_CLIENT_IP'] = $this->serverVar['HTTP_CLIENT_IP'];
                    			  }
                    			  
                    			  return $this->proxyHeader;
                    		}
                    		
                    		
                    }
                    
                    ?>
                    not sure if this is what you are after.
                    Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

                    Comment

                    • Klen
                      • Aug 2006
                      • 32235

                      #11
                      Originally posted by fris
                      Code:
                      <?php
                      
                      $test = new proxyCheck();
                      $test->serverVar = $_SERVER;
                      $header = $test->checkHeader();
                      
                      class proxyCheck {
                      	  
                      	  var $serverVar = array();
                      	  
                      	  private $proxyHeader = array();
                      	  
                      		function checkHeader() {
                      			
                      			  if(isset($this->serverVar['HTTP_X_FORWARDED_FOR'])) {
                      			  		$this->proxyHeader['HTTP_X_FORWARDED_FOR'] = $this->serverVar['HTTP_X_FORWARDED_FOR'];
                      			  }
                      			  
                      	  	  if(isset($this->serverVar['HTTP_X_FORWARDED'])) {
                      	  			  $this->proxyHeader['HTTP_X_FORWARDED'] = $this->serverVar['HTTP_X_FORWARDED'];
                      			  }
                      			  
                      			  if(isset($this->serverVar['HTTP_FORWARDED'])) {
                      	  			  $this->proxyHeader['HTTP_FORWARDED'] = $this->serverVar['HTTP_FORWARDED'];
                      			  }
                      			  
                      			  if(isset($this->serverVar['HTTP_PROXY_AGENT'])) {
                      	  			  $this->proxyHeader['HTTP_PROXY_AGENT'] = $this->serverVar['HTTP_PROXY_AGENT'];
                      			  }
                      			  
                      			  if(isset($this->serverVar['HTTP_VIA'])) {
                      	  			  $this->proxyHeader['HTTP_VIA'] = $this->serverVar['HTTP_VIA'];
                      			  }
                      			  
                      			  if(isset($this->serverVar['HTTP_PROXY_CONNECTION'])) {
                      	  			  $this->proxyHeader['HTTP_PROXY_CONNECTION'] = $this->serverVar['HTTP_PROXY_CONNECTION'];
                      			  }
                      			  
                      			  if(isset($this->serverVar['HTTP_CLIENT_IP'])) {
                      	  			  $this->proxyHeader['HTTP_CLIENT_IP'] = $this->serverVar['HTTP_CLIENT_IP'];
                      			  }
                      			  
                      			  return $this->proxyHeader;
                      		}
                      		
                      		
                      }
                      
                      ?>
                      not sure if this is what you are after.
                      Welll there are several types of proxys,what is considered proxy here it's non-anonymous alias transparent proxy where you can see both real and proxy ip.I find it weird why this kind of proxy ip's still exits since all web proxy sites are anonymous proxies,plus even if someone using classing proxies it's very easy to find anonymous proxies.I guess only bot things uses this kind of proxy therefore it need to be banned from traffic pool.

                      Comment

                      • Klen
                        • Aug 2006
                        • 32235

                        #12
                        So basically script need to detect and redirect such traffic to desired url.Most of trade scripts can do it,but it's faster to add code into site wide include.

                        Comment

                        Working...