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...
PoyBoy Posted October 1, 2006 Share Posted October 1, 2006 Sweet Thanks! Quote Link to comment Share on other sites More sharing options...
anyedie Posted October 1, 2006 Share Posted October 1, 2006 Awesome! I love all these new community tools! Quote Link to comment Share on other sites More sharing options...
FrihD Posted October 13, 2006 Share Posted October 13, 2006 Nice scriptting exercize. As i don't know python, i once tried macchanger. Just adds it in your scripts (cron or inet etc..) to fits your needs. http://www.alobbs.com/macchanger Quote Link to comment Share on other sites More sharing options...
addisonzinser Posted October 13, 2006 Share Posted October 13, 2006 wow very nice :) Quote Link to comment Share on other sites More sharing options...
CaveMan Posted October 13, 2006 Share Posted October 13, 2006 nice work.. if only i had a need for it Quote Link to comment Share on other sites More sharing options...
jollyrancher82 Posted October 13, 2006 Share Posted October 13, 2006 Only a few problems with it 1. It's Python. 2. It assumes the user has sudo installed. 3. It's for Linux. Quote Link to comment Share on other sites More sharing options...
Garda Posted October 13, 2006 Share Posted October 13, 2006 Only a few problems with it1. It's Python. 2. It assumes the user has sudo installed. 3. It's for Linux. Dude, you know how to complain don't you 1: so what if it's python and not bash, most people will have python installed 2: see #1 3: Of course it's for Linux. You would have to be majorly retarded to write a MAC spoofer for Linux and for it to not work on Linux. What does that mean, that a piece of software has a problem with it because it works on Linux. AFAIK that's a feature not a problem Quote Link to comment Share on other sites More sharing options...
armadaender Posted October 13, 2006 Share Posted October 13, 2006 Nice work. I don't have a use for such a script but hey, it's nice to know that I can find one easily if necessary. Quote Link to comment Share on other sites More sharing options...
jollyrancher82 Posted October 13, 2006 Share Posted October 13, 2006 Dude, you know how to complain don't you1: so what if it's python and not bash, most people will have python installed 2: see #1 3: Of course it's for Linux. You would have to be majorly retarded to write a MAC spoofer for Linux and for it to not work on Linux. What does that mean, that a piece of software has a problem with it because it works on Linux. AFAIK that's a feature not a problem I prefer programs with minimum dependancies. Rather than assume a user has sudo installed, which only Ubuntu and it's derivatives do, you could remove sudo and do 'sudo python ./blah.py", or "su" then run it. Quote Link to comment Share on other sites More sharing options...
kickarse Posted October 13, 2006 Share Posted October 13, 2006 For the windows people... http://fileforum.betanews.com/detail/Mac_Makeup/1074241070/1 :roll: Quote Link to comment Share on other sites More sharing options...
l0gic Posted October 13, 2006 Share Posted October 13, 2006 For an even more confusing effect, I would use only valid OUI's for each random MAC. You can download the full listing from the IEEE here: http://standards.ieee.org/regauth/oui/index.shtml Quote Link to comment Share on other sites More sharing options...
addisonzinser Posted October 13, 2006 Share Posted October 13, 2006 the real question is what person running linux does not have python installed Quote Link to comment Share on other sites More sharing options...
metatron Posted October 13, 2006 Share Posted October 13, 2006 Pythons not that bad, I only feel a little dirty when I use it. Quote Link to comment Share on other sites More sharing options...
Darren Kitchen Posted October 13, 2006 Share Posted October 13, 2006 I love seeing tools like these developed here. Cheers. Oh, and don't complain about the python use. I mean... It could be perl! *ducks* I kid ;-) Quote Link to comment Share on other sites More sharing options...
addisonzinser Posted October 14, 2006 Share Posted October 14, 2006 lol Quote Link to comment Share on other sites More sharing options...
PoyBoy Posted October 14, 2006 Share Posted October 14, 2006 my sentiments exactly Quote Link to comment Share on other sites More sharing options...
Xidus Posted October 15, 2006 Share Posted October 15, 2006 Wow, i can just feel the perl love right now... I dont have a perl interpreter laying around at the moment so i dont really know if this will work perfectly but meh! it was just for fun :) Huh... I had some problems when trying to post the source here which was odd, meh ive just posted it on my webserver :) http://xidus.ath.cx/stuff/perl/macrand Quote Link to comment Share on other sites More sharing options...
PoyBoy Posted October 15, 2006 Share Posted October 15, 2006 This is in the code section of the wiki now Quote Link to comment Share on other sites More sharing options...
a5an0 Posted October 16, 2006 Author Share Posted October 16, 2006 Thank you to whoever put this in the Wiki! To address the sudo issue, if you dont have sudo installed, then you either run as root a lot (bad) or you dont do shit on your system. As for my choice in language, I love python, and the RNG does just what I need it for. It's pretty much a bash wrpaaer with random numbers. What I did was I mad an icon for it, and then made a launcher on my desktop (gnome). All I have to do is click the icon, and I have a new mac. Its super useful in hotel lobbies.... edit: That wasn't a flmae. I'm sorry if it sounded angry. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.