menu search
brightness_auto
Ask or Answer anything Anonymously! No sign-up is needed!
more_vert
If I get a mac address of a spammer then I could block him to my site using a code either in php or through javascript. What is the easiest and effective method to get the mac address of a site visitor's device.

6 Answers

more_vert
Normally a website can only track and display the website visitor's IP address and not the device MAC address. When a person visits your site they are behind a router which normally uses NAT. Routers will only display the IP address. Each device on the network has their own IP address. The router can display the MAC address of the devices attached to the router, but the router will never send the MAC address out. When you check on your IP address, each IP address in your network is different. The router normally uses an IP address of 192.168.0.1 or it can be 192.168.1.1.

All devices on the router have a special IP address assigned to the device. If you have 4 devices on your router the IP address would be:

192.168.1.2

192.168.1.3

192.168.1.4

192.168.1.5

With each device, the router will assign the MAC address associated with the device. The router will display the MAC address in the setup and configuration of the router.

These are internal IP address on your network and not an IP address that is shown online. The IP address that a website sees the IP address assigned from your ISP.
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
more_vert
Unfortunately, there is no reliable way to get the MAC address of a visitor's device. Browsers do not provide this information and there is no reliable way to detect it. If you need to detect and block malicious visitors, it would be better to use other methods, such as IP address tracking or browser fingerprinting.
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
more_vert
The only way to get the visitor's MAC address is to run code on his laptop, from the browser. There is no way to do it since it would be a breach of privacy or security. There are several workarounds like running Active-X controls for Internet Explorer only or running XPCOM for Mozilla Firefox only.
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
more_vert
Normally a website can only track and display the website visitor's IP address and not the device MAC address. When a person visits your site they are behind a router which normally uses NAT. Routers will only display the IP address. Each device on the network has their own IP address
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
more_vert
To obtain the MAC address of a visitor's device to a web page, you would typically need client-side code (such as JavaScript) and the visitor's consent. However, retrieving the MAC address directly from a web page is not possible due to browser security restrictions.
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
more_vert
In a web browser, you cannot directly retrieve the MAC address of a visitor's device due to privacy and security restrictions. The MAC address is not accessible through JavaScript or standard web technologies.
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
Whenever you have a question in your mind, just drop it on Answeree. Help our community grow.
...