tags:

views:

655

answers:

6

I know that we can get the MAC address of a user via IE (ActiveX objects).

Is there a way to do the same thing in all browsers? (Especially since FF is gaining browser share everyday!)

+7  A: 

The quick and simple answer is No.

Javascript is quite a high level language and does not have access to this sort of information.

GateKiller
+1  A: 

If this is for an intranet application and all of the clients use DHCP, you can query the DHCP server for the MAC address for a given IP address.

Ryan Ahearn
+1  A: 

Nope. The reason ActiveX can do it is because ActiveX is a little application that runs on the client's machine.

I would imagine access to such information via JavaScript would be a security vulnerability.

Terrapin
+1  A: 

No you cannot get the MAC address in JavaScript, mainly because the MAC address uniquely identifies the running computer so it would be a security vulnerability.

Now if all you need is a unique identifier, I suggest you create one yourself using some cryptographic algorithm and store it in a cookie.

If you really need to know the MAC address of the computer AND you are developing for internal applications, then I suggest you use an external component to do that: ActiveX for IE, XPCOM for Firefox (installed as an extension).

Vincent Robert
+1  A: 

I concur with all the previous answers that it would be a privacy/security vulnerability if you would be able to do this directly from Javascript. There are two things I can think of:

  • Using Java (with a signed applet)
  • Using signed Javascript, which in FF (and Mozilla in general) gets higher privileges than normal JS (but it is fairly complicated to set up)
Cd-MaN
A: 

How could this be of any consequence at the level of the network model that your application lives in?

Are you going to be logging people by MAC address for DDOS?

If you can figure this out, you and the FBI and the RIAA should have a talk and figure out how you could best kill all privacy.

DevelopingChris