|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Getting Ip address of the actual clientHow 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) 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_ISAPI_Filter_which_Logs_original_Client_IP_for_Load_Balanced_IIS_Servers.aspx -- Show quoteHide quote//David IIS http://blogs.msdn.com/David.Wang This posting is provided "AS IS" with no warranties, and confers no rights. // "Hariprasad" <Haripra***@discussions.microsoft.com> 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) Hariprasad wrote on Thu, 13 Jul 2006 03:08:25 -0700:
> How can I get IP address of the requested client? Look for the following:> > 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) 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 "Hariprasad" wrote: I'd avoid posting your real IPs to Usenet newsgroups, just in case.> How can I get IP address of the requested client? 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
Supressing Public ASP Error Codes
AD & ADAM together in harmony IIS passing server credentials rather than user credentials Flaw in default permissions Web Server Type Secure SFTP Server Basic Authentication for only one special user Exception from HRESULT: 0x800A0046 Credentials not passed on when using ASP.NET SelfSSL and multiple sites in IIS6? |
|||||||||||||||||||||||