Getting Ip address of the actual client
am 13.07.2006 12:08:25 von Hariprasad
How can I get IP address of the requested client?
When I am using request.servervariables('remote_addr'), I am getting public
IP, but not the actual client IP.
My application is hosted on public IP 202.63.107.242, and through IP
forwarding it was being redirected to 192.168.100.147. How to get the
requested client's private IP address, if the requestor is within the
organisation (there is a firewall)
Re: Getting Ip address of the actual client
am 13.07.2006 12:40:48 von someone
The network device doing the redirection needs to preserve/forward this
information. If it does not, then obviously there is no way for the server
application to get that information. This is how the anonymous Internet
works.
So, the real question is whether the network device doing the forwarding
preserves this information.
For example, this sample ISAPI Filter code will log the private IP address
*assuming* the network redirecting device forwards that original IP on the
redirected Request.
http://blogs.msdn.com/david.wang/archive/2005/09/28/HOWTO_IS API_Filter_which_Logs_original_Client_IP_for_Load_Balanced_I IS_Servers.aspx
--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Hariprasad" wrote in message
news:0E25A2EA-7DC3-4B01-A78E-2FC96BF88A07@microsoft.com...
> How can I get IP address of the requested client?
>
> When I am using request.servervariables('remote_addr'), I am getting
> public
> IP, but not the actual client IP.
> My application is hosted on public IP 202.63.107.242, and through IP
> forwarding it was being redirected to 192.168.100.147. How to get the
> requested client's private IP address, if the requestor is within the
> organisation (there is a firewall)
Re: Getting Ip address of the actual client
am 13.07.2006 12:47:44 von Daniel Crichton
Hariprasad wrote on Thu, 13 Jul 2006 03:08:25 -0700:
> How can I get IP address of the requested client?
>
> When I am using request.servervariables('remote_addr'), I am getting
> public IP, but not the actual client IP.
> My application is hosted on public IP 202.63.107.242, and through IP
> forwarding it was being redirected to 192.168.100.147. How to get the
> requested client's private IP address, if the requestor is within the
> organisation (there is a firewall)
Look for the following:
HTTP_X_FORWARDED_FOR
HTTP_CLIENT
These will be either a single IP, or a list of IPs separated by commas, if
they are available (many proxies don't include these headers).
Dan
RE: Getting Ip address of the actual client
am 13.07.2006 13:32:01 von Karl Levinson
"Hariprasad" wrote:
> How can I get IP address of the requested client?
I'd avoid posting your real IPs to Usenet newsgroups, just in case.
I'm not sure why you feel you need the internal IPs, that seems like an
unusual need. But if you can't get the internal IPs from the HTTP headers
because they've been stripped, I believe you could probably use client-side
tools like a cookie and/or Javascript to ask the clients to send you that
information with each page request, or with the initial user login form if
there is one. Some web sites use this method to defeat anonymous proxies.
Of course, clients can disable and inhibit those responses, but you could
prevent those clients from connecting if you wanted to.
Unless those internal IPs are static IPs, which they usually aren't,
tracking the internal IP seems of limited use, if you're trying to track who
is connecting, all the way down to the individual user. If you have a
temporary DHCP IP address with a lease of 30 days, your machine starts trying
to get a new one at 15 days, and that means that in half that time, in 7
days, your logs have a 50% chance of no longer having the correct IP address.
The new IP will probably be in the same subnet, so you'll still know the
general location.
--
kind regards,
Karl Levinson, CISSP, CCSA, MCSE [MS MVP]
-------------------------
Microsoft Security FAQ:
http://www.securityadmin.info