Track MAC Address, when it is running in Server

I am using this code to get the MAC address. I can see the MAC address tracked in my DB, when it is running in Local. But if i host the code in the server, it is not tracking. kindly give a solution for this?

function getmac_addr()
{
    system('ipconfig /all'); //Execute external program to display output
    $mycom=ob_get_contents(); // Capture the output into a variable
    ob_clean(); // Clean (erase) the output buffer
    $ipAddress=$_SERVER['REMOTE_ADDR'];
    $findme = "Physical";
    $pmac = strpos($mycom, $findme); // Find the position of Physical text
    $mac=substr($mycom,($pmac+36),17); // Get Physical Address*/
    
 
    return $mac;
}

there is none. clients do not broadcast their MAC over HTTP (at least not when using IPv4)

1 Like

As the php code will be running on the server, it will be calling the ipconfig program on that machine. Is it possible it’s running a different OS, that maybe doesn’t have an ipconfig command, or maybe security configuration prevents web code from running it? Maybe if you’re on Windows but the server is running Linux, that might explain it. And aren’t you just getting the MAC address of the server, which won’t change all that often?

I tried with same server, but it is not working… Could u tel me the solution to track the MAC in server

Who runs the server, is it your own or a hosted one? If the latter, have you asked them whether there’s a security block on running ipconfig? But, if it’s on the server, won’t the MAC always be the same anyway?

No, this is not my own. will confirm with them and tel u know the details

well, most servers run some kind of linux (or other non-Windows OS) and all those do not have the ipconfig command.

The only way to track a MAC address outside of a private network is to use a radius server.
AND
You will have to configure the access point that the user is connected to into a radius client.

When I get on the internet, the only person that can see my MAC is my ISP or a captive portal (radius client) that uses a radius server.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.