Skip to content

Instantly share code, notes, and snippets.

@sigmaris
Created June 6, 2016 10:56
Show Gist options
  • Save sigmaris/b0dd2d1015b78c44fe2d1538dc30c924 to your computer and use it in GitHub Desktop.
Save sigmaris/b0dd2d1015b78c44fe2d1538dc30c924 to your computer and use it in GitHub Desktop.

Revisions

  1. sigmaris created this gist Jun 6, 2016.
    14 changes: 14 additions & 0 deletions spoof_wifi.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #!/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