https://github.com/feross/SpoofMAC
SpoofMAC - Spoof your MAC address
NOTE: Consider using spoof, a node.js port of this package.
For OS X, Windows, and Linux (most flavors)
I made this because changing your MAC address in Mac OS X is harder than it should be. The biggest annoyance is that the Wi-Fi card (Airport) needs to be manually disassociated from any connected networks in order for the change to be applied correctly. Doing this manually every time is tedious and lame.
Instead of doing that, just run this Python script and change your MAC address in one command. Now for Windows and Linux, too!
Note for Windows 10: While it may appear that this script does not work anymore, it does. The reason for this is that the change only appears in the Network Adapter properties in the Control Panel. Commands such as getmac or ipconfig will still show the original MAC address even though it has been changed. (Note: this actually appears to depend on the NIC (Network Interface Card). I tested it with my desktop and ipconfig showed the change, however it does not show the change on my laptop)
To see this for yourself, follow the below steps:
Open Control Panel
Click 'Network and Internet'
Click 'Network and Sharing Center'
On the panel to the left, click 'Change adapter settings'
A new window will appear showing all of the network adapters. Right-click the one that is currently active/enabled, and click 'Properties'
Near the top, click the button that says 'Configure'
Another window will open. At the top, click the 'Advanced' tab.
In the list to the left, select either 'Network Address' or 'Locally Administered Address'. This will depend on your system. You should see your MAC address in the text box to the right. This MAC address should change when you run this script on Windows 10. If the text box is empty and 'Not Present' is selected, run the script once to generate a new MAC address and follow the above steps. The 'Value' checkbox should now be selected and there should be a new MAC address in the text box.
Installation
You can install from PyPI using pip or easy_install:
pip install SpoofMAC
easy_install SpoofMAC
or clone/download the repository and install with setup.py. Ex:
git clone git://github.com/feross/SpoofMAC.git
cd SpoofMAC
python setup.py install
If you're not using the system Python (because you use Homebrew, for example), make sure you add '/usr/local/share/python/' (or equivalent) to your path.
Or, consider using spoof, a node.js port of this package.
Usage
SpoofMAC installs a command-line script called spoof-mac.py. You can always see up-to-date usage instructions by typing spoof-mac.py --help.
Examples
Some short usage examples.
List available devices:
spoof-mac.py list
spoof-mac.py randomize wi-fi
or the device name, such as:
spoof-mac.py randomize en0
Set device MAC address to something specific (requires root)
spoof-mac.py set 00:00:00:00:00:00 en0
Reset device to its original MAC address (requires root)
While not always possible (because the original physical MAC isn't available), you can try setting the MAC address of a device back to its burned-in address using reset:
spoof-mac.py reset wi-fi
(older versions of OS X may call it "airport" instead of "wi-fi")
Another option to reset your MAC address is to simply restart your computer. OS X doesn't store changes to your MAC address between restarts. If you want to make change your MAC address and have it persist between restarts, read the next section.