JavaScript MAC Addresses

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

Is there a way to get the MAC address of a user using JavaScript?

+92
javascript mac-address
Aug 06 '08 at 13:43
source share
6 answers

I agree with all the previous answers that this will be a privacy / security vulnerability if you can do it directly from Javascript. I can think of two things:

  • Using Java (with signed applet)
  • Using signed Javascript, which in FF (and Mozilla in general) receives higher privileges than regular JS (but it is quite difficult to configure)
+52
Aug 14 '08 at 6:21
source share

Quick and easy answer: None.

Javascript is a fairly high language and does not have access to this information.

+51
Aug 6 '08 at 13:45
source share

No, you cannot get the MAC address in JavaScript, mainly because the MAC address uniquely identifies the current computer so that it is a security vulnerability.

Now, if you only need a unique identifier, I suggest you create it yourself using a cryptographic algorithm, and save 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 for this: ActiveX for IE, XPCOM for Firefox (installed as an extension).

+26
Aug 11 '08 at 16:34
source share

Nope. The reason ActiveX can do this is because ActiveX is a small application that runs on the client machine.

I would suggest that accessing such information via JavaScript would be a security vulnerability.

+6
Aug 6 '08 at 15:38
source share

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

+4
Aug 6 '08 at 13:51
source share

You cannot access the MAC address , although you can get the IP address user

 <script type="application/javascript"> function getip(json){ alert(json.ip); // alerts the ip address } </script> <script type="application/javascript" src="http://jsonip.appspot.com/?callback=getip"> </script> 

Link: (see here ).

-12
Jun 12 '14 at 9:08
source share



All Articles