In order to communicate or transfer the data from one computer to ano**ther computer, we need some address. In Computer networks various types of addresses are introduced; each works at a different layer. Media Access Control Address is a physical address that works at the Data Link Layer.
Need of changing MAC Address:
- To bypass MAC Address filtering
- To bypass certain kind of MITM spoofing attack
- To avoid device tracking in a public network
There are many other tasks like becoming anonymous in a network and to avoid some network attacks where changing MAC Address becomes useful.
SOURCE CODE
#!/usr/bin/python2
import subprocess
#using this script you can also change your different kinds of wireless interface card mac addresses just replace eth0 with your wireless interface card name
subprocess.call("ifconfig eth0 down",shell=True)
subprocess.call("ifconfig eth0 hw ether 00:11:22:33:44:66",shell=True)
#00:11:22:33:44:66 it is just a example you can put any random mac address
subprocess.call("ifconfig eth0 up",shell=True)
subprocess.call("ifconfig")
OUTPUT
If you encountered any errors or doubts, please feel free to ask in the comments. I hope you enjoyed creating this small tool.