Skip to content

Instantly share code, notes, and snippets.

@denmojo
Created July 12, 2017 06:46
Show Gist options
  • Select an option

  • Save denmojo/697c671c820b35c369f65230ec56758e to your computer and use it in GitHub Desktop.

Select an option

Save denmojo/697c671c820b35c369f65230ec56758e to your computer and use it in GitHub Desktop.
Spoof MAC address on macOS
#!/bin/sh
sudo ifconfig en0 ether $(openssl rand -hex 6 | sed 's%\(..\)%\1:%g; s%.$%%')
@denmojo
Copy link
Author

denmojo commented Jul 12, 2017

If you get a "unable to write 'random state' message when attempting this, try looking for a file ~./rnd and see if it's owned by root. Delete this file and try again.

This spoofing seemed to work and confuses the heck out of existing wifi connections as defined in System Preferences -> Networking. Set before initially connecting. Hardware reset will reset to normal MAC.

See also: https://github.com/feross/SpoofMAC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment