MAC spoofing is a technique that allows us to change the MAC (Media Access Control) address of our electronic device. The MAC address is unique and coded within our electronic device in order to never change. It is located at the second layer of OSI and we can think of it as the physical address of our interface. Macchanger is a tool that helps us change the MAC address of our network card to any other until the next reboot. In this article we will see how we can install this tool on our computer as well as how we can use it.
How to install it
The installation of macchanger is only supported in a Linux. You will find it pre-installed in the well-known distro, Kali Linux.
Ubuntu & Debian
To install macchanger in ubuntu and debian , open a terminal and type the following commands:
| sudo apt-get update sudo apt-get install changer |
Fedora
To install macchanger in a fedora and debian environment, open a terminal and type the following commands:
| dnf install macchanger |
How to use it
To see the different parameters we can use in this tool we will open a terminal and run the following command:
| macchanger –options |
The result is shown below.
| root@kali:~# macchanger –option macchanger: unrecognized option '–option' 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 MAC hardware -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 –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 |
Let's now see how we can use it to change the MAC address of our network card.
First we will try to change the MAC address to a random one. To see the current status of our eth0 interface we will use the -s parameter:
macchanger -s eth0

To proceed with the change we need to "download" the interface using ifconfig:
| ifconfig eth0 down |
Next, we will change the MAC address to a random hexadecimal value:
| macchanger -r eth0 |

Now, we will reactivate interface and check its new elements:
| ifconfig eth0 up macchanger -s eth0 |

We see that the MAC address has changed. We can confirm this with the help of the ifconfig command:

Let's now try changing the MAC address of our network card to a string of our choice. To achieve this we will use the -m parameter:
| ifconfig eth0 down macchanger -m 00:d0:70:00:20:69 eth0 ifconfig eth0 up macchanger -s eth0 |

So we see that the address has changed.
Let's now see how we can use the -l parameter to find the prefix for each hardware manufacturer:
| macchanger -l |

What did you think? We are waiting for your comments..

