When it comes to networking you probably heard of the term MAC address a lot.
So in this lecture I'm going to cover what do we mean by MAC address what it's used for and how to change
it.
MAC address stands for media access control.
It's a permanent physical and unique address assigned to network interfaces by the device manufacturer.
So whether you have a wireless card or wired or Internet card each one of these network cards come with
a specific address that is unique to this card.
So there is no two devices in the world that would have the same MAC address and this address will always
be the same.
To this specific device even if you unplug it from your computer connected to another computer then
this network device will always have the same address so you might already know that the IP address
is used in the internet to identify computers and communicate between devices on the Internet.
The MAC address is used within the network to identify devices and transfer data between devices so
each piece of data or packet that is sent within the network contains a source Mark and a destination
mark.
Therefore this packet would flow from the source Mark to the destination mark so because this is a physical
unique address to each interface to each network device and because it is used to identify devices then
changing it will make you anonymous on the network.
Not only that but the MAC address is often used by filters to prevent or allow devices to connect to
networks and do specific tasks on the network.
So being able to change your MAC address to another device as MAC address will allow you to impersonate
this device and allow you to do things that you might not be able to do.
So you'll be able to bypass filters or connect to networks that on these specific devices with specific
MAC addresses can connect to and you will also be able to hide your identity no change in the MAC address
is very very simple.
So let me show you how to do that first of all.
I'm going to use the if conflict command to list all the network interfaces available on my Kelly machine.
What I mean by network interface is any device that allow us to connect to a network.
So an example is a WI-FI card or an internet card.
And so on so you can see first of all we have 88 0 and this is a virtual interface created by virtual
box.
When we said Cally to use an ad network.
So you can see the interface name is 88 0.
You can see it has an IP address because like I said it's connected to a network.
So if we go here we can see it say in wired connected.
So this is the interface that represents the wired network that Kali is connected to which is actually
a virtual not network.
You can also see the net mask the broadcast and a really important piece of information which is the
other.
This is the MAC address of this virtual interface.
Now you can see similar information for my other two interfaces the ELO and the line zero.
The only thing is you can see for both of these interfaces we do not have an IP address.
And the main reason for that is because none of these interfaces is connected to a network.
Now elo is the default interface created by Linux and land zero is my real wireless adapter so I can
use it to connect to Wi-Fi networks but if I go on the network and here you'll see Wi-Fi is not connected
because I actually didn't connect to any network and that's why it does not have an IP address.
Now this doesn't matter because what we want to do is to just change the MAC address which again is
shown here under the other part so similar to what you're seeing here for 88 0 now in order to change
any of the values that you see here.
You have to first disable the interface.
So in this example we want to change the MAC address so that is represented by the other.
And the value is right here so in order to disable an interface we're going gonna do if config followed
by the interface name which is land zero in my example followed by down to disable it.
Now if I had enter you'll see the command runs with no errors.
So it means that it got executed properly and the next thing that we need to do is to change the option
that we want to change.
And in this example we want to change the other which is the MAC address.
So first we're going to type if config we're going to type the interface that we want to change one
of its options then we're going to type the option that we want to change and what we want to change
is the hardware address.
So we're going to do hate w you then we're going to give it the address that we want to change the MAC
address too.
So for example I'm going to use 0 0 1 1 2 2 3 3 4 4 5 5 very very simple.
Command will do an if config lands Euro to select the interface that we want to change its option.
We want to set the hardware address and we want to set this address to this specific address so you
can use any address that you want to follow in the same format shown here.
Just make sure your address starts with 0 0.
So I'm going to hit enter and again we don't see any error messages so it means the command get executed
properly.
And finally we just need to enable the interface because we disabled it by doing if config lines zero
down.
So we just need to do if config lines zero up to enable it now the interface is enabled.
If we do if config again and look at the other part in here you can see that it is changed to the MAC
address that we specified.
Now this is done.
And your MAC address is changed.
Now you can go ahead and start using the interface and it will appear to have this MAC address instead
of its original MAC address.
And like I said this can be useful in so many scenarios.
Now keep in mind the MAC address will revert back to the original one.
Once you restart the computer because we're only changing the MAC address in memory we're not really
changing the physical MAC address.
But if you're MAC address is resetting to the original one without restarting then something is going
wrong and it's probably happening because your network manager is resetting the MAC address.
Not everybody will face this issue so I'm not going to cover it in this lecture but if you faced this
issue if your mac address goes back to the original one without restarting the computer then checkout
the YouTube video in the resources of this lecture it'll show you how to fix this issue.