Skip to content

Instantly share code, notes, and snippets.

@Gestas
Last active January 30, 2023 19:14
Show Gist options
  • Save Gestas/6cca7750ec7f99aeb663e74cf6969cdb to your computer and use it in GitHub Desktop.
Save Gestas/6cca7750ec7f99aeb663e74cf6969cdb to your computer and use it in GitHub Desktop.
Quickly change the wifi mac address (.bashrc alias)
# quickly change the wifi mac address
# requires https://www.kali.org/tools/macchanger/ (sudo apt install macchanger)
if [ -x "/usr/bin/macchanger" ] ; then
wifiinterface="wlp2s0"
alias sudo='sudo '
alias random_wifi_mac="sudo ifconfig "$wifiinterface" down && sudo macchanger "$wifiinterface" -A && sudo ifconfig "$wifiinterface" up"
alias reset_wifi_mac=" sudo ifconfig "$wifiinterface" down && sudo macchanger "$wifiinterface" --permanent && sudo ifconfig "$wifiinterface" up"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment