kennedysee Posted January 8, 2010 Share Posted January 8, 2010 How do i detect the visitor mac address when they visit the website? <?php function getMac(){ exec("ipconfig /all", $output); foreach($output as $line){ if (preg_match("/(.*)Physical Address(.*)/", $line)){ $mac = $line; $mac = str_replace("Physical Address. . . . . . . . . :","",$mac); } } return $mac; } $mac = getMac(); $mac = trim($mac); ?> Quote Link to comment Share on other sites More sharing options...
premiso Posted January 8, 2010 Share Posted January 8, 2010 You cannot get their MAC address, namely because you do not have access to their computer. If you install an ActiveX control you can probably get it. But what you want to do is not possible through PHP, as far as I know. And definitely not in the way you are trying to. Sorry bud. Quote Link to comment Share on other sites More sharing options...
Andy-H Posted January 8, 2010 Share Posted January 8, 2010 The code your currently using will get the mac address of the server on which your script is running. I dont think it's possible to get the mac address using PHP. Quote Link to comment Share on other sites More sharing options...
dominicd Posted January 13, 2010 Share Posted January 13, 2010 It is impossible to get a users mac address in any programming language from server-side MAC address's are only used locally seeing as it is a layer 2 frame and is only used by routers,gateways and local pc's to route local traffic only. Quote Link to comment Share on other sites More sharing options...
ignace Posted January 13, 2010 Share Posted January 13, 2010 It is impossible to get a users mac address in any programming language from server-side MAC address's are only used locally seeing as it is a layer 2 frame and is only used by routers,gateways and local pc's to route local traffic only. Plus they are unreliable like IP's so in the end it still won't work. Quote Link to comment Share on other sites More sharing options...
dominicd Posted January 13, 2010 Share Posted January 13, 2010 how are they unreliable ?? I mean IPs can be Spoofed but so can hardware mac address's I am willing to bet that the majority of people whom know how to IP Spoof of 1 form or another know nothing of either how to "spoof" or "change" a MAC address... Seeing as the MAC is "Burned" into the flash memory on your NIC if you could track somebody by their MAC it would be alot more reliable. Because where in the world 2 machines or 10,000 machines can have the same IP address (in many different local area networks, With private addressing) But No 2 NICs in the World have the same MAC addy :/ Quote Link to comment Share on other sites More sharing options...
dgoosens Posted January 13, 2010 Share Posted January 13, 2010 how are they unreliable ?? I mean IPs can be Spoofed but so can hardware mac address's I am willing to bet that the majority of people whom know how to IP Spoof of 1 form or another know nothing of either how to "spoof" or "change" a MAC address... Seeing as the MAC is "Burned" into the flash memory on your NIC if you could track somebody by their MAC it would be alot more reliable. Because where in the world 2 machines or 10,000 machines can have the same IP address (in many different local area networks, With private addressing) But No 2 NICs in the World have the same MAC addy :/ just google for it and more or less everyone who is a little computer literate is able to change his MAC-address... Quote Link to comment Share on other sites More sharing options...
Andy-H Posted January 13, 2010 Share Posted January 13, 2010 Yes, different networks may have duplicate private IP addresses, however, you cannot connect to the Internet using a private IP address. MAC spoofing is quite easily achievable, you can download software which allows you to spoof your MAC address quite easily. You can also get hold of the software used by the company that produced your NIC and update the physical address. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.