1 00:00:01,950 --> 00:00:03,150 Good afternoon. 2 00:00:03,310 --> 00:00:04,990 Thank you for coming to the talk. 3 00:00:05,790 --> 00:00:12,150 And yeah, it's the 33rd edition of WebCon, and it's better than ever. 4 00:00:13,090 --> 00:00:18,750 So, the talk, as you can see, is based on the title of the talk, as you can read, right? 5 00:00:18,750 --> 00:00:20,530 No radios, no problems. 6 00:00:25,270 --> 00:00:30,530 The title of the talk, as you can see, is No radios, no problems, Hacking Wi-Fi in the virtual world. 7 00:00:30,530 --> 00:00:41,750 So, what we are going to do in this is, we are going to talk about the first principles, the basics that you can use to emulate Wi-Fi in a VM, in a cloud, anywhere. 8 00:00:42,030 --> 00:00:49,030 And we will also discuss why it is important, what are the other easy ways of doing it. 9 00:00:49,270 --> 00:00:58,690 But the idea is, there are so many tools out there that you can use, but they don't really give you the full understanding of the basics that you are using. 10 00:00:58,690 --> 00:01:05,450 And some of these basics are also related to containers, you know, Docker containers, Podman, all the other things, right? 11 00:01:05,470 --> 00:01:10,030 So, we'll talk about them, and yeah, I'm looking forward to this. 12 00:01:11,230 --> 00:01:16,690 A little bit of introduction, my name is Nishant, I've been doing Wi-Fi for 10 years now. 13 00:01:16,970 --> 00:01:25,350 I was in cyber security education for almost all of my career, currently serving as the Head of Research at Square Enix. 14 00:01:25,350 --> 00:01:29,710 So yeah, this is my second time at RF Village. 15 00:01:30,370 --> 00:01:35,590 I have also taught Wi-Fi hacking classes at Black Hat for 2-3 years. 16 00:01:35,770 --> 00:01:37,370 So yeah, that's all. 17 00:01:38,370 --> 00:01:42,050 So first question is, why exactly do we want to do this? 18 00:01:42,310 --> 00:01:59,370 The simple answer is, you can buy one device, you can buy it for 2.4 GHz, you can buy it for 5 GHz, but then when things get more complicated, there is a limit to how many devices you will be able to buy, how many devices you will be able to set up, how many devices you will be able to play with, 19 00:01:59,370 --> 00:02:00,110 right? 20 00:02:00,290 --> 00:02:11,210 And if you want to simulate complicated scenarios, for example, you want to simulate 100 devices, 10 access points, they are connecting, disconnecting, they are moving farther, backward, right? 21 00:02:11,210 --> 00:02:14,590 And then you also want to do Wi-Fi security on it. 22 00:02:14,590 --> 00:02:22,090 When we talk about it, Wi-Fi security is your monitoring, after that you analyze it, and then you also attack the older schemes. 23 00:02:22,090 --> 00:02:28,130 We know that WPA3 is practically unhackable, if you want to put it that way, right? 24 00:02:28,130 --> 00:02:36,970 If you are not talking about social engineering and all the other kind of deceiving attacks, if you are talking about technical attacks, WPA3, they have kind of locked everything down. 25 00:02:36,970 --> 00:02:43,770 However, if you talk about WPA for some reason, WPA2 enterprise, you have your MSCHAP, V2 and all of that, right? 26 00:02:43,770 --> 00:02:49,230 That still you can hack, and a lot of places, that is what you are going to find as well till today, right? 27 00:02:49,230 --> 00:02:50,070 Even today. 28 00:02:50,370 --> 00:02:54,690 So if you want to practice that, these setups give you more flexibility. 29 00:02:55,390 --> 00:03:02,010 And the reason we had built this is because at one point of time, we were building Wi-Fi labs in the cloud. 30 00:03:02,010 --> 00:03:04,490 We did that, all of that worked great. 31 00:03:04,570 --> 00:03:06,470 So same things we are going to discuss. 32 00:03:06,470 --> 00:03:10,690 It's scalable, it is easy to set up, you can set up it in the cloud, in the VM. 33 00:03:10,690 --> 00:03:15,030 If you make a mistake, you just take it down, run it again, good as new, right? 34 00:03:15,050 --> 00:03:19,690 And for the new people who are trying to learn Wi-Fi security, it is very, very, very helpful. 35 00:03:19,690 --> 00:03:25,150 Because you don't have to deal with all the uncertainty that comes with real packet capture, right? 36 00:03:25,150 --> 00:03:33,330 You are not able to find the packet, and I'll say 50-60% of the mistakes that are there when you are capturing it. 37 00:03:33,330 --> 00:03:36,710 So again, this doesn't really mean that you can get away with that part. 38 00:03:36,710 --> 00:03:41,350 If you are doing it in real world, obviously you have to learn how to catch the packet correctly. 39 00:03:41,430 --> 00:03:47,710 And that's the combination of your tools, bands, and the hardware. 40 00:03:47,710 --> 00:04:01,930 If it is an 11 AC that you are trying to flip, you have to make sure that your device is also 11 AC, and you are also supporting the bands and the MIMO and all the other things, right? 41 00:04:01,930 --> 00:04:05,770 You have the throughput requirements of the same, and all of that. 42 00:04:05,770 --> 00:04:08,990 So 60-70% work is there, and it still needs to be done. 43 00:04:08,990 --> 00:04:14,470 However, if you just want to skip that part, you are like, OK, I get it, it is complicated, I can do it. 44 00:04:14,470 --> 00:04:23,230 But right now I just want to talk how to analyze it, how to create my own scenarios, how to attack these things, in a VM, that's what we are going to talk about. 45 00:04:24,270 --> 00:04:29,370 So, this is pretty much what you need in terms of basic principles. 46 00:04:29,370 --> 00:04:45,570 This will create your first setup, and then on this setup, just like you use your Kali attacker tools here, you use your air mons, air dumps, and then all the other, WPS, Wi-Fi, all of that can run on top of this. 47 00:04:45,570 --> 00:04:57,090 Because all of these tools, they assume that you have a Linux machine, you have a Wi-Fi adapter, which is in monitor mode, and then you are doing things on the basis of that. 48 00:04:57,090 --> 00:05:07,750 So, we are talking about this lower stack, how to emulate it, because once you have it, it's on a Linux machine, you can pretty much install anything and everything that is there on a Kali box. 49 00:05:08,230 --> 00:05:09,830 So, what all is this? 50 00:05:09,830 --> 00:05:12,910 First thing, obviously, Linux required. 51 00:05:12,950 --> 00:05:20,830 The main secret of this recipe, again, it's not really a secret, this thing is there for multiple years now. 52 00:05:20,830 --> 00:05:25,870 So, I'm talking about 80211-SWC. 53 00:05:25,870 --> 00:05:29,170 This is the hardware simulation for the Wi-Fi module. 54 00:05:29,250 --> 00:05:31,230 It is there in the Linux kernel. 55 00:05:31,330 --> 00:05:38,330 It doesn't come as a package, but you can pretty much use two to three commands and get it on your machine. 56 00:05:38,610 --> 00:05:46,290 It is there for multiple years now, but most people don't know about it, most people are using it when they are using some other tools, and we'll talk about them as well. 57 00:05:46,290 --> 00:05:52,770 But behind the scenes, on Linux machine, if you are emulating Wi-Fi, this is what is going to be used. 58 00:05:52,770 --> 00:05:58,630 Because this thing gives you the exact packet capture as you'll get in the real world. 59 00:05:58,790 --> 00:06:08,530 If you do a raw packet capture on it, if you do a monitor mode capture on it, it is the same beacon frame, it is the same probe request, it is the same probe response that you're going to see in the real world. 60 00:06:08,610 --> 00:06:09,590 So, that's there. 61 00:06:09,970 --> 00:06:12,310 Then comes namespaces. 62 00:06:12,310 --> 00:06:17,490 So, Linux namespaces is a concept that we'll talk about, why it is needed in our setup, we'll talk about that. 63 00:06:17,490 --> 00:06:21,250 After that, hosted PD, I'm very sure most of you are already aware of it. 64 00:06:21,250 --> 00:06:25,170 It is the most used, I'll say, access point creator. 65 00:06:25,170 --> 00:06:26,710 That's the easy term for it. 66 00:06:26,710 --> 00:06:45,970 If you have a Linux machine, if you have an IoT device which is running Linux, like most of your access point devices, your open word and all of that, on that, if you want to create an SSID, that's the Wi-Fi network, wireless network, this is what you use. 67 00:06:45,970 --> 00:06:49,450 It is battle-tested, it is around for more than 15 years. 68 00:06:49,450 --> 00:06:55,190 Most of your enterprise-grade machines, APs, they actually use this thing. 69 00:06:55,190 --> 00:06:58,030 And you can pretty much use it in like two commands. 70 00:06:58,030 --> 00:07:00,650 We'll use that to create our access point. 71 00:07:00,890 --> 00:07:03,370 Then wps-applicant is the another part. 72 00:07:03,370 --> 00:07:05,470 It comes installed in your Linux. 73 00:07:05,470 --> 00:07:13,130 This is the thing that makes your Wi-Fi card to connect to your SSID if it is protected. 74 00:07:13,130 --> 00:07:22,670 So when you are connecting to a WEP, WPA2-PSP, WPA-EEP, this is the thing which is making that handshake, and you can see all of that in the logs as well. 75 00:07:22,670 --> 00:07:26,510 So we will be using this to create or emulate the client. 76 00:07:26,510 --> 00:07:35,630 So we'll do this for one thing, and the same logic with some shell scripting, Python, you can actually then replicate it, you can create a big scenario. 77 00:07:35,630 --> 00:07:43,970 So in one PC, in one virtual machine, you can have like hundreds of these devices connecting to each other, roaming. 78 00:07:44,070 --> 00:07:52,970 And if somebody just takes a look at the packet capture, barring the signal strength, that's the part that another tool will take care of. 79 00:07:53,050 --> 00:07:55,890 It will look like it's a high-density Wi-Fi environment. 80 00:07:55,890 --> 00:07:58,530 You are seeing all of this traffic, it behaves just like Wi-Fi. 81 00:07:58,530 --> 00:08:03,590 You will have channels, and you will have to hop the channel here to all of this. 82 00:08:03,830 --> 00:08:07,490 So till here, you are covering layer 2. 83 00:08:07,490 --> 00:08:12,730 So your layer 1 is obviously physical, second is the MAC layer, that's where your Wi-Fi actually operates. 84 00:08:12,870 --> 00:08:15,150 Then comes the IP layer connectivity. 85 00:08:15,150 --> 00:08:18,350 Because if you really want to emulate it, this part is simple. 86 00:08:18,390 --> 00:08:21,830 The main complexity comes after this, because you have one machine. 87 00:08:21,830 --> 00:08:26,510 On that one machine, obviously, you can create two of these interfaces. 88 00:08:26,970 --> 00:08:32,250 And you can make one of them as access point, another one is a client, you connect them up. 89 00:08:32,250 --> 00:08:36,950 After that, you need to give them IP addresses if you really want to simulate traffic. 90 00:08:37,210 --> 00:08:39,870 And that is where the namespaces and all other things will come. 91 00:08:39,870 --> 00:08:42,870 So yeah, dnsmasq is going to be our DHCP server. 92 00:08:43,050 --> 00:08:48,070 And then dhclient is going to be the client which you will use to request for an IP. 93 00:08:48,070 --> 00:08:57,750 And once you have layer 3 connectivity, after that, you can pretty much run any server, any appliance, and simulate all the traffic that you want to do. 94 00:08:57,750 --> 00:09:05,210 Once layer 3 connectivity is there, after that, the only thing that remains is to install stuff and then use it using some scripting. 95 00:09:05,370 --> 00:09:07,230 So this is the whole stack. 96 00:09:07,230 --> 00:09:08,950 That is how it looks like. 97 00:09:09,390 --> 00:09:10,830 So what do you need? 98 00:09:10,830 --> 00:09:13,330 You need a Ubuntu desktop. 99 00:09:13,330 --> 00:09:16,610 I have used 24.04 just to keep it fresh. 100 00:09:16,610 --> 00:09:22,550 Once you have this machine, and you can either install it from Ubuntu's website. 101 00:09:22,550 --> 00:09:24,790 You can take an ISO or VM from there. 102 00:09:24,950 --> 00:09:28,290 Or if you want to save some time, you can go to osboxes.org. 103 00:09:28,290 --> 00:09:29,210 It's a free site. 104 00:09:29,210 --> 00:09:31,090 I'm very sure most of you have used it. 105 00:09:31,090 --> 00:09:34,670 You can directly download a ready-to-use VM from it. 106 00:09:34,810 --> 00:09:35,910 And you download it. 107 00:09:35,910 --> 00:09:37,330 It is ready to use. 108 00:09:39,250 --> 00:09:43,690 And obviously when you run it, I'll obviously not go through the setting up part. 109 00:09:43,690 --> 00:09:46,130 I'm very sure that most of you already know it. 110 00:09:46,930 --> 00:09:48,410 VirtualBox you can use. 111 00:09:48,490 --> 00:09:50,550 VMware player you can use for it. 112 00:09:50,550 --> 00:09:53,930 You're running it on a Linux machine, Windows machine, doesn't really matter. 113 00:09:53,930 --> 00:09:55,430 It's a guest VM. 114 00:09:55,590 --> 00:10:00,770 Once it is up, if you go inside, you'll see that obviously there is no Wi-Fi. 115 00:10:01,150 --> 00:10:03,930 Because again, we have not plugged any adapter to it. 116 00:10:03,930 --> 00:10:05,750 We have not started our work yet. 117 00:10:05,750 --> 00:10:15,390 So once you're here, after that we are going to use this Mac 802.11 hardware simulation. 118 00:10:15,510 --> 00:10:22,910 So what it allows you to do is, it will allow you to create these fake radio adapters. 119 00:10:22,910 --> 00:10:28,030 On which then you can make them act like any way you want. 120 00:10:28,250 --> 00:10:29,610 So there is no limitation. 121 00:10:29,610 --> 00:10:32,770 It will replicate what your real device does. 122 00:10:32,770 --> 00:10:34,190 It will behave in the same way. 123 00:10:36,290 --> 00:10:38,270 So these are the commands. 124 00:10:38,270 --> 00:10:40,810 First command obviously is to check the kernel version. 125 00:10:41,070 --> 00:10:44,430 And second command is to install the build essential. 126 00:10:44,430 --> 00:10:45,590 That will be required. 127 00:10:45,590 --> 00:10:49,090 As I mentioned, it does not come with the default kernel. 128 00:10:49,110 --> 00:10:51,890 You have to download some extra Linux modules. 129 00:10:51,950 --> 00:10:56,750 And then you have to inject this to create these fake Wi-Fi adapters. 130 00:10:56,750 --> 00:10:58,590 And that is what we are doing here. 131 00:10:58,710 --> 00:11:01,270 If you take a look at this third line. 132 00:11:01,270 --> 00:11:03,810 So in the second line we are installing build essentials. 133 00:11:03,810 --> 00:11:08,170 We are also downloading and installing Linux modules. 134 00:11:08,170 --> 00:11:09,450 The extra ones. 135 00:11:09,450 --> 00:11:10,190 It's a package. 136 00:11:10,190 --> 00:11:10,810 You download it. 137 00:11:10,810 --> 00:11:12,390 A lot of other things come in. 138 00:11:12,550 --> 00:11:15,650 Once it is done, you have to use the third command. 139 00:11:15,650 --> 00:11:16,690 That is modprobe. 140 00:11:16,690 --> 00:11:18,410 So modprobe is a generic command. 141 00:11:18,410 --> 00:11:19,570 It's not specific to this. 142 00:11:19,570 --> 00:11:22,850 You use it to inject kernel modules on runtime. 143 00:11:22,910 --> 00:11:24,590 So that is what we are doing here. 144 00:11:24,650 --> 00:11:32,630 So when I say kernel modules, these are the packages which are going to enhance or increase your functionality of your kernel. 145 00:11:32,630 --> 00:11:38,330 And the reason it is not shipped with the default kernel is because you don't really want to make it bulky. 146 00:11:38,330 --> 00:11:41,810 There are like hundreds of these things which are specific to some purpose. 147 00:11:41,810 --> 00:11:43,650 You don't want to make it heavy. 148 00:11:43,950 --> 00:11:48,870 But at the same time, you want the people who really want to use them to have an option to use it. 149 00:11:48,870 --> 00:11:50,090 And that's what it is. 150 00:11:50,090 --> 00:11:51,630 So you can use modprobe. 151 00:11:51,630 --> 00:11:53,590 You can give the name of the module. 152 00:11:53,650 --> 00:11:56,390 And then, as you can see, there is an argument. 153 00:11:56,550 --> 00:11:58,210 Radio is equal to 3. 154 00:11:58,210 --> 00:12:02,850 It means we are asking it to create 3 virtual radios. 155 00:12:02,890 --> 00:12:04,650 And that is what it will do. 156 00:12:04,650 --> 00:12:10,430 So once you do this, on the Ubuntu machine, you are going to see 3 of these interfaces. 157 00:12:10,610 --> 00:12:13,330 wlan0, wlan1, and wlan2. 158 00:12:13,330 --> 00:12:16,430 And you can verify that using this ip link show command. 159 00:12:16,430 --> 00:12:18,910 This is how it will look. 160 00:12:19,390 --> 00:12:26,110 So it is that easy till this point to actually get 3 virtual Wi-Fi interfaces. 161 00:12:26,110 --> 00:12:31,010 These interfaces are going to behave just like your real adapter will behave. 162 00:12:31,450 --> 00:12:32,930 Minus all the limitations. 163 00:12:32,930 --> 00:12:36,330 You don't have to worry about if it is a 2.4GHz, 5GHz. 164 00:12:36,330 --> 00:12:39,470 Does it support 80MHz or 160MHz or not. 165 00:12:39,470 --> 00:12:41,270 You don't have to worry about it. 166 00:12:41,270 --> 00:12:42,730 They support everything. 167 00:12:43,290 --> 00:12:46,410 And they will capture all the traffic perfectly. 168 00:12:46,410 --> 00:12:48,070 Because again, it's software layer. 169 00:12:48,070 --> 00:12:49,130 There is nothing. 170 00:12:49,130 --> 00:12:51,890 There is no unknown in this. 171 00:12:51,890 --> 00:12:57,850 And that's why this makes a very good bed for lab and practice. 172 00:12:57,870 --> 00:13:02,870 And the same is also being used by people to simulate high-density environments. 173 00:13:02,870 --> 00:13:04,770 To run simulations there. 174 00:13:05,770 --> 00:13:08,750 So here, the thing that we have highlighted. 175 00:13:09,750 --> 00:13:14,330 swsim0 is the device that will tell you that yes, it is working. 176 00:13:14,690 --> 00:13:18,810 Then wlan2, wlan1, wlan3 are the virtual ones. 177 00:13:18,810 --> 00:13:20,130 And there is no limit. 178 00:13:20,230 --> 00:13:23,830 You can actually put 16, 17, 20, 25. 179 00:13:23,890 --> 00:13:26,190 And you will see all of these devices here. 180 00:13:26,670 --> 00:13:28,390 So once this part is done. 181 00:13:28,710 --> 00:13:33,710 If you do iwdev, just like you do when you connect any kind of adapter to your Linux machine. 182 00:13:33,750 --> 00:13:35,130 You see all of these, right? 183 00:13:35,130 --> 00:13:36,210 Same thing. 184 00:13:37,530 --> 00:13:40,190 And now if you go back to your UI. 185 00:13:40,410 --> 00:13:43,750 Suddenly there are 3 WiFi adapters with you. 186 00:13:43,750 --> 00:13:46,730 Which you can use to connect or to do something else. 187 00:13:46,730 --> 00:13:50,790 This UI part obviously is just to show you that it is system-wide. 188 00:13:50,790 --> 00:13:53,210 It's not happening just on the command line. 189 00:13:53,230 --> 00:13:54,750 But it will happen here. 190 00:13:54,750 --> 00:13:59,090 If you try to interact with it, it will work just like a real device. 191 00:13:59,610 --> 00:14:01,130 And even if you take a capture. 192 00:14:01,130 --> 00:14:03,970 You will see the exact same thing that you see on the real devices. 193 00:14:03,970 --> 00:14:07,350 Apart from the fact that it is not from the outer world. 194 00:14:07,350 --> 00:14:08,690 It is from the inner world. 195 00:14:09,710 --> 00:14:11,450 So now what you want to do. 196 00:14:11,450 --> 00:14:12,830 And what we are doing here. 197 00:14:12,830 --> 00:14:14,250 For this example. 198 00:14:14,450 --> 00:14:15,970 So you are seeing 3 of these. 199 00:14:15,970 --> 00:14:16,910 Now what we will do. 200 00:14:16,910 --> 00:14:18,210 We will take one of these. 201 00:14:18,210 --> 00:14:21,170 And we will make it play as client. 202 00:14:21,430 --> 00:14:23,170 And that's where the complexity starts. 203 00:14:23,170 --> 00:14:25,050 So till here only 3 commands. 204 00:14:25,310 --> 00:14:26,930 Not much difficult. 205 00:14:27,430 --> 00:14:29,270 So what we are doing here. 206 00:14:29,310 --> 00:14:33,430 Whenever you are plugging anything to your desktop Ubuntu. 207 00:14:33,430 --> 00:14:36,150 It has a network manager running in the backend. 208 00:14:36,170 --> 00:14:39,010 And that will create a lot of problems when you are doing these things. 209 00:14:39,630 --> 00:14:41,410 If you know what you are doing. 210 00:14:41,410 --> 00:14:42,290 Just turn it off. 211 00:14:42,290 --> 00:14:44,530 If you are not using that VM for anything else. 212 00:14:44,530 --> 00:14:45,250 Just turn it off. 213 00:14:45,250 --> 00:14:47,490 It is going to do a lot of other things otherwise. 214 00:14:47,510 --> 00:14:48,970 But here what I am doing is. 215 00:14:48,970 --> 00:14:51,810 I am just removing one of these devices. 216 00:14:52,090 --> 00:14:52,650 WLAN2. 217 00:14:52,810 --> 00:14:54,290 From the managed world. 218 00:14:54,430 --> 00:14:57,470 So that this network manager is not messing it up. 219 00:14:57,470 --> 00:14:59,790 Because I want to move it to an isolation. 220 00:15:00,190 --> 00:15:04,350 Where I can make it use or work like a client. 221 00:15:04,610 --> 00:15:06,610 And we will do all of that in the same machine. 222 00:15:06,610 --> 00:15:07,550 That's the beauty of it. 223 00:15:07,550 --> 00:15:09,170 And you can do it multiple times. 224 00:15:09,170 --> 00:15:12,750 You can have 15, 20, 100 of these on the same VM. 225 00:15:12,750 --> 00:15:16,770 And the good thing is you don't even need a very powerful machine. 226 00:15:16,770 --> 00:15:19,830 You can actually take a bare minimum VM stack. 227 00:15:19,830 --> 00:15:21,190 And it will run online. 228 00:15:21,950 --> 00:15:23,830 So once that part is done. 229 00:15:24,090 --> 00:15:25,730 If you go here. 230 00:15:26,070 --> 00:15:30,270 What I am doing here is pretty familiar to I think most of the people. 231 00:15:30,450 --> 00:15:35,730 So this is a bare minimum open network configuration for HostAPD. 232 00:15:35,790 --> 00:15:38,670 HostAPD as you remember I just described. 233 00:15:38,670 --> 00:15:42,690 It is the software that all of your enterprise devices. 234 00:15:42,690 --> 00:15:46,090 All of your Wi-Fi devices which are running on Linux. 235 00:15:46,090 --> 00:15:47,930 Use to create your Wi-Fi networks. 236 00:15:47,930 --> 00:15:50,310 The SSIDs are created using this. 237 00:15:50,310 --> 00:15:52,550 The configuration are also like this. 238 00:15:52,550 --> 00:15:55,790 The only difference is when you do it in real world on real devices. 239 00:15:55,790 --> 00:15:57,710 You will see much more parameters here. 240 00:15:57,710 --> 00:16:02,370 So HostAPD in total actually supports over 150 plus parameters. 241 00:16:02,370 --> 00:16:04,730 Good thing is even if you don't define them. 242 00:16:04,730 --> 00:16:07,050 It will assume default values. 243 00:16:07,050 --> 00:16:10,450 And it will only take the values that you are providing. 244 00:16:10,450 --> 00:16:11,790 And make them different. 245 00:16:12,090 --> 00:16:14,570 So you have provided that part. 246 00:16:14,750 --> 00:16:18,870 And then here you are just running it with the configuration file. 247 00:16:19,030 --> 00:16:20,830 HostAPD is very easy to install. 248 00:16:20,830 --> 00:16:23,070 You can do apt-get install hostapd. 249 00:16:23,070 --> 00:16:24,430 It just works. 250 00:16:24,430 --> 00:16:28,290 And the reason I am not going into each and every command. 251 00:16:28,290 --> 00:16:30,590 Is now because you have chat-gpt file. 252 00:16:31,090 --> 00:16:32,210 So yeah. 253 00:16:32,310 --> 00:16:33,590 Very easy to see. 254 00:16:33,590 --> 00:16:37,350 I feel that the way today's world is working. 255 00:16:37,350 --> 00:16:39,010 If you know what you are looking for. 256 00:16:39,010 --> 00:16:42,270 It is very very very easy to start from there. 257 00:16:42,390 --> 00:16:45,910 However a lot of people don't really understand the basics of it. 258 00:16:45,910 --> 00:16:47,370 And that's what I am trying to clear up. 259 00:16:47,370 --> 00:16:50,130 Rest using chat-gpt and clod and all of that. 260 00:16:50,130 --> 00:16:54,010 You can write very powerful simulations around these basics. 261 00:16:54,010 --> 00:16:55,970 Which will create the main setup. 262 00:16:56,110 --> 00:16:57,490 So once you do this. 263 00:16:57,490 --> 00:16:59,310 You have an access point running. 264 00:16:59,310 --> 00:17:00,670 You have an SSID. 265 00:17:00,670 --> 00:17:02,390 The name is OpenTestNet. 266 00:17:03,250 --> 00:17:04,550 It's on channel 6. 267 00:17:04,550 --> 00:17:05,950 You can assign it a MAC. 268 00:17:05,950 --> 00:17:08,110 Because by default when you inject these. 269 00:17:08,110 --> 00:17:11,150 The MAC is 0000.2 or something. 270 00:17:11,150 --> 00:17:12,390 Which looks very odd. 271 00:17:12,390 --> 00:17:14,670 When you capture traffic on it. 272 00:17:14,770 --> 00:17:16,310 But yeah once you have this. 273 00:17:16,310 --> 00:17:17,790 You have SSID running. 274 00:17:17,830 --> 00:17:21,090 And if you go back to your GUI. 275 00:17:21,110 --> 00:17:24,590 You will actually see that there is a network operating here. 276 00:17:24,590 --> 00:17:28,070 Just like you see in the real world on your machine. 277 00:17:28,430 --> 00:17:30,470 Because again exact same thing. 278 00:17:30,470 --> 00:17:31,470 And if you click on it. 279 00:17:31,470 --> 00:17:32,910 On the HostCPD side. 280 00:17:32,910 --> 00:17:35,570 You will actually see all of these logs appearing. 281 00:17:35,810 --> 00:17:37,270 So what we just did. 282 00:17:37,410 --> 00:17:39,570 We made layer 2 connectivity. 283 00:17:39,570 --> 00:17:41,690 Between these two interfaces. 284 00:17:41,690 --> 00:17:43,050 On the same machine. 285 00:17:44,210 --> 00:17:46,630 Again it is a layer 2 connectivity. 286 00:17:46,630 --> 00:17:49,570 We don't really are dealing with netmasks. 287 00:17:49,570 --> 00:17:51,590 And layer 3 complications as of now. 288 00:17:51,590 --> 00:17:54,930 So that's why we can keep them in the same space. 289 00:17:55,070 --> 00:17:57,690 And nothing will break loose. 290 00:17:57,890 --> 00:18:00,230 However when you want to move forward. 291 00:18:00,230 --> 00:18:01,890 And you really want a real lab. 292 00:18:01,890 --> 00:18:03,070 A real connected lab. 293 00:18:03,070 --> 00:18:05,010 Where you are maybe running a web server. 294 00:18:05,010 --> 00:18:06,450 Or something on one side. 295 00:18:06,450 --> 00:18:08,570 And client is then trying to access it. 296 00:18:08,610 --> 00:18:11,810 Or you have a P2P application. 297 00:18:11,810 --> 00:18:13,830 That is running on different clients. 298 00:18:13,830 --> 00:18:15,790 Exchanging traffic through that access point. 299 00:18:15,790 --> 00:18:18,810 You will need layer 3 connectivity. 300 00:18:19,270 --> 00:18:23,510 And that is where the concept of Linux namespaces will come in. 301 00:18:23,510 --> 00:18:28,430 So I am very sure that most of you guys have already worked with Docker containers. 302 00:18:28,430 --> 00:18:32,090 So your Docker containers or for that matter any kind of Linux containers. 303 00:18:32,090 --> 00:18:34,570 They are built using Linux namespaces. 304 00:18:34,570 --> 00:18:35,890 What are namespaces? 305 00:18:35,950 --> 00:18:39,470 This is a way to isolate the system resources. 306 00:18:39,670 --> 00:18:42,330 So if you want that on the same machine. 307 00:18:42,330 --> 00:18:44,850 When I list my interfaces. 308 00:18:44,850 --> 00:18:47,990 I should be able to see two resources on one side. 309 00:18:47,990 --> 00:18:50,570 And another one in another section. 310 00:18:50,570 --> 00:18:55,730 And these resources should not know that there are other resources on the same machine. 311 00:18:55,730 --> 00:18:57,050 So you are isolating them. 312 00:18:57,050 --> 00:18:59,070 Same way your containers do. 313 00:18:59,070 --> 00:19:01,390 So when you are running a process in a container. 314 00:19:01,390 --> 00:19:05,150 It does not know what is happening outside of container. 315 00:19:05,150 --> 00:19:07,370 What is happening in another container. 316 00:19:07,370 --> 00:19:10,870 And that is also implemented using namespaces. 317 00:19:10,970 --> 00:19:14,590 So for the containers we use process namespaces. 318 00:19:14,590 --> 00:19:16,230 And network namespaces. 319 00:19:16,230 --> 00:19:17,610 And IPC namespaces. 320 00:19:17,610 --> 00:19:18,950 And mouth namespaces. 321 00:19:18,950 --> 00:19:20,430 However in this case. 322 00:19:20,430 --> 00:19:24,690 Because we are just concerned with the network part of it. 323 00:19:24,690 --> 00:19:26,830 We can just use network namespaces. 324 00:19:26,830 --> 00:19:30,450 So this is how you set a network namespace. 325 00:19:30,450 --> 00:19:32,390 You do ip netns. 326 00:19:32,390 --> 00:19:34,830 Again stands for network namespaces. 327 00:19:34,910 --> 00:19:36,210 Then you say add. 328 00:19:36,230 --> 00:19:38,490 And then there is the name of the namespace. 329 00:19:38,490 --> 00:19:39,770 It can be anything. 330 00:19:39,850 --> 00:19:41,870 It's a construct that you are creating. 331 00:19:41,870 --> 00:19:44,570 So that you can isolate these on the same machine. 332 00:19:44,570 --> 00:19:46,650 Because if you don't isolate it. 333 00:19:46,650 --> 00:19:48,470 Then there is a problem called. 334 00:19:49,970 --> 00:19:51,630 R... R what? 335 00:19:51,630 --> 00:19:52,630 Not R flooding. 336 00:19:52,630 --> 00:19:53,890 R confusion or something. 337 00:19:53,890 --> 00:19:54,790 So there is this thing. 338 00:19:54,790 --> 00:19:57,650 If you have two interfaces on your machine. 339 00:19:57,730 --> 00:19:59,230 They are able to see each other. 340 00:19:59,230 --> 00:20:01,890 And if they have IPs from the same subnet. 341 00:20:01,890 --> 00:20:05,470 The machine doesn't know which interface is the right one. 342 00:20:05,470 --> 00:20:08,470 So it tries to send the traffic from both of these interfaces. 343 00:20:08,470 --> 00:20:09,390 And what will happen? 344 00:20:09,390 --> 00:20:11,770 Your machine will actually lose connectivity. 345 00:20:11,770 --> 00:20:12,970 It won't be able to work. 346 00:20:12,970 --> 00:20:14,290 Because your packets. 347 00:20:14,290 --> 00:20:15,490 They are going from one interface. 348 00:20:15,490 --> 00:20:18,450 And then they are trying to come from another interface. 349 00:20:18,510 --> 00:20:20,610 So to avoid that confusion. 350 00:20:20,610 --> 00:20:23,490 That's where your network namespaces are required. 351 00:20:23,490 --> 00:20:24,810 So what we are doing here is. 352 00:20:24,810 --> 00:20:27,210 We are setting up one more namespace. 353 00:20:27,410 --> 00:20:29,110 So when you log into your machine. 354 00:20:29,110 --> 00:20:31,130 There is always a default namespace. 355 00:20:31,130 --> 00:20:33,630 That is where you are playing most of the time. 356 00:20:33,630 --> 00:20:35,970 You only go into creating additional ones. 357 00:20:35,970 --> 00:20:38,290 When you want to do something like containers. 358 00:20:38,370 --> 00:20:39,690 Containers do this all the time. 359 00:20:39,690 --> 00:20:42,930 That's how you can see a ETH0 inside the container. 360 00:20:42,930 --> 00:20:44,810 And outside as well. 361 00:20:44,810 --> 00:20:46,050 So same thing we did here. 362 00:20:46,050 --> 00:20:47,450 We created a namespace. 363 00:20:47,450 --> 00:20:48,370 After that. 364 00:20:48,370 --> 00:20:52,430 We made sure that that namespace has a local interface. 365 00:20:52,430 --> 00:20:54,430 It is the local host. 366 00:20:54,430 --> 00:20:56,250 Local interface that you see. 367 00:20:56,250 --> 00:20:59,050 And if you want to check the namespaces that are created. 368 00:20:59,050 --> 00:21:00,190 If you do list. 369 00:21:00,190 --> 00:21:03,170 You will see the one that you have created here. 370 00:21:04,610 --> 00:21:06,050 Once that is there. 371 00:21:06,050 --> 00:21:07,290 What you can do. 372 00:21:07,290 --> 00:21:09,550 You can take one of these devices. 373 00:21:09,590 --> 00:21:12,830 And you can move it over into the new namespace. 374 00:21:12,870 --> 00:21:15,370 So this command here precisely does that. 375 00:21:15,370 --> 00:21:17,110 When you say iw. 376 00:21:17,110 --> 00:21:22,010 This is the utility that you use to play around with the WiFi companies. 377 00:21:22,010 --> 00:21:24,710 PHY stands for Physical Device. 378 00:21:25,210 --> 00:21:28,090 PHY2 stands for Physical Device 2. 379 00:21:28,110 --> 00:21:29,570 So if you go back. 380 00:21:29,770 --> 00:21:32,790 And if you take a look at this here. 381 00:21:32,790 --> 00:21:35,210 What you will see is that every device. 382 00:21:35,210 --> 00:21:36,250 Every virtual device. 383 00:21:36,250 --> 00:21:38,610 Just like the real device that you plug in. 384 00:21:38,610 --> 00:21:40,330 Is marked with the name. 385 00:21:40,450 --> 00:21:43,770 In this case it is PHY2 that we want to move. 386 00:21:44,270 --> 00:21:46,990 So go back here. 387 00:21:47,110 --> 00:21:49,170 And that is what you have done. 388 00:21:49,170 --> 00:21:50,590 Now after doing this. 389 00:21:50,590 --> 00:21:52,310 If you run iwdev. 390 00:21:52,710 --> 00:21:53,510 Surprisingly. 391 00:21:54,010 --> 00:21:55,690 Or not surprisingly. 392 00:21:55,690 --> 00:21:57,610 Because we knew this is going to happen. 393 00:21:58,890 --> 00:22:01,030 PHY2 is not there anymore. 394 00:22:01,030 --> 00:22:02,110 It has moved. 395 00:22:02,230 --> 00:22:04,090 And currently the command that you are running. 396 00:22:04,090 --> 00:22:06,270 It is running in the default namespace. 397 00:22:06,430 --> 00:22:08,190 So that is why you are not able to see it. 398 00:22:08,190 --> 00:22:10,010 Your commands are not going to see it. 399 00:22:10,010 --> 00:22:11,950 And that is precisely what we want. 400 00:22:11,950 --> 00:22:14,990 If we really want to do layer 3 connectivity. 401 00:22:14,990 --> 00:22:16,030 On the same machine. 402 00:22:16,030 --> 00:22:17,450 Using the same subnet. 403 00:22:17,450 --> 00:22:18,910 And this can be extended. 404 00:22:18,910 --> 00:22:21,390 And that is how your containers also work. 405 00:22:21,590 --> 00:22:22,790 They are on the same machine. 406 00:22:22,790 --> 00:22:24,390 They have different interfaces. 407 00:22:24,390 --> 00:22:26,210 You are doing networking between them. 408 00:22:26,210 --> 00:22:27,550 They are in the same subnet. 409 00:22:27,550 --> 00:22:28,890 Still everything runs. 410 00:22:28,890 --> 00:22:29,270 Why? 411 00:22:29,270 --> 00:22:32,210 Because these interfaces are not seeing each other. 412 00:22:32,310 --> 00:22:34,170 They feel that they are in separate machines. 413 00:22:34,170 --> 00:22:35,730 And that is what we are doing here. 414 00:22:36,110 --> 00:22:39,150 So you have PHY1 and PHY2. 415 00:22:39,270 --> 00:22:40,670 In this namespace. 416 00:22:41,250 --> 00:22:43,250 If you go to another namespace. 417 00:22:43,250 --> 00:22:44,230 So here. 418 00:22:44,670 --> 00:22:46,170 When you run ip link. 419 00:22:46,170 --> 00:22:46,930 Like this. 420 00:22:46,930 --> 00:22:48,790 It runs in the default namespace. 421 00:22:48,990 --> 00:22:52,270 You are seeing two of these devices here. 422 00:22:52,330 --> 00:22:54,970 And then you use ip net ns. 423 00:22:54,970 --> 00:22:57,130 So this is the command that you use. 424 00:22:57,130 --> 00:22:59,770 When you want to run a specific command. 425 00:23:00,230 --> 00:23:04,270 In a specific network namespace. 426 00:23:04,270 --> 00:23:05,930 So you do extc. 427 00:23:05,930 --> 00:23:07,630 That is execute. 428 00:23:07,730 --> 00:23:10,450 Name of the network namespace. 429 00:23:10,450 --> 00:23:12,510 And then the command that you want to run. 430 00:23:12,510 --> 00:23:13,890 So now when we are running it. 431 00:23:13,890 --> 00:23:16,430 It is not in default namespace. 432 00:23:16,430 --> 00:23:18,890 It is in the namespace that you created. 433 00:23:19,090 --> 00:23:20,630 And as you can see. 434 00:23:20,630 --> 00:23:22,510 It also has a local one. 435 00:23:22,510 --> 00:23:24,230 And then WLAN2. 436 00:23:24,370 --> 00:23:28,850 So now WLAN2 cannot see WLAN1 and WLAN0. 437 00:23:29,070 --> 00:23:35,490 And that is the magic behind your virtualization of this kind of lab. 438 00:23:35,590 --> 00:23:38,730 It is the same concept that we have borrowed from the containers. 439 00:23:38,730 --> 00:23:41,390 This is how containers are working behind the scenes. 440 00:23:41,390 --> 00:23:44,030 And you can extend the same logic for this. 441 00:23:44,030 --> 00:23:47,290 There is also one more module on similar lines. 442 00:23:47,290 --> 00:23:50,570 It is MAC8015. 443 00:23:50,710 --> 00:23:54,210 So you can also use that to simulate that network. 444 00:23:54,350 --> 00:23:55,850 As far as my knowledge goes. 445 00:23:55,850 --> 00:24:00,490 Currently there are only two of these modules that you can use to simulate very closely. 446 00:24:01,170 --> 00:24:03,830 There are multiple other options as well. 447 00:24:03,830 --> 00:24:06,150 But most of these options they actually emulate. 448 00:24:06,150 --> 00:24:07,130 They don't simulate. 449 00:24:07,130 --> 00:24:08,970 So if you take a packet capture. 450 00:24:08,970 --> 00:24:11,750 And if you take a look closer on their behavior. 451 00:24:11,750 --> 00:24:16,330 You will actually see that their behavior is very different how real devices work. 452 00:24:16,350 --> 00:24:20,610 But in this case it is as good as your physical device. 453 00:24:20,610 --> 00:24:26,550 Apart from the fluctuations in the power and the physical disturbances. 454 00:24:27,070 --> 00:24:29,410 So once our setup is ready. 455 00:24:29,550 --> 00:24:31,370 What we need to do now. 456 00:24:31,970 --> 00:24:37,210 We are taking this one interface WLAN1 on which we have already created an SSID. 457 00:24:37,210 --> 00:24:39,930 Because we are now talking about layer 3 connectivity. 458 00:24:39,930 --> 00:24:41,210 We need IPs. 459 00:24:41,210 --> 00:24:43,330 So we are setting an IP address on it. 460 00:24:43,650 --> 00:24:45,430 Then we are turning it on. 461 00:24:45,430 --> 00:24:48,290 If it is not on, it is already on but just to be sure. 462 00:24:48,650 --> 00:24:50,190 And then we are creating this. 463 00:24:50,370 --> 00:24:53,710 This is the same file that we have used to run that access point. 464 00:24:53,730 --> 00:24:58,190 You can also run it as a daemon by using "-b". 465 00:24:58,190 --> 00:24:59,390 So that's what we did. 466 00:24:59,390 --> 00:25:00,790 Access point is enabled. 467 00:25:01,670 --> 00:25:06,350 And this is the default namespace that we are currently dealing with. 468 00:25:07,510 --> 00:25:09,170 SSID will start. 469 00:25:09,170 --> 00:25:15,590 If you do IWDEV, you will see that instead of saying managed, now it will say access point. 470 00:25:16,690 --> 00:25:18,770 Because it is operating an SSID. 471 00:25:18,910 --> 00:25:20,970 HostAPD is making it do this. 472 00:25:21,130 --> 00:25:23,170 The second one we are not playing with. 473 00:25:23,170 --> 00:25:26,870 This is the one that network manager is currently playing with. 474 00:25:26,870 --> 00:25:29,070 The Ubuntu desktop network manager. 475 00:25:29,070 --> 00:25:31,170 You can safely ignore it for now. 476 00:25:32,270 --> 00:25:34,470 Then comes the client part. 477 00:25:34,470 --> 00:25:40,030 And this is where you actually run this logic in the other namespace that you have created. 478 00:25:40,290 --> 00:25:43,270 So you first switch into the other namespace. 479 00:25:43,270 --> 00:25:49,250 What I am doing here, I am launching a bash shell in this new namespace that I have created. 480 00:25:49,410 --> 00:25:52,090 Once you do that, you are inside it. 481 00:25:52,090 --> 00:25:55,090 If you do IWDEV, it will run any other commands now. 482 00:25:55,090 --> 00:25:58,210 Because you are inside the bash which is running in this namespace. 483 00:25:58,210 --> 00:26:02,730 It won't show you the interfaces that are there in the default namespace. 484 00:26:02,730 --> 00:26:05,450 But only the one that you moved and the local one. 485 00:26:06,090 --> 00:26:11,050 And after that, we created this very simple configuration file. 486 00:26:11,090 --> 00:26:14,550 It is to connect to this open network that is there. 487 00:26:14,770 --> 00:26:17,970 And then we will use WPSApplicant. 488 00:26:18,010 --> 00:26:20,050 We will give it the interface name. 489 00:26:20,050 --> 00:26:22,250 And then we will give it the configuration file. 490 00:26:22,250 --> 00:26:26,030 So whenever you are using a Linux machine and you are connecting to any network. 491 00:26:26,030 --> 00:26:29,930 Back in the back, WPSApplicant is the one that is running and doing all the jobs. 492 00:26:29,930 --> 00:26:32,610 So here we are just running it using the command. 493 00:26:32,610 --> 00:26:37,270 Otherwise, when your network manager has to connect it, it also is going to call it. 494 00:26:37,570 --> 00:26:40,890 So by doing this, now you have that connectivity. 495 00:26:41,270 --> 00:26:51,370 And after that, the only thing that remains is on the access point side, you have to run dnsmasq or any other tool which can run a DHCP server. 496 00:26:51,870 --> 00:26:52,930 That part is done. 497 00:26:52,930 --> 00:26:59,630 Then you come on this side and you run dhclient, which will request for the IP address and it will get the IP address. 498 00:26:59,630 --> 00:27:03,310 And you have full layer 3 connectivity on the same machine. 499 00:27:03,310 --> 00:27:05,630 So this is the basic construct. 500 00:27:05,670 --> 00:27:11,710 Now, once you have this, as you saw, everything was done using Linux commands. 501 00:27:11,710 --> 00:27:13,470 How do we automate it? 502 00:27:13,470 --> 00:27:25,950 You write a shell script, which will generate random names, random IDs, and then you loop over it again and again and again, depending on what exactly you want to make. 503 00:27:25,950 --> 00:27:35,190 If you want to simulate 5 to 6 of these networks, you can make a more elaborated or multiple post-APD computation file. 504 00:27:35,190 --> 00:27:41,350 You can run it and you'll have 10 or 20 or 30 or 40 networks there. 505 00:27:41,350 --> 00:27:46,130 You want to create roaming clients, just create clients, run WPA supplicant on it. 506 00:27:46,130 --> 00:27:47,190 They'll start probing. 507 00:27:47,190 --> 00:27:49,150 If they find the network, they'll connect. 508 00:27:49,150 --> 00:27:55,230 If they connect, then if you're running DHCP, they're automatically going to get IP connectivity. 509 00:27:55,230 --> 00:27:58,250 So this way, you can pretty much simulate. 510 00:27:58,270 --> 00:27:59,830 Even WPA3 you can simulate. 511 00:27:59,830 --> 00:28:02,090 That's another thing that you won't be able to break it. 512 00:28:02,090 --> 00:28:09,770 But if you really want to quickly capture packets of the handshake, for WPA2, WPA3 as well, there is a handshake. 513 00:28:10,190 --> 00:28:18,450 Even if you want to simulate WEP for some reason, you're trying to look at packets, you want to see how exactly those attacks used to work. 514 00:28:18,510 --> 00:28:20,690 It will work perfectly in this case. 515 00:28:20,690 --> 00:28:20,970 Why? 516 00:28:20,970 --> 00:28:22,530 Because you're not missing any packet. 517 00:28:22,530 --> 00:28:24,030 You'll see everything. 518 00:28:24,030 --> 00:28:26,770 And again, this also has a channel of concepts. 519 00:28:26,790 --> 00:28:36,210 So you still have to use your error dump to jump around, to see all the things, and then to set on one channel, then to lock on one target, and then to do all of this. 520 00:28:36,630 --> 00:28:39,390 So yeah, this is how you do it. 521 00:28:39,430 --> 00:28:42,470 It will run on any kind of VM that you run. 522 00:28:42,470 --> 00:28:45,010 It actually even runs on open word. 523 00:28:45,010 --> 00:28:47,870 So if for some reason you want to do that, you can do that. 524 00:28:47,870 --> 00:28:49,390 It also runs on Raspberry Pi. 525 00:28:49,390 --> 00:28:51,010 We tried it there as well. 526 00:28:52,010 --> 00:29:02,350 The only thing is that when you do this on IoT devices, sometimes you might have to compile their kernel and their firmware using the buildchains. 527 00:29:02,410 --> 00:29:05,250 In desktop it is easy, that's why I'm showing this to you. 528 00:29:05,250 --> 00:29:11,550 If you try to do this with open word, you have to take the whole source code, you have to make the changes in the configuration file. 529 00:29:11,550 --> 00:29:14,950 So when the kernel is compiled, at that time you can do this. 530 00:29:15,010 --> 00:29:19,110 So it is a little bit more difficult, but not impossible, you can do it. 531 00:29:20,470 --> 00:29:24,970 So next thing is, what if I'm too lazy to do all of this? 532 00:29:24,970 --> 00:29:31,490 I understand there are namespaces, I understand there is hostcpd, nwps-applicant and all of this, right? 533 00:29:31,490 --> 00:29:40,250 But I don't really want to get into scripting and to fix it, even with Cloud or other things. 534 00:29:40,250 --> 00:29:43,690 So in that case, people have created something like this. 535 00:29:43,690 --> 00:29:45,870 They have Mininet Wi-Fi. 536 00:29:46,550 --> 00:29:48,290 How does this work? 537 00:29:48,290 --> 00:29:50,450 Exactly the way I stated. 538 00:29:50,850 --> 00:29:53,950 So what they have done, they have taken the same construct. 539 00:29:54,230 --> 00:29:56,970 They have done all the plumbing for you. 540 00:29:56,970 --> 00:29:59,070 So you can just run commands. 541 00:29:59,410 --> 00:30:04,110 And by using these commands, you can pretty much simulate all the things that we just discussed. 542 00:30:04,110 --> 00:30:11,070 You can have multiple clients, multiple APs, all of that, by using very simple things. 543 00:30:11,070 --> 00:30:14,990 And here, you are seeing a diagram that I have taken from their site. 544 00:30:14,990 --> 00:30:18,670 And the reason for that is just to show you that all of this, you already know now. 545 00:30:18,670 --> 00:30:22,210 So you have these WLAN1, WLAN2, WLAN3, same thing. 546 00:30:22,210 --> 00:30:23,570 How they are doing it. 547 00:30:23,570 --> 00:30:25,190 Same module we talked about. 548 00:30:25,190 --> 00:30:28,250 Now we know how to inject it, how to do it on our own. 549 00:30:28,950 --> 00:30:31,590 This is called Netlink Socket. 550 00:30:31,610 --> 00:30:34,210 It is here for depiction purpose. 551 00:30:34,210 --> 00:30:35,390 This is how it actually works. 552 00:30:35,390 --> 00:30:37,470 But yeah, you don't need to know about it. 553 00:30:37,470 --> 00:30:40,130 It automatically just works if you are on Linux. 554 00:30:40,610 --> 00:30:43,630 And here, they are creating different namespaces. 555 00:30:43,630 --> 00:30:46,830 And in the namespaces, they are mapping these. 556 00:30:47,710 --> 00:30:49,830 Same way, like we did. 557 00:30:49,950 --> 00:30:53,130 And on top of that, you will have your connections and all. 558 00:30:53,330 --> 00:30:56,770 So easy way, very good documentation as well. 559 00:30:56,770 --> 00:31:02,010 Till the time you are not trying to simulate something very complicated, it will just work. 560 00:31:02,850 --> 00:31:06,390 And then, what is more that these guys are providing that we didn't discuss? 561 00:31:06,390 --> 00:31:08,970 So we didn't discuss the physical part of Wi-Fi. 562 00:31:08,970 --> 00:31:16,890 Because as your access points are at one place, your clients, if they are moving, the signal strength is going to be varying. 563 00:31:16,910 --> 00:31:25,410 Even if the access point is stationary and you are also stationary, due to the physical factors, there are so many things that actually interact with Wi-Fi signals. 564 00:31:25,410 --> 00:31:32,450 So even if I stand here, the Wi-Fi is stationary right there, you will still get packets of varying signals. 565 00:31:32,610 --> 00:31:36,770 So all of that, if you want to simulate, then this thing can do that. 566 00:31:36,770 --> 00:31:38,450 It simulates moving targets. 567 00:31:38,450 --> 00:31:46,810 So you can actually code or tell it to create moving clients from one access point to another access point. 568 00:31:46,810 --> 00:31:49,410 And you will also see the switching being happened. 569 00:31:49,430 --> 00:31:54,010 So when you are moving in a very big campus, you see a lot of these access points deployed. 570 00:31:54,010 --> 00:31:59,150 And what happens is when you move from one location to another, automatically a handover happens. 571 00:31:59,150 --> 00:32:06,070 So you switch from one access point to another one, the same way you switch your mobile networks when you move through space. 572 00:32:06,070 --> 00:32:08,670 This thing can also simulate that part. 573 00:32:08,670 --> 00:32:11,390 So you will see one client disconnecting and connecting on the other side. 574 00:32:11,390 --> 00:32:15,950 And that's the reason why you can use this to run simulations on a bigger scale. 575 00:32:16,290 --> 00:32:19,930 Propagation also, but that's not really for security purposes. 576 00:32:19,930 --> 00:32:23,110 That is if you really want to understand how the propagation works in Wi-Fi. 577 00:32:23,130 --> 00:32:24,450 So that's also there. 578 00:32:25,310 --> 00:32:30,570 And the good thing is that now they also have an easy-to-deploy container board. 579 00:32:30,570 --> 00:32:33,710 So you can just run these commands. 580 00:32:33,710 --> 00:32:36,130 It will create multiple containers. 581 00:32:36,130 --> 00:32:43,270 These containers, if you go into these, these will behave like different, different machines, which are connected using Wi-Fi. 582 00:32:44,310 --> 00:32:47,330 So it was very easy to do in Docker. 583 00:32:47,330 --> 00:32:56,570 Now you can also do it using Wi-Fi, where it feels like that you are using a wireless network, but essentially it is nothing but software. 584 00:32:56,930 --> 00:32:58,710 So yeah, very easy to use. 585 00:32:58,810 --> 00:33:00,210 What are other options? 586 00:33:00,210 --> 00:33:02,190 You have NSP. 587 00:33:02,210 --> 00:33:05,010 It's called Network Simulator 3. 588 00:33:05,190 --> 00:33:09,650 It's more for the wired thing or the protocol part. 589 00:33:09,650 --> 00:33:12,990 But can we do 802.11 on it? 590 00:33:12,990 --> 00:33:13,870 Yes, you can. 591 00:33:13,870 --> 00:33:23,110 However, if you try to capture the packets, the captures won't work the same way as they will with 802.11 SW-SIM. 592 00:33:23,190 --> 00:33:25,250 You have another thing called Core. 593 00:33:25,250 --> 00:33:26,450 You can look it up. 594 00:33:26,450 --> 00:33:27,450 That's another solution. 595 00:33:27,450 --> 00:33:29,610 It is more tightly coupled. 596 00:33:29,610 --> 00:33:31,770 So you cannot change a lot of things there. 597 00:33:31,770 --> 00:33:35,070 That's why not really the best place to start. 598 00:33:35,190 --> 00:33:38,010 Then you have MiniNet Wi-Fi and then obviously DNS3. 599 00:33:38,010 --> 00:33:42,130 But DNS3 does not really support the Wi-Fi frames. 600 00:33:42,130 --> 00:33:44,790 So you'll only see these being emulated. 601 00:33:44,790 --> 00:33:49,670 You'll see the traffic of Layer 3 and above, but Layer 2 you won't be able to see. 602 00:33:49,670 --> 00:34:07,110 So these are the different ways by which you can create your own cloud Wi-Fi lab or your home Wi-Fi lab, where you can have multiple of these devices and then you can run simulations, attacks, floods, de-auths, if you wanted to do that and now WP3 is not letting you do that. 603 00:34:07,110 --> 00:34:10,430 You can create one and then do a de-auth there. 604 00:34:10,430 --> 00:34:11,890 You can study the behavior. 605 00:34:11,890 --> 00:34:15,150 You can see in MiniNet. 606 00:34:15,150 --> 00:34:23,470 In MiniNet, you can actually see that when you move a client and you do de-auth it, it will go for the nearest one with stronger signals. 607 00:34:23,470 --> 00:34:30,550 All of these things you can literally see, which are very, very, very difficult when it comes to similarities in real world. 608 00:34:30,550 --> 00:34:34,370 In real world, you can speculate and then you can observe. 609 00:34:34,450 --> 00:34:36,990 Still, you are going to be wrong for the most part. 610 00:34:37,230 --> 00:34:37,870 So, yeah. 611 00:34:38,590 --> 00:34:39,970 So that's all. 612 00:34:39,970 --> 00:34:43,430 If there are any questions, please throw them my way. 613 00:34:44,810 --> 00:34:45,570 Thank you.