locked
Getting System IP Address or System Name RRS feed

  • Question

  • User-937986814 posted

    Hi 

    Anyone tell me How to get  System IP Address or System Name of Client who is using My Website 

    My code is Working but its on Local System.

    it Always get the Server Name and IPAddress. But i want Client Information who is accessing my Website ....!!!!

     ................. Thats my code .......................

    IPHostEntry ip = Dns.GetHostEntry(Dns.GetHostName());

    IPAddress[] IPaddr = ip.AddressList;

    string IPAddress = IPaddr[0].ToString();

    Saturday, September 15, 2018 11:46 AM

Answers

  • User753101303 posted

    Once again you can't have the MAC address. As discussed at  https://stackoverflow.com/questions/216542/how-do-i-uniquely-identify-computers-visiting-my-web-site at best you could attempt to uniquely recognize a browser with increasingly levels of difficulty.

    My approach would be to generate a guid stored in various places at as shown at https://samy.pl/evercookie/ (which comes from the above link). It would allow to give the user a "trust/untrust" my browser feature. Note that a user should likely be able to "untrust" any browser (for example if a machine is stolen). If the user can manually remove all those values he is back to the default account protection and just have to trust the browser again if he wants to.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, September 15, 2018 9:14 PM

All replies

  • User753101303 posted

    Hi,

    Your code is for the "local" computer and even though it can appear to work when you are running the server side on your dev machine, it still runs on the web server and is expected to return the web server IP address.

    See rather https://stackoverflow.com/questions/527638/getting-the-client-ip-address-remote-addr-http-x-forwarded-for-what-else-coul (it is still the public IP address ie multiple computers could be exposed to internet using a single IP address). Always be cautious with what you'll do with this address.

    Saturday, September 15, 2018 1:28 PM
  • User-937986814 posted

    hmmm !! Can i get the Physical Address of Client System ???

    Article you shared is about IP Address, and its not a good method bcz ip changes ?? Anything related to Physical Address ??

    Saturday, September 15, 2018 1:42 PM
  • User753101303 posted

    No, AFAIK the MAC address is not even transmitted outside of the network. For privacy reason you have nothing out of the box to uniquely identify a machine.

    Try https://stackoverflow.com/questions/216542/how-do-i-uniquely-identify-computers-visiting-my-web-site that discuss limitations and possible options to get close (but you'll never have a 100% full proof solution). Do you even really need this kind of information?

    Edit: for example even Google Analytics doesn't get it right: http://www.analytics-ninja.com/blog/2011/12/how-unique-are-unique-visitors-in-google-analytics.html but for this kind of solution what matters should be the trend rather than really which exact value you have on a particular day.

    Saturday, September 15, 2018 2:58 PM
  • User-937986814 posted

    Well i really need that !! Bcz my Website contains Confidential Data. I am trying to Secure my website with every possible option i have.

    Basically what i am trying to achieve that whenever user login it should read his/her Physical address.

    with this Approach i can assure myself that there is nothing to worry about my data miss use.

    Well Thanks for the information  

    Saturday, September 15, 2018 4:56 PM
  • User753101303 posted

    Assuming you could what would you do anyway if a user wants to use another browser or gets a new computer ? Tying each user to a physical machine seems a bit unrealistic in the real world.

    Instead you could enhance your authentication system using a 2nd authentication factor for example or sending a temporary password etc... You can also track the IP, check the location and warn the user about unusual activities (for example most account providers will warn you if suddenly you seems to log from another region).

    Saturday, September 15, 2018 7:00 PM
  • User-937986814 posted

    well i have a solution if user changed his system . in that case i will provide a one time password. 

    when user enter that password it will update the new status of that computer. well i have so many options but first i want physical address or any information related to system that not changes else he changes his computer or buy a new one ?????

    problem with IP is that it changes automatically except someone set in Manually but its not a good solution for me to use IP, i want a thing that not changes so that i can trace easily !!!

    Saturday, September 15, 2018 7:12 PM
  • User753101303 posted

    Once again you can't have the MAC address. As discussed at  https://stackoverflow.com/questions/216542/how-do-i-uniquely-identify-computers-visiting-my-web-site at best you could attempt to uniquely recognize a browser with increasingly levels of difficulty.

    My approach would be to generate a guid stored in various places at as shown at https://samy.pl/evercookie/ (which comes from the above link). It would allow to give the user a "trust/untrust" my browser feature. Note that a user should likely be able to "untrust" any browser (for example if a machine is stolen). If the user can manually remove all those values he is back to the default account protection and just have to trust the browser again if he wants to.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, September 15, 2018 9:14 PM
  • User-937986814 posted

    Yeah i know that i can't have Mac Address , I was just dreaming :P hahah thanks Dude for the lots of Info !! 

    Thanks 

    Saturday, September 15, 2018 9:34 PM