Skip to content

Instantly share code, notes, and snippets.

@josePhoenix
Created December 6, 2011 03:49
Show Gist options
  • Save josePhoenix/1436632 to your computer and use it in GitHub Desktop.
Save josePhoenix/1436632 to your computer and use it in GitHub Desktop.
Spoof and despoof your MAC address
#!/bin/bash
# Return your MAC address to its hardware default
ORIGINAL="XX:XX:XX:XX:XX:XX"
echo "Hardware MAC address: $ORIGINAL"
echo -n "Current MAC address: "
ifconfig en1 | grep ether
echo -n "Dissociating from all networks.. "
sudo airport -z && echo "done"
echo -n "Resetting MAC address to $ORIGINAL.. "
sudo ifconfig en1 ether $ORIGINAL && echo "done"
exit 0
#!/bin/bash
# Spoof your MAC address to get around stupid captive portals that won't forget you
ORIGINAL="XX:XX:XX:XX:XX:XX"
FAKE="XX:XX:XX:XX:XX:XX"
echo "Hardware MAC address: $ORIGINAL"
echo -n "Current MAC address: "
ifconfig en1 | grep ether
echo -n "Dissociating from all networks.. "
sudo airport -z && echo "done"
echo -n "Spoofing MAC address to $FAKE.. "
sudo ifconfig en1 ether $FAKE && echo "done"
echo -n "Connecting to CINE.. "
sudo /usr/sbin/networksetup -setairportnetwork en1 CINE && echo "done"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment