views:

1581

answers:

7

I'm looking for a solution to find out about the MAC number of a user using asp.net website. I know you can get an IP address (don't know why but it can't be complicated) but can i find out the MAC address having the IP?

Edit: I mean programmatically (not manually) in .NET

+2  A: 

no chance to get this sorry.

Even if you could it would not make sense to attempt to get this, when I access a website on the internet my MAC address never leaves my home network.

Ok if the user was on the same LAN say in a company intranet for example this could be determined by having the ip address and using command line tools like arp.

ARP stands for Address Resolution Protocol and it can be used for finding a host's link layer (hardware) address when only its Internet Layer (IP) or some other Network Layer address is known.

Paul Whelan
Whilst not with ASP.NET, there are several possible methods.
Robert Duncan
it is the same LAN in the same company
agnieszka
A: 

I don't think this is possible on any platform.

Mayo
This isn't true. See above answers using ActiveX, Java, and ARP.
Robert Duncan
I should clarify... anything is possible, but so many things have to fall into allignment that it isn't practical. Looks like you have to be on a LAN and have elevated privleges on the client. If he wanted the MAC address of Internet users he'd have to have them install a special client - which is possible but not at all practical.
Mayo
noone asks about practical solution. i need it in my local LAN and i'm perfectly fine with the limitations
agnieszka
and i'm not "he"
agnieszka
+3  A: 

The IP address is necessary for routing the communication between the client system requesting the information and the server. You can get it, because the IP address is pulled from a lower level in the TCP/IP stack (level 3 I believe). The MAC Address isn't necessary for any of this and hence it isn't included in the communication between the client and the server.

Kevin
+2  A: 

If your site is trusted, you can do this in IE:
http://www.devarticles.com/c/a/JavaScript/Advanced-JavaScript-with-Internet-Explorer-Retrieving-Networking-Configuration-Information/1/

I wouldn't expect it to work for any typical visitors, just users who's systems you already control, like on your local network. There may be a second way in IE if you can find a common activex that generates a guid using CoCreateGuid. It returns the mac address in part of the guid. I wouldn't bet on finding one that's commonly installed though.

David
+1  A: 

Java 6 has a NetworkInterface#getHardwareAddress() method which usually returns the MAC address of the computer in question. You could create a small Java applet to communicate with your web server to obtain the MAC address, though there are ways and means of spoofing a MAC address.

Robert Duncan
+1  A: 

The MAC address you get might not be practical to use. If someone has multiple network adapters then they also have multiple MAC addresses. And it's not uncommon anymore that someone has two networks. (For example, bluetooth, regular cabled and WiFi would already be three.)

A MAC address is just for identification and it can be requested. The Address Resolution Protocol is created for this purpose. By arping you can get a MAC address. Unfortunately, this only works on local networks, not on the Internet. I think that by using IPv6, you might also have a few options. Although I think it would still be limited to just a local system.

Getting the MAC address of your visitor might be considered inappropriate and perhaps even criminal since a MAC address is generally used as an unique identifier. This information could be misused by hackers, especially when the hacker manages to gain physical access to the users network. It would allow him to impersonate the user. Your site might make some security specialists very unhappy...

At http://www.ipaddresslocation.org/find-mac-address.php there's a Java applet which they claim will work. It doesn't on my system with Google Chrome, though.

Workshop Alex
A: 

How can you get the MAC address of someone from outside your network?

Richard