WEBVTT

00:00.660 --> 00:06.750
When it comes to networking you probably heard of the term MAC address a lot.

00:06.750 --> 00:13.230
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

00:13.230 --> 00:13.950
it.

00:20.120 --> 00:23.150
MAC address stands for media access control.

00:23.600 --> 00:31.520
It's a permanent physical and unique address assigned to network interfaces by the device manufacturer.

00:31.610 --> 00:38.660
So whether you have a wireless card or wired or Internet card each one of these network cards come with

00:38.660 --> 00:41.980
a specific address that is unique to this card.

00:41.990 --> 00:48.890
So there is no two devices in the world that would have the same MAC address and this address will always

00:48.890 --> 00:49.960
be the same.

00:49.970 --> 00:56.180
To this specific device even if you unplug it from your computer connected to another computer then

00:56.180 --> 01:03.970
this network device will always have the same address so you might already know that the IP address

01:04.240 --> 01:11.730
is used in the internet to identify computers and communicate between devices on the Internet.

01:11.920 --> 01:20.620
The MAC address is used within the network to identify devices and transfer data between devices so

01:20.650 --> 01:27.850
each piece of data or packet that is sent within the network contains a source Mark and a destination

01:27.850 --> 01:28.920
mark.

01:28.930 --> 01:37.480
Therefore this packet would flow from the source Mark to the destination mark so because this is a physical

01:37.480 --> 01:45.280
unique address to each interface to each network device and because it is used to identify devices then

01:45.280 --> 01:49.720
changing it will make you anonymous on the network.

01:49.720 --> 01:56.380
Not only that but the MAC address is often used by filters to prevent or allow devices to connect to

01:56.380 --> 02:00.070
networks and do specific tasks on the network.

02:00.070 --> 02:05.860
So being able to change your MAC address to another device as MAC address will allow you to impersonate

02:05.860 --> 02:10.970
this device and allow you to do things that you might not be able to do.

02:11.080 --> 02:17.350
So you'll be able to bypass filters or connect to networks that on these specific devices with specific

02:17.350 --> 02:24.740
MAC addresses can connect to and you will also be able to hide your identity no change in the MAC address

02:24.740 --> 02:26.350
is very very simple.

02:26.360 --> 02:30.260
So let me show you how to do that first of all.

02:30.290 --> 02:39.950
I'm going to use the if conflict command to list all the network interfaces available on my Kelly machine.

02:39.950 --> 02:46.400
What I mean by network interface is any device that allow us to connect to a network.

02:46.400 --> 02:50.210
So an example is a WI-FI card or an internet card.

02:50.330 --> 03:00.030
And so on so you can see first of all we have 88 0 and this is a virtual interface created by virtual

03:00.030 --> 03:00.660
box.

03:00.780 --> 03:04.450
When we said Cally to use an ad network.

03:04.890 --> 03:08.900
So you can see the interface name is 88 0.

03:08.940 --> 03:13.810
You can see it has an IP address because like I said it's connected to a network.

03:13.830 --> 03:18.560
So if we go here we can see it say in wired connected.

03:18.610 --> 03:25.210
So this is the interface that represents the wired network that Kali is connected to which is actually

03:25.210 --> 03:27.820
a virtual not network.

03:27.850 --> 03:34.840
You can also see the net mask the broadcast and a really important piece of information which is the

03:34.840 --> 03:36.150
other.

03:36.340 --> 03:42.060
This is the MAC address of this virtual interface.

03:42.350 --> 03:49.370
Now you can see similar information for my other two interfaces the ELO and the line zero.

03:49.400 --> 03:55.450
The only thing is you can see for both of these interfaces we do not have an IP address.

03:56.240 --> 04:03.130
And the main reason for that is because none of these interfaces is connected to a network.

04:03.440 --> 04:12.350
Now elo is the default interface created by Linux and land zero is my real wireless adapter so I can

04:12.350 --> 04:20.990
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

04:21.170 --> 04:29.310
because I actually didn't connect to any network and that's why it does not have an IP address.

04:29.440 --> 04:35.710
Now this doesn't matter because what we want to do is to just change the MAC address which again is

04:35.710 --> 04:44.650
shown here under the other part so similar to what you're seeing here for 88 0 now in order to change

04:44.860 --> 04:47.480
any of the values that you see here.

04:47.560 --> 04:52.070
You have to first disable the interface.

04:52.180 --> 04:58.790
So in this example we want to change the MAC address so that is represented by the other.

04:58.900 --> 05:08.010
And the value is right here so in order to disable an interface we're going gonna do if config followed

05:08.010 --> 05:15.560
by the interface name which is land zero in my example followed by down to disable it.

05:15.720 --> 05:19.720
Now if I had enter you'll see the command runs with no errors.

05:19.770 --> 05:26.850
So it means that it got executed properly and the next thing that we need to do is to change the option

05:27.030 --> 05:28.780
that we want to change.

05:28.830 --> 05:33.780
And in this example we want to change the other which is the MAC address.

05:34.840 --> 05:41.640
So first we're going to type if config we're going to type the interface that we want to change one

05:41.640 --> 05:50.900
of its options then we're going to type the option that we want to change and what we want to change

05:51.200 --> 05:53.090
is the hardware address.

05:53.150 --> 06:01.060
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

06:01.120 --> 06:02.550
address too.

06:02.590 --> 06:11.880
So for example I'm going to use 0 0 1 1 2 2 3 3 4 4 5 5 very very simple.

06:11.880 --> 06:18.280
Command will do an if config lands Euro to select the interface that we want to change its option.

06:18.450 --> 06:25.950
We want to set the hardware address and we want to set this address to this specific address so you

06:25.950 --> 06:30.390
can use any address that you want to follow in the same format shown here.

06:30.390 --> 06:34.690
Just make sure your address starts with 0 0.

06:34.950 --> 06:41.310
So I'm going to hit enter and again we don't see any error messages so it means the command get executed

06:41.310 --> 06:42.570
properly.

06:42.570 --> 06:49.650
And finally we just need to enable the interface because we disabled it by doing if config lines zero

06:49.650 --> 06:50.430
down.

06:50.430 --> 07:00.410
So we just need to do if config lines zero up to enable it now the interface is enabled.

07:00.520 --> 07:09.960
If we do if config again and look at the other part in here you can see that it is changed to the MAC

07:09.960 --> 07:13.730
address that we specified.

07:14.020 --> 07:15.070
Now this is done.

07:15.190 --> 07:16.780
And your MAC address is changed.

07:16.870 --> 07:24.190
Now you can go ahead and start using the interface and it will appear to have this MAC address instead

07:24.190 --> 07:26.260
of its original MAC address.

07:26.350 --> 07:30.460
And like I said this can be useful in so many scenarios.

07:32.070 --> 07:37.200
Now keep in mind the MAC address will revert back to the original one.

07:37.230 --> 07:44.010
Once you restart the computer because we're only changing the MAC address in memory we're not really

07:44.010 --> 07:46.190
changing the physical MAC address.

07:47.070 --> 07:54.300
But if you're MAC address is resetting to the original one without restarting then something is going

07:54.300 --> 08:00.810
wrong and it's probably happening because your network manager is resetting the MAC address.

08:01.020 --> 08:07.020
Not everybody will face this issue so I'm not going to cover it in this lecture but if you faced this

08:07.020 --> 08:13.560
issue if your mac address goes back to the original one without restarting the computer then checkout

08:13.740 --> 08:19.410
the YouTube video in the resources of this lecture it'll show you how to fix this issue.
