Created
February 7, 2015 06:05
-
-
Save stypr/75b0d1320cee4ac77c8d to your computer and use it in GitHub Desktop.
Change WLAN MAC address randomly in OSX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os | |
import sys | |
check_root = os.popen("whoami").read().strip() | |
if check_root == "root": | |
mac_real = os.popen("ifconfig en0 | grep ether") \ | |
.read().strip().replace("ether ", "") | |
mac_hex = os.popen("openssl rand -hex 6").read().strip() | |
mac_fake = "" | |
for i in range(len(mac_hex)): | |
if(i % 2 == 1): | |
mac_fake += mac_hex[i] + ":" | |
else: | |
mac_fake += mac_hex[i] | |
mac_fake = final_data[:-1] | |
os.system("ifconfig en0 ether " + final_data) | |
else: | |
os.system("sudo python wlan_mac.py") | |
sys.exit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment