WEBVTT

0
00:01.080 --> 00:05.780
From the previous lectures we learned the basics of how networks work.

1
00:06.240 --> 00:12.860
We learned that devices on the same network communicate with each other using packets.

2
00:13.240 --> 00:17.160
So regardless of what you do on the network, whether you're watching a video,

3
00:17.160 --> 00:22.220
whether you're logging into a website, sending chat messages, sending emails.

4
00:22.220 --> 00:26.960
Regardless of what you're doing, all the data is sent as packets.

5
00:27.920 --> 00:36.400
Now in the network, devices ensure that these packets go in the right direction using the MAC address.

6
00:36.820 --> 00:44.920
So each packet has a source MAC and a destination MAC and it flows from the source to the destination.

7
00:44.920 --> 00:49.800
So in this example, we have the client, it
has this MAC, we have the access point,

8
00:49.800 --> 00:56.500
which has this MAC and as an example if this client wanted to send a packet to the router,

9
00:56.500 --> 01:01.700
it will set the destination MAC to the routers MAC address.

10
01:02.340 --> 01:07.860
Therefore, by default each device only receives data

11
01:07.860 --> 01:13.460
that has the destination MAC as its own MAC address.

12
01:14.220 --> 01:17.800
But if you remember, I said in wireless networks,

13
01:17.860 --> 01:22.640
if you are within range, then you'll be able to capture all of this communication

14
01:22.640 --> 01:26.260
because these packets are literally sent
in the air.

15
01:26.260 --> 01:32.120
So we can just capture them, even if they do not have our MAC address as the destination MAC.

16
01:33.660 --> 01:38.780
To do this, we need to change the mode of operation of our wireless interface,

17
01:38.780 --> 01:42.800
so that it operates in monitor mode.

18
01:43.940 --> 01:45.520
So let me show you what I mean.

19
01:45.640 --> 01:51.040
If I go to 'my computer' here and run 'iwconfig' this time.

20
01:51.340 --> 01:54.880
So we see 'ifconfig', which lists all the interfaces.

21
01:55.260 --> 02:00.120
We can use 'iwconfig' to see the wireless interfaces only.

22
02:00.960 --> 02:05.900
And you can see we have LAN 0 right here, which is my external wireless adapter.

23
02:06.300 --> 02:11.560
And you can see the mode of this adapter is set to managed.

24
02:12.580 --> 02:18.700
What this means is basically this is the default mode of all wireless devices

25
02:18.700 --> 02:26.060
and what it means is, this device will only capture packets that has the destination MAC

26
02:26.060 --> 02:28.900
as the MAC address of this device.

27
02:28.900 --> 02:35.520
So basically it will only capture devices that are directed to my Kali machine.

28
02:36.680 --> 02:38.320
But this is not what we want.

29
02:38.560 --> 02:44.240
What we want is to be able to capture all the packets that are within our range.

30
02:44.340 --> 02:49.120
Even if they are sent to the router and even if they are set to another device.

31
02:50.120 --> 02:55.660
So to do this we need to set the mode to 'monitor mode' instead of 'managed mode'.

32
02:56.840 --> 03:02.640
So, as usual before you can change the options of your interface, you have to disable it

33
03:02.640 --> 03:06.500
and previously we've seen that we can do that by doing 'ifconfig',

34
03:06.500 --> 03:10.220
the device name, which is LAN 0 in my case, down.

35
03:11.720 --> 03:19.260
Then we can enable monitor mode, but before we do that, I'm actually going to run a command

36
03:19.260 --> 03:25.516
to kill any process that could interfere with using my interface in monitor mode.

37
03:26.500 --> 03:30.120
So the command that I'm going to run right now is not mandatory

38
03:30.120 --> 03:35.680
but running it will actually give you better results when you come to running the
attacks

39
03:35.680 --> 03:38.140
that you will learn as we go in the course.

40
03:38.920 --> 03:42.540
So this command is going to be 'airmon-ng check kill'.

41
03:44.760 --> 03:47.060
Now you'll notice when you're on this command,

42
03:47.060 --> 03:51.300
it will actually kill the network manager that usually runs in here.

43
03:51.640 --> 03:55.740
So you'll completely lose your internet connection.

44
03:56.100 --> 04:01.320
But this is no problem because we will only need to be in 'monitor mode'

45
04:01.480 --> 04:04.280
when we are running preconnection attacks.

46
04:04.500 --> 04:08.780
So attacks that do not require us to connect to any network.

47
04:08.780 --> 04:15.760
So we actually do not need internet connection to run any of the attacks that require monitor mode.

48
04:16.920 --> 04:22.600
Now we're going to enable monitor mode, so we're going to do 'iwconfig'

49
04:23.340 --> 04:29.040
followed by the interface name that we want to enable monitor mode on, which is LAN 0.

50
04:29.920 --> 04:35.440
We're going to say that I want to change the mode and I want to change that to monitor.

51
04:36.460 --> 04:41.880
So very very simple command, we're using 'iwconfig' to change the mode.

52
04:41.880 --> 04:45.920
We're given the name of the interface that we want to change its mode.

53
04:45.920 --> 04:50.980
We're saying I want to change the mode and I want to set it to monitor mode.

54
04:52.220 --> 04:56.260
Now if I had enter, you'll see the command will run with no errors

55
04:56.260 --> 05:03.160
which means the command got executed properly and finally we'll need to enable the interface again.

56
05:03.160 --> 05:06.160
Similar to what we did when we change the MAC address.

57
05:06.260 --> 05:10.400
So we just have to do 'ifconfig LAN 0 up'.

58
05:11.840 --> 05:12.860
That's done.

59
05:12.860 --> 05:15.920
Now if I run 'iwconfig' again,

60
05:16.860 --> 05:20.260
you will see that the mode is set to monitor now.

61
05:21.320 --> 05:29.600
So basically this interface now can be used to capture any packet that is within our range.

62
05:29.600 --> 05:33.880
Not only the packets that are directed to this computer.

63
05:35.000 --> 05:40.120
That's why in the future you'll see how we can use it to sniff packets, to analyze them

64
05:40.120 --> 05:42.400
and even break into networks.

65
05:44.040 --> 05:50.760
So, in the future if I say use your interface in monitor mode, this is what I mean.

66
05:50.760 --> 05:55.000
You'll basically have to enable monitor mode as shown in here.

67
05:56.260 --> 06:01.380
Now I've also included a YouTube video in the resources of this lecture,

68
06:01.380 --> 06:05.580
to show an alternative method to enable monitor mode.

69
06:05.880 --> 06:08.900
Just in case you got errors with this method

70
06:08.900 --> 06:13.760
or you try to follow something that I do in the next lectures and it didn't work.

71
06:13.760 --> 06:17.360
Then you can come back and try the alternative method.

72
06:17.680 --> 06:23.800
But if this worked and if monitor mode is enabled successfully, then you don't need to watch that video,

73
06:23.800 --> 06:25.780
you can just continue with the course.

74
06:27.020 --> 06:33.560
One more thing to keep in mind, not all wireless adapters support monitor mode.

75
06:33.720 --> 06:39.700
So for this to work, you need to make sure that your actual adapter supports monitor mode.

76
06:40.200 --> 06:42.960
There are a number of adapters that support that

77
06:42.960 --> 06:50.120
and I've included another video again in the resources of me talking about wireless adapters.

78
06:50.120 --> 06:51.740
How to pick the best one

79
06:51.740 --> 06:59.259
and which ones that I recommend and use when I'm testing the security of networks.