a5an0 Posted October 1, 2006 Share Posted October 1, 2006 Hey all. I'm on a lot of open wireless networks where I really want to randomize my MAC because .... well, you get the idea. Anyway, It's really annoying to have to do it everytime, so I wrote a little python script that will do it for you! I threw it in my startup, but it works just as well when run manually. Please note that at this time it only works for linux. I'll throw together a windows version sometime I'm in windows. #!/usr/bin/python # mac_spoof.py - Randomizes wireless MAC Address # Hacked together for your pleasure by a5an0 # So far it only works on Linux. Windows version (maybe) coming soon import os, random mac = "00" # MAC Addressed typically start with 00. Looks more legit i=0 # This next part should be apparent. Fills in the mac with random hex while (i<5): mac = mac + ":" + str(hex(random.randint(0,15))[2:]) mac = mac + str(hex(random.randint(0,15))[2:]) i = i+1 changer = "sudo ifconfig eth1 hw ether " + str(mac) # Stops network services, assigns new mac, restarts networking os.system("sudo /etc/init.d/networking stop") # You may need to change this. os.system(changer) os.system("sudo /etc/init.d/networking start") Oh, also, if your disto's networking scripts are somewhere other than /etc/init.d, then you'll have to change the appropriate lines. I hope you all get some use out of this. Comments and suggestions are MORE THAN WELCOME! Enjoy! Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.