Jump to content

Detect proxy (couldn't find it)


Tasc0

Recommended Posts

Hi, well.. I've used this site a lot thanks to Google but now I'd like to do something in a web site but I can't find it or eiter understand it very well.
My question is: Can I detect if a user from a web site is using a proxy and if he is, don't let him enter the site?

I've found some stuff about it but I can't understand it very well. Here they are:
/http://www.phpbuddy.com/article.php?id=22
/http://joot.com/dave/writings/articles/php-examples.shtml

I'd aprecciate any reply.
Thanks in advance.
Link to comment
https://forums.phpfreaks.com/topic/29412-detect-proxy-couldnt-find-it/
Share on other sites

[quote author=mainewoods link=topic=117312.msg478868#msg478868 date=1165283948]
aol users are all proxied

--try printing out headers recieved from proxy sites and non proxy sites
[code]print_r($_SERVER);[/code]
--if there is anything you can use, it would be there
[/quote]
I have this in a file:
[code]
<?
print_r($_SERVER);
?>[/code]
And this is what I get on my browser:
print_r($_SERVER);ER); ?>

Is that what you meant?
no that should be printing out a bunch of variables like host, referer, user-agent, ect.  try full php tags
[code]<?php
?>[/code]
once you get that printing out the variables then you will have to call that page directly and then call the page through various proxies as you can and look for some telltale variables.
Those $_SERVER variables contain everything sent in the headers of the request for the page.  If you can detect a proxy, it would be using one of those variables(looking for a value of or the presence of one of them). 

That's all you got, there ain't nothing else that you can use.
  • 4 weeks later...
Hi, I'm back.
I found this script that shows the IP adress even if the users is navigating with a proxy. Doesn't work with elite proxies.
I'd like to know if I can show the user the proxy IP.
[code]<?php

function getIP() {
    if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
      $ips = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } 
    elseif (isset($_SERVER['HTTP_VIA'])) {
      $ips = $_SERVER['HTTP_VIA'];
    } 
    elseif (isset($_SERVER['REMOTE_ADDR'])) {
      $ips = $_SERVER['REMOTE_ADDR'];
    }
    else { 
      $ips = "unknown";
    }
   
    echo "Your IP is: $ips";

}

if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
      $ip1 = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } 
    elseif (isset($_SERVER['HTTP_VIA'])) {
      $ip1 = $_SERVER['HTTP_VIA'];
    } 
    elseif (isset($_SERVER['REMOTE_ADDR'])) {
      $ip1 = $_SERVER['REMOTE_ADDR'];
    }
    else { 
      $ip1 = "unknown";
    }

getIP();
?>[/code]
Thanks in advance.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.