Created
January 23, 2023 00:17
-
-
Save Winston-Lin-9527/85186e2870bb9d4754a9dff6b686584b to your computer and use it in GitHub Desktop.
Extend Wifi usage indefinitely on your macbook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Rock on free cafe or library wifi that impose horrendous limit on your usage. | |
# It spoofs your device's MAC address, run it once to turn on, twice to turn off. You get a random MAC addr everytime. | |
# So to extend on an existing spoofing session, turn off, then turn on again. | |
# Winston Lin @ 2023 | |
# | |
#!/bin/bash | |
# disconnect the wifi | |
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -z | |
CUR_MAC=$(ifconfig en0 | grep ether | cut -c 8-) | |
echo $CUR_MAC | |
echo $REAL_MAC_ADDR | |
if [ $CUR_MAC = $REAL_MAC_ADDR ] | |
then | |
MAC_TO_SET=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//') | |
else | |
MAC_TO_SET=$REAL_MAC_ADDR | |
fi | |
sudo ifconfig en0 lladdr $MAC_TO_SET | |
sudo ifconfig en0 ether $MAC_TO_SET |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment