Click to See Complete Forum and Search --> : IP Address Queston...


Jona
11-15-2003, 12:23 PM
Just wondering... Erm... How do you detect if someone is using a proxy IP? How do I get the internal IP? I've seen this done (http://www.lagado.com/proxy-test), perhaps in CGI, but I was wondering if PHP had the ability to. (If it can only be done in CGI, that is fine as well.)

Thanks,
[J]ona

Khalid Ali
11-16-2003, 07:50 AM
Hey Jona,
Interesting question...tryng to break in a system or something...:D

Now here is my take on it.
If you can look beyond my routers firewall in to my internal network and see all my local IP's, that meanseither you have hacked into my firewall or my router is a piece of sh**t equipment...

Any means that allow you to look into internal networks are called hacking...;)

GavinPearce
11-16-2003, 08:49 AM
The way to detect wheter or not the IP is coming through a proxy is just by checking client headers.

The conclusion that the request did not come via a proxy is based on the absense of the Via, Forwarded, X-Forwarded-For and Client-ip headers. It is still possible that a proxy is handling the request without announcing itself in the recommended way.

Like when someone to my site sends an e-mail through the anomous emailer it add their user-id to the header info of the e-mail (x-user) so if I do get any complaints, even though its anomous to the receive I can still track who sent it and stop them from ding it again.

The proxy servers work in the same way by often adding their own tag in the way recommended in certain guidelines for the net.

However of course, they do not have to, and you can easily get silent proxys.


SO basically to detect a proxy all you need to do is scan the normal client info for a Via, Forwarded, X-Forwarded-For or Client-ip tag and you will know the connectin has been via a proxy.

As to writing the script I ain't a clue, can jus understand how it works :)

Jona
11-16-2003, 03:30 PM
lol. I'm not hacking, Khalid. You see, at forum sites (www.gametalk.com to be precise), many people purposely spam and cuss. (Yeah, the creator of the site doesn't do as much work to fix his site as he should--he procrastinates WAY TOO MUCH, and I'm a moderator there, and I don't like dealing with this sort of thing, so I'm trying to get their internal IP's or at least get through their proxies to find their ISP and report abuse.) Whew, okay, Gavvi, I figured that much. ;) I'll see what I can come up with, I suppose. Thanks.

[J]ona

-kde-
11-17-2003, 07:21 AM
I can give you working code, but only on VBscript. Try to convert it to PHP :)


If Request.ServerVariables("HTTP_X_FORWARDED_FOR")<>"" Then
IP_Addr = Split(Request.ServerVariables("HTTP_X_FORWARDED_FOR"))_
(UBound(Split(Request.ServerVariables("HTTP_X_FORWARDED_FOR"))))
Else
IP_Addr = Request.ServerVariables("REMOTE_ADDR")
End If

Jona
11-17-2003, 02:38 PM
I understand ASP and VBScript to an extent, but writing its code is something I'm not all that good at--never really tried or had access to a server with ASP support, so I never learned. Thanks, though, KDE, I'll see if I can find something like that. :)

[J]ona

Jona
11-17-2003, 02:53 PM
Looks like the only thing is this... Maybe PHP can't do it? I'll look for a CGI alternative, then...


<?php
echo("<pre>");
print_r($GLOBALS);
echo("</pre>");
?>


[J]ona