Skip to content

Instantly share code, notes, and snippets.

@sunpig
Forked from sigmaris/spoof_wifi.sh
Created June 6, 2016 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sunpig/e660a58932b147283c1148ca44ba581f to your computer and use it in GitHub Desktop.
Save sunpig/e660a58932b147283c1148ca44ba581f to your computer and use it in GitHub Desktop.
#!/bin/bash
IF=en0
MAC=`python << EOF
import random
print ":".join("%02X"%x for x in (random.randint(0, 255) for _ in range(6)))
EOF
`
echo "resetting wifi on $IF, rotating mac $MAC"
scselect -n
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -z
ifconfig $IF link $MAC
networksetup -setairportnetwork $IF VirginTrainsEC-WiFi
echo "= MAC is now: ="
ifconfig $IF link
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment