Jump to content

MAC adress of Remote Client


adragan

Recommended Posts

Is it possible to get the MAC of a remore client ?

I know Indy in 9 version could do that.

 

 

I think that isn´t possible because of security.

 

The problem is that browsers don't allow you to get the mac address, because it would allow users to be identified uniquely. In IE you can get around this by writing an ActiveX control, and script that with javascript (which you did), but ActiveX is something only available in IE on Windows. Other solution can be a Java applet.

 

Code to IE:

 

var macAddress = "";
   var ipAddress = "";
   var computerName = "";
   var wmi = GetObject("winmgmts:{impersonationLevel=impersonate}");
   e = new Enumerator(wmi.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True"));
   for(; !e.atEnd(); e.moveNext()) {
       var s = e.item();
       macAddress = s.MACAddress;
       ipAddress = s.IPAddress(0);
       computerName = s.DNSHostName;
   } 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...