如何使用PHP检测访问我们网站的用户的MAC地址?

问题描述:

我知道如何跟踪IP地址,但是我需要跟踪查看我的页面的用户的MAC地址.

I know how to track down an IP address, but I need to track down the MAC address of the users viewing my page.

如何做到这一点?

除非用户与Web服务器在同一LAN中,否则您不能这样做. MAC地址位于TCP/IP下方的以太网层上,并且不包含在通过用户本地网络路由的TCP/IP数据包中.

Unless the user is on the same LAN as the webserver, you cannot do this. MAC addresses are on the ethernet layer below TCP/IP, and are not included in TCP/IP packets routed off the users local network.

在某些环境中,可能可以使用客户端插件来允许Javascript访问MAC地址,并将该信息传输到服务器.

In some environments, it might be possible use to a client-side plugin to allow Javascript access to the MAC address, and transmit that information to the server.

如果此一种基于LAN的Web应用程序,则可以尝试从ARP缓存中获取MAC地址.具体操作方式取决于操作系统,但是在Linux下,您可以解析arp -n

If this is some kind of LAN based web application, you could try getting the MAC address out of the ARP cache. How you do this will depend on the operating system, but under Linux you could parse the output of arp -n