4 Replies - 3752 Views - Last Post: 28 April 2011 - 11:28 PM Rate Topic: -----

#1 EnginMan205  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 31-December 07

Get Real IP Address Behind ISA Server

Posted 23 April 2011 - 12:23 AM

Hi, for security reasons I want to find real ip address of computers that are connected to my company's website. All users who want to see our website pass from our ISA Server. So, if I want to get their IP Address with commands like Request.ServerVariables("HTTP_X_FORWARDED_FOR"), Request.ServerVariables("REMOTE_ADDR") or HttpContext.Current.Request.UserHostAddress, I'll get one and only one IP Addres that is our ISA Server address. How I can get real ip address of those computers in asp.net 2 and VB.Net 2005?

Thank you in advance

Is This A Good Question/Topic? 0
  • +

Replies To: Get Real IP Address Behind ISA Server

#2 marinus  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 135
  • View blog
  • Posts: 575
  • Joined: 14-April 10

Re: Get Real IP Address Behind ISA Server

Posted 28 April 2011 - 10:37 AM

The way you try it will work only sometimes..


Have you tried Javascript , to show an ip address , then save that to a hidden field or something , and send it to a database

Look at this site , to show you what i mean

http://javascript.in...ip-address.html

Remember ,some ip addresses is dynamic this is why the is something called DNS . You might want to look at that also

This post has been edited by marinus: 28 April 2011 - 10:39 AM

Was This Post Helpful? 0
  • +
  • -

#3 SurfingShark  Icon User is offline

  • D.I.C Head

Reputation: 38
  • View blog
  • Posts: 188
  • Joined: 18-April 11

Re: Get Real IP Address Behind ISA Server

Posted 28 April 2011 - 05:19 PM

I agree, that the best way to approach this is client-side development with Javascript, but if this is for a comfort then that would be fine. But if it is for a be-all-end-all security measure, then it could easily be disabled on the end user's machine.
Was This Post Helpful? 0
  • +
  • -

#4 EnginMan205  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 31-December 07

Re: Get Real IP Address Behind ISA Server

Posted 28 April 2011 - 11:02 PM

Hi,
I apreciate you for your guidance and good link. I have to find a way to use for security reasons and it must useful in all cases. Javascript code, use cookies and methods like them are good but user can disable them easily. Please give me another guidance that I can use always.

Thank you again,


View Postmarinus, on 28 April 2011 - 11:37 AM, said:

The way you try it will work only sometimes..


Have you tried Javascript , to show an ip address , then save that to a hidden field or something , and send it to a database

Look at this site , to show you what i mean

http://javascript.in...ip-address.html

Remember ,some ip addresses is dynamic this is why the is something called DNS . You might want to look at that also

Was This Post Helpful? 0
  • +
  • -

#5 marinus  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 135
  • View blog
  • Posts: 575
  • Joined: 14-April 10

Re: Get Real IP Address Behind ISA Server

Posted 28 April 2011 - 11:28 PM

Server usually have dns installed so take a look at this Code ...
string dreamincode = "www.dreamincode.net";

IPAddress[] addresslist = Dns.GetHostAddresses(dreamincode);

foreach (IPAddress address in addresslist)
{
   Label1.Text += address.ToString() + "||";
}


Or this that i found on bytes.com

NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface ni in nics)
{
if (ni.OperationalStatus == OperationalStatus.Up)
{
IPAddressCollection ips = ni.GetIPProperties().DnsAddresses;
foreach (System.Net.IPAddress ip in ips)
{
MessageBox.Show(ip.ToString());
}
}
}

This post has been edited by marinus: 28 April 2011 - 11:30 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1