0

I have a website so how to get mac address of computer that access my website?

Please help me answer with code python, flask or jquery.

Mr Theavuth
  • 106
  • 1
  • 3
  • 11
  • 2
    As far as I know this is not possible directly. You need to use OS programs to determine the mac address. But of course you can get the IP-Address of a remote user using jQuery: http://stackoverflow.com/questions/1641868/how-to-get-client-ip-address-using-jquery Btw what do you need the MAC-Address for? Maybe there's a simpler solution to your problem. – KeepAlive Aug 19 '15 at 11:00
  • I want to check allow client mac address to access my website. – Mr Theavuth Aug 20 '15 at 01:23

2 Answers2

1

No, getting the clients MAC Address via JS is impossible, heres why:
MAC addresses in JavaScript

Community
  • 1
  • 1
Tom Doodler
  • 1,471
  • 2
  • 15
  • 41
0

in general you can only access the MAC address of a machine on your LAN - if the computer you are talking about is outside of this then you probably can't

here's some python code:

import subprocess
p = subprocess.Popen('arp %s' % ip_address, stdout=subprocess.PIPE)
print p.stdout
scytale
  • 12,346
  • 3
  • 32
  • 46