4

I am not really sure how to Determining End user Machine MAC address and IP addresses (Local and ISP). We are using ASP.net based system using C# as programming language.

Can someone please guide. Regards, Yagya

Jaime Torres
  • 10,365
  • 1
  • 48
  • 56
Yagya Sharma
  • 427
  • 1
  • 5
  • 16
  • New to this system. Going ahead I will address this – Yagya Sharma Jul 27 '12 at 07:06
  • Are you stating that you, as an ASP.NET server (presumably serving up webpages/services), would like to know the MAC address of the web client, as well as their public IP address AND internal network IP address? – Jaime Torres Sep 09 '12 at 14:39
  • Assuming my comment above is correct, without privileged code running on the client machine, the only information you can deduce is their ISP's IP address. More info: http://www.codeproject.com/Answers/303661/How-to-get-Mac-Address-of-Client-Machine-in-asp-ne – Jaime Torres Sep 09 '12 at 14:59
  • what is your goal exactly ? perhaps there are other options... – Yahia Sep 09 '12 at 15:17

4 Answers4

3

If you are writing an Internet web app (as opposed to an intranet/LAN app), there is no way to determine the local address and MAC address of the client unless the client explicitly sends it to you. You can get the external (public, internet) address by Request.UserHostAddress field. If the client is using a proxy, it would be another option to look at Request.ServerVariables["REMOTE_ADDR"] and Request.ServerVariables["HTTP_X_FORWARDED_FOR"] as they may reveal the true address. Either way, none of these options are guaranteed and you should not rely on them. They may be an additional layer of verification, but they should never be the primary mechanism for checking an identity.

Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
  • Hello - We have a requirement for developing a module of the banking system. We need to capture, the computer details of the Browser client and track it. – Yagya Sharma Sep 19 '12 at 16:22
  • It will never be reliable. It's something client side, and you can't rely on the client as even a novice can fake the data. – Can Poyrazoğlu Sep 20 '12 at 00:20
2

you cannot get the MAC address of a PC over internet

jozi
  • 2,833
  • 6
  • 28
  • 41
1

The only thing that runs on the users machine when you use ASP.NET is HTML and JavaScript. You can not use JavaScript to get the MAC address, however, you can get the IP address and post it back.

To get the local IP address and the MAC address, you need to get the user to run an application e.g. a Java application.

Danny Varod
  • 17,324
  • 5
  • 69
  • 111
  • +0. Getting IP on server, sending it to client and posting it back as suggested on the link is not very efficient :) . It is using the REMOTE_ADDR server variable which can be used without round trips (as suggested by (+1)can poyrazoğlu) and already logged in IIS logs without additional code. – Alexei Levenkov Sep 15 '12 at 02:56
  • That was just an example I googled. My point is, that without running an app, you can't get the local IP or the MAC address. – Danny Varod Sep 15 '12 at 13:16
1

to get the MAC address you need to have a signed ActiveX/ jar / .net dll. else you can get the IP address only.

Why signed, because most of the client have their browser settting to block any unsigned active component.

You can get a code signing certificate from a valid CA.