Sponsors

Apple Store

Visit the official Apple Store to buy a Mac online. Free shipping!



Editors' Picks


Comments

Contact Us

Search

Top Posts

Categories

Recent Posts

Our Feeds


How to spoof your MAC address in Mac OS X

A MAC address is a unique identifier assigned to your network card, and some networks implement MAC address filtering as a method of security. Spoofing a MAC address can be desired for multiple reasons, and it is very easy to spoof your MAC address in both Mac OS X 10.4 and 10.5. For the purpose of this article, we are going to assume you want to spoof your Mac’s wireless MAC address. So without further ado, here’s a 3 step process on how to do it:

Retrieving your current MAC address

First, you’re going to want your current wireless MAC address so you can set it back without rebooting. Launch the Terminal and type the following command:
ifconfig en1 | grep ether
You’ll know see something like:
ether 00:12:cb:c6:24:e2
And the values after ‘ether’ makeup your current MAC address. Write this down somewhere so you don’t forget it. If you do, it’s not the end of the world, you’ll just have to reboot to reset it from a change.

Spoofing a MAC address

To spoof your MAC address, you simply set that value returned from ifconfig to another hex value in the format of aa:bb:cc:dd:ee:ff

For this example, we will set our wireless MAC address to 00:e2:e3:e4:e5:e6 by issuing the following command:
sudo ifconfig en1 ether 00:e2:e3:e4:e5:e6

The sudo command will require that you enter your root password to make the change.

Verifying the Spoofed MAC address worked

If you want to check that the spoof worked, type the same command as earlier:
ifconfig en1 | grep ether
Now you will see:
ether 00:e2:e3:e4:e5:e6
Meaning your MAC address is now the value you set it to. If you want to further verify the spoof, simply login to your wireless router and look at the ‘available devices’ (or attached devices) list, and your spoofed MAC address will be part of that list.

If you want to set your MAC address back to its real value, simply issue the above ifconfig commands with the MAC address that you retrieved in step 1. You can also reboot your Mac.

Enjoy!

Digg!

Comments:

Comments: 40

Comment from Nando Vieira
Time: January 17, 2008, 10:29 am

Is there any way to spoof the ethernet (en0) MAC Address? Used to work on Tiger, but stopped working after I upgraded to Leopard.

Comment from Allaire
Time: January 17, 2008, 11:49 am

I think you can spoof an ethernet address by doing sudo ifconfig en0 ether xx:xx:xx:xx:xx:xx

I find the wireless a lot more useful, and it shows just how weak the mac address filtering is as a security implementation on any network

Comment from Nando Vieira
Time: January 18, 2008, 9:48 am

Allaire, I need to use the ethernet connection because is the only one that’s available (at work, there’s no wireless). The command you sent still doesn’t work on Leopard.

Comment from ks
Time: January 26, 2008, 10:46 pm

Doesn’t work with ethernet connection. Works for my wireless. Any ideas how to get this to work for ethernet en0?

Comment from James Nevara
Time: January 28, 2008, 3:16 pm

Changing the above command to en0 worked for me in Mac OS X 10.4.11, I don’t have Leopard so I can’t verify:

sudo ifconfig en0 ether 00:e2:e3:e4:e5:e6

You can check if it worked by doing ifconfig, and your ethernet MAC address will be identified as that address

Pingback from Links van 13.01.2008 tot 02.02.2008 | Branders.name
Time: February 3, 2008, 3:51 am

[...] How to spoof your MAC address in Mac OS X - OS X DailySpoofing a MAC address can be desired for multiple reasons, and it is very easy to spoof your MAC address in both Mac OS X 10.4 and 10.5. [...]

Comment from Poptarts
Time: February 13, 2008, 6:48 pm

Changing or spoofing does not seem to work on the en0 (wired ethernet) of MacBook Pros even in 10.5.2. Does anyone know a way to resolve this issue?

Pingback from - simply chris - » Blog Archive » spoof mac-address in mac/linux
Time: February 23, 2008, 6:20 pm

[...] source link [...]

Pingback from - simply chris - » Blog Archive » spoof mac-address
Time: February 23, 2008, 6:35 pm

[...] mac - source link | win/*nix source [...]

Comment from Horuden
Time: March 2, 2008, 1:00 am

Is there anyway to make the new address stick after I reboot?

Comment from James Wu
Time: March 7, 2008, 2:42 am

en0 can’t not modify after version 10.5.x

Comment from Jose Vigenor
Time: March 10, 2008, 2:52 am

Mac OS X : How to Set the MAc Address During Startup

Follow these steps to create a script that sets the MAC Address each time the computer restarts:

1. Open Terminal (/Applications/Utilities/).
2. Type: cd /Library
3. Press Return.
4. Type: mkdir StartupItems
5. Press Return. (If you encounter an error, continue to step 6.)
6. Type: cd StartupItems
7. Press Return.
8. Type: mkdir MACADD
9. Press Return.
10. Type: cd MACADD
11. Press Return.
12. Type: pico MACADD
13. Press Return.
14. In the pico editor, paste in the following text.

Begin copying below this line.
——————————————————————————–

#!/bin/sh

. /etc/rc.common

##
# Configure a network interface MAC Address setting
##
#
# This script will set the MAC Address setting for the specified interface(s)
#
# The name of the interface (ex. en0) must be edited to match the interface
# to which the MACADD setting should be applied
#
##

StartService ()
{
ConsoleMessage “Configuring MACADD”

### uncomment lines and change the value following ‘MACADD’ as appropriate mac address

if [ "${MACADD:=-NO-}" = "-YES-" ]; then

# /sbin/ifconfig en0 lladdr xx:xx:xx:xx:xx:xx
# /sbin/ifconfig en1 lladdr xx:xx:xx:xx:xx:xx

fi

}

StopService ()
{
return 0
}

RestartService ()
{
return 0
}

RunService “$1″

——————————————————————————–

End copying above this line.

15. Uncomment the /sbin/ifconfig line(s) to set the MACADD for a particular interface.

Note: Removing the number sign (#) from the beginning of a line uncomments it. Typically, en0 is the interface name for the Built-in Ethernet port and en1 is interface name for the AirPort Card. This is not always the case, though. To confirm that a network port is associated with a particular interface name, open the Network Utility (/Applications/Utilities/), and click the Info tab.

16. When you have finished customizing the file, save it (press Control-O), press Return, and exit pico (press Control-X).

17. Type: chmod 755 MACADD

18. Press Return.

19. Type: pico StartupParameters.plist

20. Press Return.

21. In the pico editor paste in the following text.

Begin copying below this line.

——————————————————————————–

Description
Can set MACADD
OrderPreference
None
Provides

MACADD

Requires

Network Configuration

——————————————————————————–

End copying above this line.

22. When you have finished customizing the file, save it (Control-O), press Return, and exit pico (Control-X).
23. Type: chmod 755 StartupParameters.plist
24. Press Return.
25. Type: sudo pico /etc/hostconfig
26. When prompted, enter your password.
27. Press Return.
28. In the pico editor, add this line at the bottom:

MACADD=-YES-

29. Save it (Control-O), press Return, and exit pico (Control-X).

When you restart the computer, MACADD is set for the interface that you specified.

Notes

1. The MACADD will be reset after changing a Location, waking the computer from sleep, or changing the state of the network interface. To use the script again without having to restart, enter the following command:

sudo SystemStarter start MACADD

2. If you experience any issues or wish to not set MACADD during startup, you can turn off the new script by changing the MACADD line in /etc/hostconfig to:

MACADD=-NO-

Comment from Math
Time: March 18, 2008, 6:34 pm

Some correction on the StartupParameters.plist
————–

{
Description = “HomeMade boot param”;
Provides = (”MACADD”);
Requires = (”Network Configuration”);
OrderPreference = “None”;
}
———-

So far it is not working with en0 (LAN), but works fine with en1 (Wireless)
under leopard 10.5.2

Comment from akbarfoto
Time: May 15, 2008, 3:53 pm

i can confirm that en0 (lan) work with leopard. i guess it work on older mac such as powerbook, but not macbook. i use the “sudo ifconfig en0 lladdr”

System Version: Mac OS X 10.5 (9A581)
Kernel Version: Darwin 9.0.0
Boot Volume: external
Boot Mode: Normal
Computer Name: PowerBook G4 12″ - 867 MHz

Comment from ps
Time: June 8, 2008, 4:04 pm

(this post can be duplicated as the first submit attempt end up with some database errors, sorry if this is the case)

I’ve got Macbook w/ Leopard 10.5.3 - and I can confirm that
mac spoofing using ifconfig still doesn’t work with Leopard on ethernet i-face.

Akbarfoto says that it does work on powerbook,
so it might be the driver that does not support such
operation. Maybe it would be possible to use the old driver from Tiger in Leopard?

2nd thought: Has anyone tried to use USB LAN adapters to spoof MAC address?

Comment from SubliminalMac
Time: June 14, 2008, 10:56 pm

Dude, How does that “show how mac address filtering is so weak”? You would have to know the allowed mac addresses in the first place to put it in, and wouldn’t you have to be on the network or physically use the computer to know…

Comment from spacec0w
Time: June 20, 2008, 6:49 am

Jose Vigenor or anyone else that knows about these things

Trying to follow his intstructions I get this error when trying to make the MACADD directory. Any ideas? Have Mac OS X 10.5.3, Powerbook G4 1.5Ghz

Macintosh-3:startupitems chris$ mkdir MACADD
mkdir: MACADD: Permission denied

Comment from AdamB78
Time: June 21, 2008, 11:41 pm

Correction in the MACADD file (at least for Leopard)


ifconfig en0 ether xx:xx:xx:xx:xx:xx (xx in your vmx file)

instead of that other ifconfig command.

Got it from this thread:
http://pcwizcomputer.com/index.php?option=com_content&task=view&id=32&Itemid=32

Comment from Murphy Mac
Time: July 5, 2008, 11:39 am

Thanks guys. I’m in a hotel with my iPod touch and a laptop. Now I can use both on the property wifi. Thanks for filling a need the hotel should help with.

Comment from RancidFerret
Time: August 6, 2008, 11:11 pm

I’m new to Macs, so I could be doing something wrong, but…
Every time I try to do the “sudo ifconfig en1 ether 00:e2:e3:e4:e5:e6″ command it doesn’t work. I enter the password correctly, but when I check the mac address after with the “ifconfig en1 | grep ether” command it returns my default mac address.

I am on OSX 10.5.4 so it could be an issue with this release of Leopard. Has anyone else on 10.5.4 gotten it to work?

Comment from pha
Time: August 20, 2008, 5:11 am

Viagra is used to treat impotence in men. It increases the body’s ability to achieve and maintain an erection during sexual stimulation.
Viagra is used as needed, so you are not likely to miss a dose. If you miss a dose of Viagra, take the missed dose as soon as you remember. If it is almost time for your next dose,

cheap viagra

Comment from pharmacynews
Time: August 20, 2008, 6:00 am

very interesting weblog

Comment from Inspector Clouzot
Time: November 10, 2008, 7:54 am

Hmmm, why would I want to spoof my MAC address in the first place? What advantages to that and in which situations? Thanks…

Comment from Brian Allen
Time: November 13, 2008, 7:34 am

@ Inspector Clouzot

Spoofing your can be done for various reasons. Any Internet Service Providers can be expecting a specific MAC address prior to providing an IP address. You can using spoofing to provide the expected MAC address.

Where I work, they have a service issue which is caching my old MAC address and it prevents me logging in the next day if they service doesn’t drop my old connection. With a quick spoof of an MAC address, I can connect without waiting on IT to fix their problem.

Comment from female viagra
Time: November 30, 2008, 2:17 am

Looking for information and found it at this great site…

Comment from iBook G3
Time: January 15, 2009, 10:12 am

I’m having trouble spoofing my MAC.
I’ve done the right commands, and my original MAC address keeps coming back, well, the MAC address didn’t change in the first place. I was wondering if anyone else has had this problem, some tips would help. Also, I’m running Mac OS X 10.4.11
Thanks.

Comment from Cherooo
Time: January 30, 2009, 12:31 pm

Thank you for your articles

Comment from Cinainfiday
Time: February 6, 2009, 2:55 pm

thank you.

Comment from Kevin
Time: March 8, 2009, 12:19 am

Thanks for sharing!
But it doesn’t work on my macbook 10.5.6…
Kind regards,
Kevin

Comment from Usman Ismail
Time: March 10, 2009, 3:54 pm

for leopard

sudo ifconfig en0 lladdr 00:00:00:00:00:00

Comment from dee brown
Time: April 11, 2009, 8:07 am

running 10.5.6 you need to do the trick to disassociate from the network. ****DO NOT TURN AIRPORT OFF****. What you will have to do is click your airport and click join network and enter some bogus name as the network ssid. Then while it’s trying to connect click cancel.At this point you may spoof using the sudo ifconfig en1 ether command

Comment from MR
Time: April 25, 2009, 12:16 pm

Works like a charm on 10.5.6 thanks to dee browns’ trick :)

Comment from Kroaken
Time: May 28, 2009, 3:05 pm

Doesn’t work in 10.5.7 :/ mac spoof not working 10.5.7

Comment from Kroaken
Time: May 28, 2009, 3:05 pm

Doesn’t work in 10.5.7 :/ mac spoof not working 10.5.7

Comment from Benjamin
Time: May 31, 2009, 6:37 pm

@Kroaken: Use Dee Brown’s trick.

Comment from Spudz76
Time: June 18, 2009, 11:32 am

In Linux (yes, not OS X, but still UNIX style) the interface must be “down” first otherwise it’s considered to be in use and can’t be changed - so try this:
sudo ifconfig en0 down
sudo ifconfig en0 lladdr xx:xx:xx:xx:xx:xx
sudo ifconfig en0 up

Comment from Joe
Time: June 21, 2009, 9:51 am

Yup, use Dee Brown’s trick.

Comment from Adam
Time: June 28, 2009, 10:04 pm

Make sure that you are connected to the network interface that you would like to spoof for it to work. i.e. if I wanted to spoof my MAC address on the en1 (airport protocol), I would need to turn wifi on BUT not connect to any network then continue with the terminal process.

Comment from sjdude
Time: July 2, 2009, 9:08 am

Dee Brown’s trick works like a charm on Leopard 10.5.7. Summary, assuming you want to do this on a wifi connection:

1. Do not turn off airport
2. Choose “Join other network…” from the airport menu
3. Enter a bogus network name, e.g. fubar
4. In a terminal window, enter: sudo ifconfig en1 xx:xx:xx:xx:xx:xx: (your new MAC)
5. Choose the network you wish to join from the Airport menu

After step 4, if you want to verify you’ve really changed your MAC address, enter this into a terminal window:
ifconfig en1

and look for the “ether xx:xx:xx:xx:xx:xx:” value and it should match what you entered.

Comment from sjdude
Time: July 2, 2009, 9:22 am

Whoops, screwed up the summary. Please add:

3.1 Choose “Cancel” to leave en1 “on” but not associated

Write a comment







Social bookmarks:


January 17th, 2008