Created
September 11, 2018 05:06
-
-
Save spencerdodd/6c577b34ce915d920371dec61c0e2a0c to your computer and use it in GitHub Desktop.
bashrc
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
alias python="python3" | |
GOPATH=~/Documents/programming/project | |
GOROOT=/usr/local/go/bin/ | |
pathval=$(echo $PATH) | |
if [[ $pathval != *"$GOROOT"* ]]; then | |
PATH=$GOROOT:$PATH | |
fi | |
randomize() { | |
echo "#############################################" | |
echo "########### Identity Randomizer #############" | |
echo "#############################################" | |
hostnamechange | |
macchange | |
} | |
hostnamechange() { | |
echo "#############################################" | |
echo "############# Hostname Changer ##############" | |
echo "#############################################" | |
echo '[*] getting sudo perms' | |
sudo echo ' [+] got sudo perms' | |
currenthostname="$(sudo scutil --get ComputerName)" | |
echo "[*] changing hostname ($currenthostname)" | |
newhostname="$(openssl rand -hex 16)" | |
sudo scutil --set HostName $newhostname | |
sudo scutil --set LocalHostName $newhostname | |
sudo scutil --set ComputerName $newhostname | |
echo "[+] new hostname ($newhostname)" | |
echo '[*] flushing DNS cache' | |
sudo dscacheutil -flushcache | |
} | |
macchange() { | |
echo "#############################################" | |
echo "############### MAC Changer #################" | |
echo "#############################################" | |
echo '[*] getting sudo perms' | |
sudo echo '[+] got sudo perms' | |
currentmac="$(ifconfig en0 | grep ether | cut -d' ' -f2)" | |
echo "[*] changing MAC (current: $currentmac)" | |
# randomly generate our new MAC | |
# use the vmware(?) MAC base to ensure we don't get an | |
# invalid MAC address | |
base="00:50" | |
newmac="$base:$(openssl rand -hex 4 | sed 's/\(..\)/\1:/g;s/.$//')" | |
echo "[*] enabling wifi to allow MAC changing" | |
# turn on the wifi adapter | |
sudo networksetup -setairportpower en0 on | |
# give it a second to get up | |
sleep 1 | |
# this is important...and it doesn't work without running this | |
# but idk why | |
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -z | |
retval="$(sudo ifconfig en0 ether $newmac 2>&1)" | |
if [[ $retval = *"Device power is off"* ]]; then | |
echo " [!] wifi isn't on for some reason..enable it manually" | |
return | |
fi | |
# not sure, not fully necessary, but fine | |
sudo networksetup -detectnewhardware | |
currentmac="$(ifconfig en0 | grep ether | cut -d' ' -f2)" | |
echo "[+] new MAC (new: $newmac)" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment