The reason hackers would want to change mac address is to gain access to networks while hiding who they really are. Mac spoofing for illegal purposes is beyond my responsibility.
In this tutorial we are going to see how we can change the mac address manually(by terminal) and using a simple python program that we are going to write.
So lets get started.
- Go to the terminal and type ifconfig to see list of network adapters we are connected to.

- Here, we are using a virtual machine. The WiFi adapter will be shown as Ethernet. If we had a dedicated WiFi adapter it would be seen here.
- Type “ifconfig [adapter name] down”-this will makes the network card stop sending packets.
- Ifconfig [interface name] hw ether [mac address] – this will set the mac address.
- ifconfig [interface name] up – it will make the card connected once more.

If we type ifconfig we can see the mac address changed.

Now let’s do it in Python:
Type the below code:

Output:


As you can see, we now have the mac address changed. You can run the python script anytime to spoof mac address.