Spoofing your MAC address in Snow Leopard

Spoofing your MAC address in Snow Leopard

A MAC address, sometimes also refereed to as “physical address” is a unique identifier assigned to every network device. Contrarily to the IP address, which can change dynamically, a MAC address is a bit like a serial number intended to differentiate every network device on the planet. Here’s what it looks like : 01:23:45:67:89:ab.

Changing or “spoofing” your MAC address can be desired for multiple reasons and is quite simple to do in Snow Leopard.

In this tutorial, we’ll assume you want to change your wireless adapter’s physical address.

To find out what is your AirPort card’s current MAC address, type this in the Terminal.

ifconfig en1 | grep ether

Step 1 : disassociate from all wireless networks

This means to disconnect all current wireless network connections while leaving AirPort enabled.

Open the Terminal and paste this command :

sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -z

You will be asked for your password to execute this command.

The airport command is part or Apple’s Apple80211 framework. Essentially, it’s what connects you to Wifi networks. The -z option disassociates from any network.

Tip: You can set up a simpler access to the airport command by creating a symbolic link. To do this, paste the following command in the Terminal:

sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport

Next time, you will simply need to type ariport -z to disassociate. You may also use airport -I to get information on your current connection.

Step 2: Change your MAC address

Once disassociated from the wireless network. You can change the MAC address with:

sudo ifconfig en1 ether 00:00:00:00:00:00

You can of course enter what ever you want as long as it is in the correct format. You can verify with ifconfig en1 | grep ether that your address is changed.

To revert your MAC address back to its default, simply reboot your machine.

  • I like writing, hurriedly, not that you are not
  • I like writing, hurriedly, not that you are not
  • thank you so much for that solution! i knew it could be done i just couldn't figure out the proper syntax.
  • gmcd2200
    Here is a ksh script to make a random mac addr. for Mac Osx 10.6x
    ##############################################################
    #!/bin/ksh
    #
    # Written by Graeme Mc Donough
    # Copy and manipulate this .. but give me credit. for the code thanks.
    # Version 1.0 16-04-2010
    #
    #
    # This script is called "rand_mac.ksh"
    #
    #
    # This script is free.. enjoy..
    # This script was written to work with Mac Osx 10.6
    # Mac OSX 10.6 ksh has a bug.. so I added a work around in the script.
    #
    # Assumptions
    # * you have put in a link for the airport to /usr/sbin
    # * you will run this script with "sudo ./rand_mac.ksh"
    # * You will know how to use vi.. I am a unix person.. not a pico person.. so don't ask me
    #
    # NOTES
    # * I found a way to make the Airport auto lock back on to your fav wireless
    # just un-comment the 3 bottom lines. Note.. it may make the script not work well"
    # Go figure /shrug

    /usr/sbin/airport -z
    counter=0


    GET_HEX ()
    {
    if [[ ${VAR} -lt 10 ]]
    then
    HEX_VALUE=`echo ${VAR}`
    fi

    if [[ ${VAR} -eq "10" ]]
    then
    HEX_VALUE=a
    fi
    if [[ ${VAR} -eq "11" ]]
    then
    HEX_VALUE=b
    fi
    if [[ ${VAR} -eq "12" ]]
    then
    HEX_VALUE=c
    fi
    if [[ ${VAR} -eq "13" ]]
    then
    HEX_VALUE=d
    fi
    if [[ ${VAR} -eq "14" ]]
    then
    HEX_VALUE=e
    fi
    if [[ ${VAR} -eq "15" ]]
    then
    HEX_VALUE=f
    fi

    # echo "${HEX_VALUE}"
    }

    for i in {1..6}}
    do

    VAR=$((RANDOM%15))
    GET_HEX

    FULL_HEX=`echo ${FULL_HEX}${HEX_VALUE}`

    VAR=$((RANDOM%15))
    GET_HEX

    FIX_I=`echo ${i} | awk -F\} '{print $1}'`
    #echo $FIX_I
    if [ ${FIX_I} -eq 6 ]
    then
    FULL_HEX=`echo ${FULL_HEX}${HEX_VALUE}`
    else
    FULL_HEX=`echo ${FULL_HEX}${HEX_VALUE}:`
    fi

    done


    echo "The new randomised Mac Addr = ${FULL_HEX}"
    echo "Attempting to change en0 to the New Mac Addr it does not work all the time."
    echo " the first thing we do is wait... aournd 20 seconds ... boooring"
    sleep 25
    ifconfig en0 ether ${FULL_HEX}

    echo "The (hopefully changed to tbe the same) mac addr for en0 = ${VALUE}"
    echo "if not .. run this again.. .. it will eventually work"


    #ifconfig en0 down
    #sleep 3
    #ifconfig en0 up
    ##################################################################
  • alibaba80
    Don't seem to be able to change mac address properly in 10.6.2 . After changing I get connection timeout as above. Anyone with a fix?
  • 3n4b13r
    Ok i think i know what you did. I have 10.6.3 running on my macbook. Im not 100% sure but its an idea. I had to disassociate from all networks before changing my mac address. I tried turning my airport off and then i got "Device power is off" I then turned it on but DID NOT join a network and it worked fine. Here is the command i used:

    sudo ifconfig en1 lladdr 00:11:22:33:44:55

    I hope i helped. If not i'll try to look more into the problem with my friend's macbook pro.
  • dudu
    it doesn't work properly.
    if i change the mac address, I get "Connection Timeout" message everytime i try to join any connection.
    If i change back to the original MAC address it works good again.
    it's not useful, someone help me, please...
  • andy111
    yep, same for me.
    doesnt work, get connection timeout.
    if i return mac to original, all good again....
    i'm using macbook pro.
  • Robert
    No it does not work for most people, I would like to find the solution. Apparently Apple had removed the ability to change it in the update to snow leopard, it worked in Leopard... I like the GUI and many aspects of the apple OS X but if this is their standard, well I will then think on alternative solutions in unix and start buying regular pc's and just run unix off them.
  • That's cool. I didn't know you could change your MAC address. Oh the possibilities.
blog comments powered by Disqus