1 00:00:06,980 --> 00:00:09,040 - You're going to encounter many acronyms 2 00:00:09,040 --> 00:00:11,890 when looking at wireless networking, 3 00:00:11,890 --> 00:00:13,890 particularly WiFi networks. 4 00:00:13,890 --> 00:00:18,850 So we have WEP, WPA, WPA2, there's WPA3 now. 5 00:00:18,850 --> 00:00:20,950 We got encryption methods down here, 6 00:00:20,950 --> 00:00:23,670 we got authentication protocols down at the bottom. 7 00:00:23,670 --> 00:00:25,360 We're gonna take a look at a lot of these 8 00:00:25,360 --> 00:00:27,170 over the coming slides. 9 00:00:27,170 --> 00:00:28,003 Starting off with WEP, 10 00:00:28,003 --> 00:00:30,400 WEP was the original. 11 00:00:30,400 --> 00:00:34,970 Completely insecure method of securing wireless networks. 12 00:00:34,970 --> 00:00:37,760 It was in that original standard in 1997, 13 00:00:37,760 --> 00:00:41,963 it uses Rivest Cipher 4 as the stream cipher. 14 00:00:43,170 --> 00:00:45,210 There is a 50% chance 15 00:00:45,210 --> 00:00:46,960 that an initialization vector 16 00:00:46,960 --> 00:00:51,960 will be repeated in 4K frames, 4,096 frames. 17 00:00:52,800 --> 00:00:55,390 If you're able to capture that initialization vector, 18 00:00:55,390 --> 00:00:58,930 it gives you a path to crack the pre-shared key 19 00:00:58,930 --> 00:01:01,780 that both sides of the communication need to be aware of 20 00:01:01,780 --> 00:01:05,040 in order to establish that encrypted channel. 21 00:01:05,040 --> 00:01:07,597 So we had WEP-40 and WEP-128. 22 00:01:07,597 --> 00:01:11,870 WEP-128 was the more commonly used method of encryption. 23 00:01:11,870 --> 00:01:16,870 It had a 24-bit initialization vector and a 104-bit key, 24 00:01:18,020 --> 00:01:19,310 and the combination of these 25 00:01:19,310 --> 00:01:20,430 you would have to go and type in 26 00:01:20,430 --> 00:01:21,920 a bunch of ASCII characters. 27 00:01:21,920 --> 00:01:26,193 It was all the hex representation of that pre-shared key. 28 00:01:27,100 --> 00:01:28,940 This final bullet point right here. 29 00:01:28,940 --> 00:01:31,070 If you don't have enough traffic 30 00:01:31,070 --> 00:01:33,370 flowing across the wireless network, 31 00:01:33,370 --> 00:01:34,880 you can inject frames 32 00:01:34,880 --> 00:01:39,470 in order to cause the IV to be repeated. 33 00:01:39,470 --> 00:01:42,740 After WEP was cracked quite easily, 34 00:01:42,740 --> 00:01:45,890 and as computers started to become faster and faster, 35 00:01:45,890 --> 00:01:48,470 it was possible to crack WEP in seconds. 36 00:01:48,470 --> 00:01:49,940 It was very easy to do. 37 00:01:49,940 --> 00:01:51,910 So they needed a solution to that. 38 00:01:51,910 --> 00:01:54,880 And as they were working on WPA2, 39 00:01:54,880 --> 00:01:59,010 they put out a stop gap of WPA in 2003. 40 00:01:59,010 --> 00:02:00,920 So we had 1997 to 2003. 41 00:02:00,920 --> 00:02:05,160 We had six years for us to figure out that W-E-P or WEP, 42 00:02:05,160 --> 00:02:06,690 would not work for us. 43 00:02:06,690 --> 00:02:08,240 So we put out a stop gap. 44 00:02:08,240 --> 00:02:09,460 And all they essentially did 45 00:02:09,460 --> 00:02:12,150 was they changed the encryption protocol, 46 00:02:12,150 --> 00:02:15,990 and they upped the size of the initialization vector 47 00:02:15,990 --> 00:02:16,823 and the key. 48 00:02:16,823 --> 00:02:20,130 So we got 48-bit IV, 128-bit key, 49 00:02:20,130 --> 00:02:25,130 compare that to WEP-128, 24 and 104. 50 00:02:25,160 --> 00:02:27,150 So WPA2 was finally released. 51 00:02:27,150 --> 00:02:30,530 That became the standard for wireless encryption, 52 00:02:30,530 --> 00:02:33,860 or encryption and authentication on wireless networks, 53 00:02:33,860 --> 00:02:38,220 that is defined in IEEE standard 802.11i. 54 00:02:38,220 --> 00:02:39,530 128-bit key length. 55 00:02:39,530 --> 00:02:42,980 We're now using advanced encryption standard, or AES. 56 00:02:42,980 --> 00:02:45,570 As well, we are using counter mode 57 00:02:45,570 --> 00:02:50,570 Cipher Blockchain MAC Protocol for key exchange. 58 00:02:50,720 --> 00:02:54,350 And if you want to be WiFi certified, 59 00:02:54,350 --> 00:02:55,410 meaning that you wanna put 60 00:02:55,410 --> 00:02:58,190 the WiFi trademark on your product, 61 00:02:58,190 --> 00:03:02,540 then you do to support WPA2 as of 2006. 62 00:03:04,070 --> 00:03:07,150 In 2018, WPA3 was released. 63 00:03:07,150 --> 00:03:08,660 We increased the key length. 64 00:03:08,660 --> 00:03:10,090 We're still using CCMP. 65 00:03:10,090 --> 00:03:13,950 And if you want to get that wiFi trademark as of 2018, 66 00:03:13,950 --> 00:03:17,340 you need to support WPA3. 67 00:03:17,340 --> 00:03:18,320 But what is WPA? 68 00:03:18,320 --> 00:03:20,580 Stands for WiFi Protected Access. 69 00:03:20,580 --> 00:03:23,980 There's two different methods of authentication 70 00:03:23,980 --> 00:03:25,910 to actually join these networks. 71 00:03:25,910 --> 00:03:28,070 We have personal, and we have enterprise. 72 00:03:28,070 --> 00:03:32,910 With WPA2, we have pre-shared keys, also called WPA-PSK. 73 00:03:32,910 --> 00:03:34,830 Don't consider it user authentication. 74 00:03:34,830 --> 00:03:37,110 It's a password to join the network, 75 00:03:37,110 --> 00:03:40,080 often called a passphrase, to join the network. 76 00:03:40,080 --> 00:03:41,780 Provided it matches on both sides, 77 00:03:41,780 --> 00:03:43,470 you can join the network and talk, 78 00:03:43,470 --> 00:03:46,530 and you will exchange keys with the wireless network 79 00:03:46,530 --> 00:03:48,420 and be able to communicate. 80 00:03:48,420 --> 00:03:49,460 With WPA3, 81 00:03:49,460 --> 00:03:52,683 it's now called Simultaneous Authentication of Equals. 82 00:03:53,770 --> 00:03:56,690 It's defined at 802.11-2016. 83 00:03:56,690 --> 00:04:00,410 This particular key exchange mechanism, 84 00:04:00,410 --> 00:04:02,690 I believe it's referred to as SAM 85 00:04:02,690 --> 00:04:04,740 Though the E, and the M, 86 00:04:04,740 --> 00:04:05,573 off the top of my head, 87 00:04:05,573 --> 00:04:07,500 I don't know the difference there. 88 00:04:07,500 --> 00:04:08,990 For enterprise authentication, 89 00:04:08,990 --> 00:04:10,730 you do have user authentication. 90 00:04:10,730 --> 00:04:13,800 So user and password to join the network. 91 00:04:13,800 --> 00:04:17,090 This authentication needs to be authenticated by something. 92 00:04:17,090 --> 00:04:20,520 So username and password needs to be sent to something. 93 00:04:20,520 --> 00:04:21,890 You can still join the network, 94 00:04:21,890 --> 00:04:23,990 but you will be immediately prompted 95 00:04:23,990 --> 00:04:27,650 for username and password in order to continue. 96 00:04:27,650 --> 00:04:31,550 That brokerage of the authentication credentials 97 00:04:31,550 --> 00:04:34,253 is defined in various standards. 98 00:04:35,260 --> 00:04:40,260 So, 802.1X for wired and wireless authentication. 99 00:04:40,880 --> 00:04:43,050 You can see it is pretty complicated. 100 00:04:43,050 --> 00:04:44,750 The client would join. 101 00:04:44,750 --> 00:04:45,817 The access point would say, 102 00:04:45,817 --> 00:04:47,270 "Hey, you need to authenticate to this. 103 00:04:47,270 --> 00:04:49,400 This is an enterprise network." 104 00:04:49,400 --> 00:04:51,560 So you need to provide a username and password. 105 00:04:51,560 --> 00:04:53,910 The access point would then broker that communication 106 00:04:53,910 --> 00:04:58,870 back to a radius server for approval or denial 107 00:04:58,870 --> 00:05:01,160 of your request to join. 108 00:05:01,160 --> 00:05:04,290 The authentication protocol that's used 109 00:05:04,290 --> 00:05:06,230 as an upper layer Protocol. 110 00:05:06,230 --> 00:05:09,740 You can see there are several options available to you. 111 00:05:09,740 --> 00:05:11,290 From Lightweight EAP. 112 00:05:11,290 --> 00:05:14,610 EAP is Extensible Authentication Protocol. 113 00:05:14,610 --> 00:05:16,070 Lightweight EAP, EAP-FAST. 114 00:05:16,070 --> 00:05:18,120 There are even methods of authentication 115 00:05:18,120 --> 00:05:19,640 that use certificates. 116 00:05:19,640 --> 00:05:20,950 Both client side search, 117 00:05:20,950 --> 00:05:24,143 as well as mutual authentication using certificates. 118 00:05:25,870 --> 00:05:28,880 A comparison of the various encryption methods 119 00:05:28,880 --> 00:05:32,970 in WEP, WPA, WPA2 and Three. 120 00:05:32,970 --> 00:05:34,090 For WEP and WPA, 121 00:05:34,090 --> 00:05:37,070 we are using Rivest Cipher 4 for both of them. 122 00:05:37,070 --> 00:05:40,000 Remember that WPA is that stop gap protocol 123 00:05:40,000 --> 00:05:41,140 that came after WEP, 124 00:05:41,140 --> 00:05:44,760 before they finally certified WPA2. 125 00:05:44,760 --> 00:05:46,420 With WPA2 and Three, 126 00:05:46,420 --> 00:05:49,030 we switched to advanced encryption standard, 127 00:05:49,030 --> 00:05:50,990 the difference being the length of the keys. 128 00:05:50,990 --> 00:05:54,240 So we have 128-bit keys with WPA2, 129 00:05:54,240 --> 00:05:58,040 192-bit keys for WPA3. 130 00:05:58,040 --> 00:05:59,510 Now you'll notice in the upper left there 131 00:05:59,510 --> 00:06:02,550 we have good is green, and bad is red. 132 00:06:02,550 --> 00:06:04,930 And you'll notice we do have some blue on the screen, 133 00:06:04,930 --> 00:06:06,850 all of this stuff down here. 134 00:06:06,850 --> 00:06:07,683 And that is blue, 135 00:06:07,683 --> 00:06:09,640 because it is an option, it's available. 136 00:06:09,640 --> 00:06:11,390 Turn it on, good, turn it off, bad. 137 00:06:12,690 --> 00:06:14,500 So what is wrong with WEP? 138 00:06:14,500 --> 00:06:16,880 Starting off with, everyone uses the same key. 139 00:06:16,880 --> 00:06:20,330 So this is a problem with any pre-shared key mechanism. 140 00:06:20,330 --> 00:06:23,410 It's the age old debate of symmetric key cryptography 141 00:06:23,410 --> 00:06:25,810 versus asymmetric key cryptography. 142 00:06:25,810 --> 00:06:28,650 You have public private keys on the asymmetric side, 143 00:06:28,650 --> 00:06:31,400 and then shared keys on the symmetric side. 144 00:06:31,400 --> 00:06:35,700 For WEP as well as WPA-PSK, we have shared keys. 145 00:06:35,700 --> 00:06:37,330 What if someone leaves the company? 146 00:06:37,330 --> 00:06:39,040 How do you get that key back from them, 147 00:06:39,040 --> 00:06:41,170 and say, "Hey, don't use this key ever again," 148 00:06:41,170 --> 00:06:43,340 what if they are slightly offended 149 00:06:43,340 --> 00:06:45,350 that you have let them go? 150 00:06:45,350 --> 00:06:47,240 You have a key rotation problem 151 00:06:47,240 --> 00:06:49,963 with pre-shared key deployments, 152 00:06:51,020 --> 00:06:53,490 and that's where enterprise authentication comes into play. 153 00:06:53,490 --> 00:06:54,770 But we'll talk about that later. 154 00:06:54,770 --> 00:06:56,750 Some further insecurities with WEP, 155 00:06:56,750 --> 00:06:59,650 the initialization vector size is 24 bits. 156 00:06:59,650 --> 00:07:02,330 So we have two to the 24th possibilities 157 00:07:02,330 --> 00:07:04,480 for a single WEP key. 158 00:07:04,480 --> 00:07:08,890 To the 24th, that's 16,777,000 something. 159 00:07:08,890 --> 00:07:11,480 And the possibility of seeing an overlap 160 00:07:11,480 --> 00:07:14,270 of these initialization vectors becomes a problem. 161 00:07:14,270 --> 00:07:15,700 Because once you have that collision, 162 00:07:15,700 --> 00:07:19,530 you see the same IV twice, then it's possible to crack. 163 00:07:19,530 --> 00:07:21,600 Now you can inject frames 164 00:07:21,600 --> 00:07:25,930 in order to cause the the initialization vector collision 165 00:07:25,930 --> 00:07:27,183 to occur faster. 166 00:07:28,320 --> 00:07:29,520 And we'll talk about that. 167 00:07:29,520 --> 00:07:31,010 So how do we break WEP? 168 00:07:31,010 --> 00:07:33,140 We are gonna still continue to talk about WEP, 169 00:07:33,140 --> 00:07:35,500 because these networks are still in use. 170 00:07:35,500 --> 00:07:37,520 There's old equipment running in factories, 171 00:07:37,520 --> 00:07:38,840 who knows what you might encounter? 172 00:07:38,840 --> 00:07:40,870 How would you crack WEP? 173 00:07:40,870 --> 00:07:44,330 We're gonna be using the suite of tools available in Linux, 174 00:07:44,330 --> 00:07:45,840 and in subsequent lessons, 175 00:07:45,840 --> 00:07:47,760 we're actually gonna walk through the process 176 00:07:47,760 --> 00:07:49,770 of breaking WEP, screenshots, 177 00:07:49,770 --> 00:07:52,013 as well as breaking WPA2. 178 00:07:53,030 --> 00:07:54,830 Starting off we're gonna use airmon-ng 179 00:07:54,830 --> 00:07:58,100 to put the wireless interface into monitor mode, 180 00:07:58,100 --> 00:08:00,003 capture some frames with airodump, 181 00:08:01,570 --> 00:08:04,790 inject some packets all while capturing, 182 00:08:04,790 --> 00:08:07,730 and then crack the initialization, 183 00:08:07,730 --> 00:08:10,090 provided we captured it properly. 184 00:08:10,090 --> 00:08:14,480 For cracking WPA, you need this Pairwise Master Key. 185 00:08:14,480 --> 00:08:17,330 This is shared between both the client 186 00:08:17,330 --> 00:08:19,173 as well as the access point. 187 00:08:20,390 --> 00:08:22,230 It's derived from that pre-shared key 188 00:08:22,230 --> 00:08:24,610 that you type in to join the network. 189 00:08:24,610 --> 00:08:26,500 The handshake to join the network 190 00:08:26,500 --> 00:08:29,500 includes this Message Integrity Check. 191 00:08:29,500 --> 00:08:32,070 The MIC can then be brute forced. 192 00:08:32,070 --> 00:08:37,040 Similar process, airmon, dump, replay, crack, in order to... 193 00:08:37,040 --> 00:08:40,500 So you can forcefully deauthenticate clients 194 00:08:40,500 --> 00:08:43,140 so that they would need to rejoin, 195 00:08:43,140 --> 00:08:46,513 and then we can capture this Message Integrity Check. 196 00:08:48,030 --> 00:08:50,380 So how do we protect ourselves 197 00:08:50,380 --> 00:08:52,090 from these encryption attacks? 198 00:08:52,090 --> 00:08:53,350 Don't use WEP, of course, 199 00:08:53,350 --> 00:08:57,010 use WPA3 or Two, Complex Passphrases. 200 00:08:57,010 --> 00:08:59,030 They don't have to be eight characters, 201 00:08:59,030 --> 00:09:00,763 which is the minimum for WPA. 202 00:09:01,690 --> 00:09:03,580 Make 'em long, make 'em complicated. 203 00:09:03,580 --> 00:09:06,630 Special characters, upper, lowercase, all that stuff. 204 00:09:06,630 --> 00:09:09,303 Only use AES for encryption, don't use TKIP, 205 00:09:10,140 --> 00:09:12,060 that is considered vulnerable, 206 00:09:12,060 --> 00:09:15,090 and consider using higher layer encryption. 207 00:09:15,090 --> 00:09:18,530 So your Transport Layer Security, IPSec, 208 00:09:18,530 --> 00:09:21,763 running on top of the encryption provided by wiFi.