How To Spoof Your MAC Address in Mac OSX

how to spoof mac address on osx

Last updated: July 23 2017

Today you'll learn how to spoof (change) your MAC address in Mac OSX, and reasons why you should.

For starters, a MAC address is a unique 12-digit number that's hard-coded on the network interface card (NIC) of a device.

Most internet-connected devices have a unique MAC address. From cell phones, computers, wireless cameras, baby monitors and gaming consoles.

If a device can connect to the internet or communicate with other devices via wired, wireless, or bluetooth - it has a MAC address.

A device can have more than one MAC address if it has multiple network interfaces.

For example. If your laptop has ethernet (wired) and wifi capabilities, each interface will have a different MAC address.

What is the purpose of a MAC address?

A MAC address is used to uniquely identify a device on the local network.

A local network comprises of the devices connected to the same network/wifi as you, including the router.

Such devices communicate using their MAC address. This is how they can differentiate between two of the same devices.

For instance.​

If there are two iPhones using the same name and connected to the same network, the router won't be confused because both devices have a unique MAC address that which they use to communicate.

Similarly.

It's not possible for two devices with the same MAC address to coexist on a network.

Why? Because the network will get confused and neither devices will be able to connect to the network; thus, every device must have a unique MAC address.

Who can see my MAC address?

For a MAC address to be seen, the device must be active and communicating via wired, wireless or bluetooth.

If the device is powered off then nothing is broadcasted.

When the device is connected and being used, the MAC address is visible to:

  • Your router and routers nearby.
  • Devices connected to the same network/wifi as you.
  • Wireless sniffers (people capturing wireless data traveling through the air)

Can a MAC address be traced?

Some people might think that, if their device was stolen, it'd be possible for them to trace its location by knowing the MAC address.

This is just not possible, as MAC addresses are NOT traceable.​

Unlike a public IP address, which is transmitted over the internet, a MAC address is only visible on the local network. It doesn't travel to the outside world.

Even if your MAC address was somehow leaked online, it's not something people can simply look up and get the GPS coordinates, like they would with an IP address.

The only vulnerability that lies with a MAC address is the ability to determine the manufacturer or model of the device being used.

This can be done by using a MAC vendor lookup tool.

Furthermore.

The closest thing someone can get to "tracing" a MAC address is to associate it with a person. And the only way to do that is to be close enough to the device while it's being used.​

At the end of the day, a MAC address is just a bunch digits assigned by the manufacturer of your device.

Why should I spoof my MAC address?

Spoofing your MAC address has many benefits.

For one, spoofing protects you from device monitoring and logging.

If you didn't know, every network you connect to wether home, friends, or public wifi, keeps a log of your MAC address.

Whoever is in charge of the network can see information such as when you connected to the network and for how long.

If you connect to the same network on a regular basis, anyone paying attention or monitoring the network can easily figure out which MAC address belongs to you.

All they have to do is wait for you to walk in, sit down, open your laptop and connect to the wifi. As soon as this happens, a public handshake takes place between your device and the router.

And that handshake, which can be easily captured by anyone, contains your MAC address.

TIP: To protect from device logging, always use a new MAC address each time you connect to a public network.

If you're always using public wifi, you're essentially leaving traces of your device (MAC address) on those networks.

Click to Tweet

Important details about MAC addresses

  • MAC is short for Media Access Control.
  • A MAC address is hard-coded on the network interface card (NIC) of the device itself.
  • A MAC address is used to uniquely identify a device on the local network; it's also commonly referred to as the physical address of a device (on the local network).
  • Every MAC address is unique. Two iPhones don't have the same MAC address.
  • No other device can have the same exact address as you (unless spoofed).
  • Two devices with the same MAC address cannot coexist on the network (it will lead to connection problems).
  • A MAC address can be changed or spoofed temporarily for as long as the network card supports it. 
  • Your MAC address is NOT visible or shared on the internet. It's only visible to devices within the same network (or wifi), and to nearby "sniffers."
  • A MAC address cannot be traced to its exact location. In other words, if someone steals your laptop, then that shit is gone for good.

How to find MAC address on a Mac

Side note, I'm using Mac OSX El Capitan while creating this tutorial. 

1. First, open up the terminal application and type in:

ifconfig en0 | grep ether

NOTE: Use "en0" for wireless and "en1" for ethernet.

ifconfig command find mac address osx

How to find your MAC address via System Preferences

Go to System Preferences -> Network -> Advanced -> Hardware -> Mac Address.

find mac address on mac osx

How to spoof MAC address

1. To spoof your mac address, enter the following:

sudo ifconfig en0 ether 00-00-00-00-00-00

NOTE: Spoofing requires admin privileges.

If the address you entered doesn't work, try using one from a reputable vendor:

08:00:46:00:00:00
(Sony Corporation)

00:03:93:00:00:00
(Apple)


FC:F8:AE:00:00:00
(Intel Corporate)

FC:C7:34:FF:FF:FF
(Samsung Electronics Co.,Ltd)

2. Once complete. Run the code in step 1 to verify the change.

ifconfig command change mac address osx

How to fix connection issues when spoofing on Mac

1. You can fix connection issues by bringing the interface down and up:

sudo ifconfig en0 down && sudo ifconfig en0 up
bash command restart interfaces osx

You can also restart the interface by clicking “Turn Wi-Fi OFF” then “ON” on the top right of the screen.

To revert the changes (or return to your permanent MAC), simply restart your computer.​

Create a bash script for MAC spoofing (optional)

If you’re familiar with bash scripting, you can easily create a script that will automatically spoof your MAC address, so you don't have to keep entering the same commands repeatedly.

I've created a very basic script that allows you to change your MAC address.

This script will change your MAC address to "00:03:93:00:00:00"
If you want to change it to something different, simply replace the digits on the script.

Here’s how to use the script:

1. Create a script called spoofmac.sh (or whatever you want to name it)

nano spoofmac.sh

2. Copy and paste the following script:

#!/bin/bash
# Specify interface to spoof
INT="en0"
# Insert your NEW MAC address here
NEW="00:03:93:00:00:00"
echo "Run me as root, fam."
echo "Your current MAC: $(ifconfig $INT | grep ether | awk '{print $2}')"
sudo ifconfig $INT ether $NEW
sudo ifconfig $INT down && sudo ifconfig en0 up
sleep 1.50
echo "Your new MAC: $(ifconfig $INT | grep ether | awk '{print $2}')"
echo "Done."

If you want to use a different MAC address, replace "00:03:93:00:00:00" with your new MAC. So it should look like this: NEW="00:01:28:11:22:bb"

Replace the “en0” with your interface (if you’re using ethernet use en1). I'm using wireless so I have it set to en0.

3. Press “Ctrl + X” then “Y” then “Enter” to save the file.

4. Make the script executable.

chmod +x spoofmac.sh

5. Run the script.

./spoofmac.sh

Now whenever you need to spoof your MAC address, simply run the script as shown in step 5.

If you need to change to a different MAC address, replace the MAC address in quotes as shown in step 2.

That's it! If you found this useful, please let me know! If this didn't work for you, let me know as well so I can try my best to help you.

Click Here to Leave a Comment Below 0 comments

Leave a Reply: