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.
Changing MAC Address in Linux Machine: In Linux, a simple way to change MAC address is by using
If it is not already installed, we can install it using:
sudo apt-get update sudo apt-get install ifconfig
After installing this package, we can change the MAC Address using:
sudo ifconfig <interface-name> down sudo ifconfig <interface-name> hw ether <new-mac-address> sudo ifconfig <interface-name> up
We can see the list of interfaces using:
Automation using Python: Since it is not possible for us to manually change the MAC Address every time, we can automate the process of changing the MAC Address using Python. This script will keep changing the MAC Address in a constant period of time.
Below is the implementation of above idea.
- Python script to get device vendor name from MAC Address
- Extracting MAC address using Python
- How to install requests in Python - For windows, linux, mac
- Python Script to change name of a file to its timestamp
- Run python script from anywhere in linux
- Add a User in Linux using Python Script
- Deleting a User in Linux using Python Script
- How to download and install Python Latest Version on macOS / Mac OS X
- Python | Add Logging to a Python Script
- Competitive Coding Setup for C++ and Python in VS Code using Python Script
- Python script to open a Google Map location on clipboard
- Run Python script from Node.js using child process spawn() method
- Autorun a Python script on windows startup
- Python | Accepting Script Input
- Python Script to Shutdown Computer
- Python Script to Restart Computer
- Python Script to Logout Computer
- Running Python script on GPU.
- Get directory of current Python script
- How to Run a Python Script
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.