Skip to content

Instantly share code, notes, and snippets.

@ajinabraham
Last active December 9, 2023 06:53
Show Gist options
  • Save ajinabraham/dcdf6b7118f0e9eeba95d8d99ddfd394 to your computer and use it in GitHub Desktop.
Save ajinabraham/dcdf6b7118f0e9eeba95d8d99ddfd394 to your computer and use it in GitHub Desktop.
macOS WiFi MAC Address Spoofer
interface=en0
echo "Disconnecting from WiFi SSID"
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -z
echo "Turning down ${interface}"
sudo ifconfig -d $interface
mac=$(printf '02:00:00:%02X:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256)) $((RANDOM%256)))
echo "Generated Random MAC Address: ${mac}"
sudo ifconfig $interface ether $mac
echo "MAC address spoofed"
ifconfig $interface lladdr | grep ether
@ajinabraham
Copy link
Author

Run sudo ./mac-spoofer.sh
Tested on macOS Sonoma 14.1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment