If you have been using Windows for some time, it can be annoying when you are trying new methods or tricks in your Linux Distro. Sometimes it can be tricky if you don’t know how to change the mac address of you Linux machine. It does not matter which distro you choose to work on because all Linux Operating Systems are based on UNIX. It gives the user the freedom to do whatever he wants.
How to change the MAC address of your Linux System?
We are going to use macchanger to change the MAC address of our system. Although all new distro usually come have the MACCHANGER tool built-in but if you cannot find it for your system, you can simply install it with the command line.
How to access root?
To access macchanger, login into your root/super user from the terminal.
[boogieman@b00gi3m4n ~]$ sudo su [sudo] password for boogieman: <your password here> [root@b00gi3m4n boogieman]$
This will allow you to access your root directories and tools. All Linux distro need the root access to perform any kind of action (besides the most basic actions).
Now you need to see if your OS has macchanger built-in.
[root@b00gi3m4n boogieman]# macchanger GNU MAC Changer Usage: macchanger [options] device Try `macchanger --help' for more options. [root@b00gi3m4n boogieman]#
If it is available, you will see this message, if not, you can simply install it using your terminal. I am using Fedora 31, but your distro might be different. To install for your distro follow these commands (make sure you are in root else you need to use sudo as a prefix) :
For Fedora 23 and newer
# dnf install macchanger
dnf is available for Fedora version 23 and newer.
Other Fedora versions
#yum install macchanger
#apt install macchanger
#apt-get install macchanger
#yum install macchanger
#zypper install macchanger
You can also use this too
#zypper in macchanger
#pacman -S macchanger
#emerge --ask macchanger
#xbps-install -S macchanger
#eopkg install macchanger
Now that you have macchanger installed, all you need to do is change your mac address. Follow the steps mentioned below:
Steps to follow (Find your Network interface configuration)
You need to know where can you find your current mac address. It tells the macchanger the location of your network interface configuration. It can be found with ifconfig command for most OS. You need root access for that too
[root@b00gi3m4n boogieman]# ifconfig enp1s0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether XX:XX:XX:XX:XX:XX txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 16 [root@b00gi3m4n boogieman]#
The XX:XX:XX:XX:XX:XX mentioned next to ether is your Mac Address. Obviously I have hidden it for security purposes but as you can see it is a combination of 12 letters and numbers. The Name tcqueuelen mentioned next to the Mac address is the name of the hardware manufactureurer.
First 3 segments decide the name of the hardware manufacturer. Since they are burnt in the memory, we cannot permanently change it. This is why we spoof the Mac address whenever we need it. It is easy, flexible and reliable.
You can always use help command to see available commands for your macchanger
[root@b00gi3m4n boogieman]# macchanger -h GNU MAC Changer Usage: macchanger [options] device -h, --help Print this help -V, --version Print version and exit -s, --show Print the MAC address and exit -e, --ending Don't change the vendor bytes -a, --another Set random vendor MAC of the same kind -A Set random vendor MAC of any kind -p, --permanent Reset to original, permanent hardware MAC -r, --random Set fully random MAC -l, --list[=keyword] Print known vendors -b, --bia Pretend to be a burned-in-address -m, --mac=XX:XX:XX:XX:XX:XX Set the MAC XX:XX:XX:XX:XX:XX Report bugs to https://github.com/alobbs/macchanger/issues [root@b00gi3m4n boogieman]#
Now that everything is set, all we have to change the mac address by using the macchanger
By using -a you can change your current mac to a completely new mac address. It looks into the available hardware manufacturers and assigns a new mac with the same initials as the manufacturer and random last 3 segments. See the example below
[root@b00gi3m4n boogieman]# macchanger -a enp1s0 Current MAC: 00:1b:50:68:87:ba (Nizhny Novgorod Factory named after M.Frunze, FSUE (NZiF)) Permanent MAC: 20:89:84:xx:xx:xx (COMPAL INFORMATION (KUNSHAN) CO., LTD) New MAC: 00:00:c3:dc:cd:39 (HARRIS CORP COMPUTER SYS DIV) [root@b00gi3m4n boogieman]#
It means you can change the mac address however you want. If you want your mac address something like aa:11:bb:22:cc:33, you can do it with -m
[root@b00gi3m4n boogieman]# macchanger -m aa:11:bb:22:cc:33 enp1s0 Current MAC: 00:00:c3:dc:cd:39 (HARRIS CORP COMPUTER SYS DIV) Permanent MAC: 20:89:84:xx:xx:xx (COMPAL INFORMATION (KUNSHAN) CO., LTD) New MAC: aa:11:bb:22:cc:33 (unknown) [root@b00gi3m4n boogieman]#
In case if you wanna see the list of the manufacturers, you have to do -l. You don’t need the network interface configuration (enp1s0 here) this time.
[root@b00gi3m4n boogieman]# macchanger -l 0018 - 00:09:5b - Netgear MA701, MA401RA 0019 - 00:09:7c - Cisco AIR-LMC352 0020 - 00:09:e8 - Cisco AIR-LMC352 0021 - 00:0a:41 - Cisco AIR-PCM352 0022 - 00:0a:8a - Cisco AIR-PCM352 0023 - 00:30:65 - Apple Airport Card 2002 0024 - 00:30:ab - Netgear MA401 0025 - 00:30:bd - Belkin F5D6020 0026 - 00:40:96 - Cisco AIR-PC4800, 350, AIR-PCM340, AIR-PCM352 0027 - 00:50:08 - Compaq WL100
It gives a huge list but there is no point in adding it here, I am just going to add a snapshot of that list. You can see that list for yourself on your own terminal and assign a spoofed mac address at your will.
Controlled Mac with Manufacturer details
Sometimes you need to change your mac address in a way that it looks authentic and it is coming right from a real person. In order to do that, you need the first 3 blocks of the mac address you want to spoof. Check out the manufacturer list and how to see it here (the one I mentioned above)
Check out the list and use first 3 blocks of the mac address and add 3 random blocks next to it.
[root@b00gi3m4n boogieman]# macchanger -m 00:09:e8:11:22:33 enp1s0 Current MAC: 00:60:01:33:ab:39 [wireless] (Lucent WaveLAN Silver) Permanent MAC: xx:xx:xx:xx:xx:xx New MAC: 00:09:e8:11:22:33 [wireless] (Cisco AIR-LMC352) [root@b00gi3m4n boogieman]#
This tutorial/guide teaches you how to change your mac address. It is for educational purposes only. Indulging in any illegal activity and misusing this without the written permission of the party is a criminal offense and we DO NOT promote any illegal activity. It is advised to use it only for educational/white hat purpose.
If you liked it found it informative, please do share it on your social media and with your friends. It helps us keep the blog running and so much more can be shared in lesser time. It only takes a click.