Install macchanger :
1
2 | sudo apt update
sudo apt install macchanger |
Change the MAC address to a random address
1 | sudo ifconfig wlan0 down |
Now, use macchanger with the -r parameter to change the MAC address to a random address.
1 | sudo macchanger -r wlan0 |
Once the MAC address is changed, turn on the network interface by executing the following command:
Now, Check the current MAC address by executing the following command:
Other Features of Macchanger
Note: Always turn off the network interface (as we did above) for every command that we will discuss below using the ifconfig command.
Change MAC address to a specific address
To change the MAC address to a specific address, -s parameter is used. You can enter the MAC address of your choice. Execute the following command to set the MAC address:
1 | sudo macchanger -m XX:XX:XX:XX:XX:XX <network_interface> |
1 | sudo macchanger -m 00:2t:d0:f0:r3:ee wlan0 |
Change MAC address to a random address (known vendor)
To change the MAC address to a random address but with a known vendor, -A is used. Don’t confuse it with -r parameter, -r also changes to a random address but with no vendor. Execute the following command with -A parameter:
1 | sudo macchanger -A wlan0 |
Change MAC address to a random address (same vendor)
To change the MAC address to a random address with the same vendor, -a is used. Execute the following command:
1 | sudo macchangern -a wlan0 |
Print a list of known vendors
To print the list of all the known vendors available, Execute the following command with -l parameter:
To list only the wireless network, Just type the keyword followed by the –list parameter,
Reset to the original MAC address
To change back to the original MAC address, execute the following command:
1 | sudo macchanger -p wlan0 |
However, once you reboot the system, your spoofed MAC address will change back to its original MAC address automatically.