Forum Moderators: phranque

Message Too Old, No Replies

Detecting proxies

anonymous proxies

         

mactac

3:17 am on May 20, 2004 (gmt 0)

10+ Year Member




I am trying to find a method of detecting anonymous proxies (I don't terribly about getting the actual IP address, but it would be nice)

I am aware of the IP environment variables, and they will show transparent proxies or "nice" proxies, but they won't show for anons.

I've heard that it can be done in java, but cannot find the actual methos/sample code. does anyone have this?

Are there any other methods of detecting that the user is using a proxy?

anallawalla

3:22 am on May 21, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Using a proxy versus using an anon proxy can be tricky unless you can make assumptions that the ip address must be within the same C class.

In some cases I test for:

PC's IP: $ENV{'REMOTE_ADDR'}
Real address: $ENV{'HTTP_X_FORWARDED_FOR'}
Proxy: $ENV{'HTTP_VIA'}

I am not sure what has changed out there but for the past two years I haven't seen the last two fields populated but older messages show the following:

PC's IP: ****.xx.69.93
Real address: xxx.xx.69.74
Proxy: 1.1 proxy3.syd.xxxx.net.au:8080 (Squid/2.4.STABLE6)

This doesn't always catch transparent proxies. I would also expect the anonymiser sites to be changing IP addresses regularly.

blaze

3:25 am on May 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Interesting question though - can you use java or javascript to assist in detecting a proxy?

If they are executed on the client side (before the proxy) you might be able to send some kind of information back.

GeorgeGG

3:57 am on May 21, 2004 (gmt 0)

10+ Year Member



Get stuff like this regular:

Date : 05/20/04 20:46:34
Host : cache2-2.ruh.?.net.?
IP :?.138.47.12
HTTP_VIA: 1.0 ADSL2 (NetCache NetApp/5.5R5), 1.0 cache2.ruh
HTTP_X_FORWARDED_FOR:?.116.213.72
HTTP_CLIENT_IP:?.100.193.19

Also if client has JavaScript enabled, usually can pickup
the referrer which can also give other info.

GeorgeGG

anallawalla

4:21 am on May 21, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



How does one test HTTP_CLIENT_IP?

Returns blank for me.

upside

4:25 am on May 21, 2004 (gmt 0)

10+ Year Member



I recently posted in another thread about using a Perl module to detect proxies. See:

[webmasterworld.com...]

GeorgeGG

4:37 am on May 21, 2004 (gmt 0)

10+ Year Member



I use:
$ENV{'HTTP_CLIENT_IP'}

Most all that are set come from one area.

GeorgeGG

blaze

5:32 am on May 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Truly anonymous proxies do not forward such information, which I believe is what the original poster is concerned about.

mactac

1:44 am on May 26, 2004 (gmt 0)

10+ Year Member



any more info on this? Does anyone know how to do this in Java (NOT javascript, which cannot do it)