Jump to content

MAC Randomizer


a5an0

Recommended Posts

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!

Link to comment
Share on other sites

  • 2 weeks later...
Only a few problems with it

1. 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

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

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.... :wink:

edit: That wasn't a flmae. I'm sorry if it sounded angry.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...