Media Access Control Address or shortly Mac address, is a unique number that assigned to a network interface controller or an IC for use as a network address and communication within network segment. Mac address is commonly used for IEEE 802 networking technologies, including Ethernet, Wi-Fi, and Bluetooth. Mac address are 12 digit hexadecimal code or number that retain in pairs separated by clones. Every device has their own Mac address. Windows has their own Mac address and Linux has their own Mac address.
Mac address as used for variety of purposes :
- Identify a device on a network system.
- Ensure that access of a controlling network.
- Finding network problem and solve them.
- Track a device.
- Track user behavior.
Actually when fast make address are arrived, it was used for Tracking devices and User behaviors.
What can a hacker do using Mac address?
- Device tracking : Hey hacker can track any device using a Mac address in various purposes. However, they can track any movement in the specific Mac address.
- Spoofing Attacks: MAC addresses can be spoofed. A hacker can change a device Mac address and use it to another network. However, hacker can bypass the network and commit malicious activities. Wi-Fi Spoofing, data control, data leak, user behavior control done by using Spoofing Attacks.
- Denial-of-Service (DoS) Attacks and Man-in-the-Middle (MITM) Attacks: A hacker can access any behavior by using Mac address. Also, they can control some data of how the owner of this Mac address are browsing on the Internet or any other specific website. Data can be leaked by a hacker using MAC Spoofing.
Change Mac address using command line with MAC changer tool :
- Open your terminal.
- First write command called “ifconfig”. This command will show you your device network status and all the information that you need like IP address, Mac address and other information’s.
- Then find your network name. It could be anything like eth0 or wal0 or enp0s3.
- Now you have to write command in your Administrator access. Write “sudo ifconfig <interface_name> down” . This command will take down your Internet system.
- Now install A tool that can change Mac address. The tool name is Mac Changer. The command is “sudo apt-get install macchanger”
- Now write the command “sudo macchanger -r <interface_name>”. This command will change Address randomly.
- Now just write a command “sudo ifconfig <interface_name> up” for connect to Internet with new mac address.
Change Mac address just using terminal :
- First open a terminal and write. “ifconfig” to see the status of current Mac address. Then find your network name. It could be anything like eth0 or wal0 or enp0s3.

- Now, write a command “sudo ifconfig <interface_name> down”. It will disconnected you from Internet.
- Write a command “sudo ifconfig <interface_name> hw ether <new mac address> “
- Now just write a command “sudo ifconfig <interface_name> up” for connect to Internet with new mac address.
Change Mac address Using Python :
- Using Python you can create your own mac address changing script. This script can change Mac address and this script can input new Mac address from user and change it.
- The Code is :
import subprocess
import time
subprocess.run(["ifconfig","enp0s3"], shell=True)
if __name__ == "__main__":
a = "ifconfig"
b = "enp0s3"
c = input("Enter New Mac Adress - ")
subprocess.run([a, b, "down"])
subprocess.run([a, b, "hw", "ether", c])
subprocess.run([a,b, "up"])
print("Netword is Shuting Down")
time.sleep(1)
print(f"New MAc is {c}")
time.sleep(1)
print("Netword is UP")
- The code as a main.py file.
- Now open the folder where you are saved main.py and open terminal in this folder.
- Now write a command “sudo python3 main.py”
- From this code you can remove all the time related code for is speed up your script.

Here is the sleep time removed code :
import subprocess
subprocess.run(["ifconfig","enp0s3"], shell=True)
if __name__ == "__main__":
a = "ifconfig"
b = "enp0s3"
c = input("Enter New Mac Adress - ")
subprocess.run([a, b, "down"])
subprocess.run([a, b, "hw", "ether", c])
subprocess.run([a,b, "up"])
print("Netword is Shuting Down")
print(f"New MAc is {c}")
print("Netword is UP")

Final word :
Changing my address can help you in various ways. You can be anonymous. Because MAC address can leak our data to hackers. Be careful. Changing Mac address can be also damage your system. However, thanks for reading this article.