Skip to content

Instantly share code, notes, and snippets.

@bkmeneguello
Created October 24, 2019 17:21
Show Gist options
  • Save bkmeneguello/d9ba1b427cab1502b0345567cbef380e to your computer and use it in GitHub Desktop.
Save bkmeneguello/d9ba1b427cab1502b0345567cbef380e to your computer and use it in GitHub Desktop.
import random
def randomMAC():
mac = [ 0x52, 0x54, 0x00,
random.randint(0x00, 0x7f),
random.randint(0x00, 0xff),
random.randint(0x00, 0xff) ]
return ':'.join(map(lambda x: "%02x" % x, mac))
print randomMAC()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment