Sponsors



Editors' Picks


Comments

Contact Us

Apple Store Online

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!


Social bookmarks:


Comments:

Comments: 13

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

Write a comment