Last active
August 29, 2015 14:26
-
-
Save royvandam/4f3da6f46d4ccf6fe45d to your computer and use it in GitHub Desktop.
Randomise your ethernet mac address for bypassing free wifi time limits.
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
#!/bin/bash | |
if=${1-en1} | |
function get_if_mac() { | |
local if=$1 | |
ifconfig en1 | grep ether | sed -e 's/^[[:space:]]ether //' | |
} | |
mac=$(get_if_mac $if) | |
while true; do | |
new_mac=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//') | |
echo "$mac -> $new_mac" | |
sudo ifconfig $if ether $new_mac | |
mac=$(get_if_mac $if) | |
[ ${new_mac} = ${mac} ] && break | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment