Skip to content

Instantly share code, notes, and snippets.

@ppcamp
Created May 19, 2024 17:32
Show Gist options
  • Save ppcamp/87781b7521e98fa3bb33c4d12a570abb to your computer and use it in GitHub Desktop.
Save ppcamp/87781b7521e98fa3bb33c4d12a570abb to your computer and use it in GitHub Desktop.
MAC changer is a way to change the MAC address of your PC
if [ $# -lt 1 ];then
INTERFACE='enp2s0f0'
MAC='2C:76:8A:BB:D4:52'
else
INTERFACE=$1
MAC=$2
fi
sudo ifconfig $INTERFACE down & \
sudo ifconfig $INTERFACE hw ether $MAC & \
sudo ifconfig $INTERFACE up
printf "\033[1;32mMac changed sucessufuly! \033[0m \n"
echo "Current address: ${MAC}"
# ./macchanger.sh enp2s0f0 2C:76:8A:BB:D4:52
# ./macchanger.sh enp2s0f0 B8:AE:ED:82:FF:80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment