Jump to content

Recommended Posts

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);

?>

Link to comment
https://forums.phpfreaks.com/topic/187664-detect-visitor-mac-address/
Share on other sites

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.

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.

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 :/

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...

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.