1 00:00:00,000 --> 00:00:02,040 A very good afternoon to all of you. 2 00:00:03,620 --> 00:00:07,100 My name is Sohail and I work for Airtight Networks. 3 00:00:07,100 --> 00:00:08,640 I'm a Wi-Fi security researcher. 4 00:00:09,480 --> 00:00:15,300 And today I'm going to talk about a security problem in WPA2 protocol. 5 00:00:21,120 --> 00:00:23,540 You may have heard about hole 196. 6 00:00:23,860 --> 00:00:27,560 In fact, last one and a half week a lot has been said 7 00:00:27,560 --> 00:00:35,660 and discussed about hole 196 or GTK vulnerability. 8 00:00:37,380 --> 00:00:44,680 And in fact, a lot of speculations have been seen around this problem. 9 00:00:44,860 --> 00:00:49,340 So today we are going to present the real picture 10 00:00:49,340 --> 00:00:56,700 and we'll help you understand or see the implication of the problem. 11 00:00:58,340 --> 00:01:04,660 So let me answer the most frequently asked questions that people have asked to me. 12 00:01:05,580 --> 00:01:07,900 Where did we find this hole 196? 13 00:01:10,000 --> 00:01:13,520 And for your information, it's already there in the standard. 14 00:01:13,660 --> 00:01:19,500 For last six years, it was buried in the standard on page number 196 15 00:01:19,500 --> 00:01:23,360 and that's the reason why we are calling it a hole 196. 16 00:01:24,120 --> 00:01:26,180 If you see the last line of the... 17 00:01:27,560 --> 00:01:34,760 page 196, the designers of dot 11 have warned about the weakness of WPA2, 18 00:01:34,880 --> 00:01:37,240 one key that is used in WPA2. 19 00:01:37,840 --> 00:01:42,360 And on the last line, there is something mentioned about that key. 20 00:01:42,640 --> 00:01:45,580 GTKs do not have this property. 21 00:01:45,880 --> 00:01:50,800 So designers are talking about some property of encryption key 22 00:01:50,800 --> 00:01:52,400 which is not there, which is lacking. 23 00:01:53,900 --> 00:01:56,900 But this problem was never discussed. 24 00:01:57,560 --> 00:02:07,880 And in fact, there is a problem, but it was never brought to the attention of WPA2 users. 25 00:02:08,600 --> 00:02:11,740 So in this presentation, we will talk about that. 26 00:02:12,640 --> 00:02:20,280 So this talk is not about unauthorized user taking or gaining access to your corporate or your trusted network. 27 00:02:20,640 --> 00:02:22,000 No, it's not about that. 28 00:02:22,860 --> 00:02:24,560 It's not about key cracking. 29 00:02:25,980 --> 00:02:26,580 Okay? 30 00:02:26,580 --> 00:02:30,940 It's not about cracking private key of a user. 31 00:02:31,200 --> 00:02:33,760 This talk is about an insider attack. 32 00:02:35,180 --> 00:02:39,360 That can be carried by a malicious user who is already part of your network, 33 00:02:39,460 --> 00:02:40,900 who is already inside the network. 34 00:02:42,260 --> 00:02:44,160 But I have seen people saying that, 35 00:02:44,980 --> 00:02:49,500 okay, when a malicious user is already inside the network, 36 00:02:49,700 --> 00:02:53,720 then he can do pretty much anything or everything in that network. 37 00:02:54,000 --> 00:02:55,300 Okay, so what's the big deal? 38 00:02:57,580 --> 00:02:58,060 Fine. 39 00:02:58,640 --> 00:03:00,580 So let me ask this question to them. 40 00:03:03,120 --> 00:03:06,140 If, let's assume that if you are a malicious insider, 41 00:03:06,840 --> 00:03:11,340 can you really sniff private data of other Wi-Fi users? 42 00:03:14,040 --> 00:03:17,640 If you try to capture packet in the air, you will see encrypted packet. 43 00:03:17,920 --> 00:03:21,920 And since you don't have key, you will not be able to decrypt it. 44 00:03:22,160 --> 00:03:26,560 So can you really sniff or see private traffic of other Wi-Fi users? 45 00:03:26,580 --> 00:03:37,360 users even if you are inside the network and the trick to do that is basically 46 00:03:37,360 --> 00:03:42,680 one can try launching man-in-the-middle attack and the most popular trick is 47 00:03:42,680 --> 00:03:49,480 basically in in basically in Wi-Fi network is setting up a map a honeypot 48 00:03:49,480 --> 00:03:55,840 okay using this one can actually do man-in-the-middle and try to capture all 49 00:03:55,840 --> 00:04:03,520 the traffic of a user but in a WPA2 networks client devices are actually 50 00:04:03,520 --> 00:04:09,160 configured to connect to WPA2 okay so those clients are not going to 51 00:04:09,160 --> 00:04:13,960 authenticate honeypot access point or they will not connect so this trick is 52 00:04:13,960 --> 00:04:21,500 also not going to work so what are the other options available so probably we 53 00:04:21,500 --> 00:04:25,820 can think of launching man-in-the-middle style man-in-the-middle attack in 54 00:04:25,820 --> 00:04:33,320 a very conventional style old style with the help of our spoofing attack but 55 00:04:33,320 --> 00:04:41,340 today's network are basically much more secure than what it used to be there are 56 00:04:41,340 --> 00:04:46,920 security systems which can actually detect our spoofing attack wired IDS IPS 57 00:04:46,920 --> 00:04:52,460 or even switches have capability to detect it okay so if you are going to 58 00:04:52,460 --> 00:04:55,800 launch our spoofing attack the chance of man-in-the-middle attack is very small 59 00:04:55,820 --> 00:05:02,040 chances of getting detected is very very high okay so now let me ask again 60 00:05:02,040 --> 00:05:07,060 this question that without getting detected can you really sniff private 61 00:05:07,060 --> 00:05:13,360 traffic or data of other Wi-Fi users even if you are inside that network is 62 00:05:13,360 --> 00:05:20,840 it really possible the answer is yes in this presentation I'm going to show you 63 00:05:20,840 --> 00:05:25,620 that it is possible and this will not 64 00:05:25,820 --> 00:05:31,880 involve any key cracking or brute force how let's walk through the presentation 65 00:05:31,880 --> 00:05:39,320 and we'll see so I'd like to briefly talk about wpa2 protocol I'm sure many of 66 00:05:39,320 --> 00:05:44,960 you must have a good technical understanding of that but just to 67 00:05:45,740 --> 00:05:52,080 recall in wpa2 protocol there are two types of keys which are used for traffic 68 00:05:52,080 --> 00:05:55,380 encryption packet encryption one is called PTK 69 00:05:55,820 --> 00:06:02,880 pairwise transient key and the other one is GTK group temporal key and the 70 00:06:02,880 --> 00:06:10,960 purpose of PTK is to protect unicast traffic okay while the purpose of 71 00:06:10,960 --> 00:06:17,660 GTK is to protect broadcast or multicast traffic so there are two types 72 00:06:17,660 --> 00:06:25,740 of keys if you see PTK is a unique key it is unique for each user 73 00:06:25,820 --> 00:06:31,520 and it is derived per session so for example if two clients are connected to a 74 00:06:31,520 --> 00:06:38,420 wpa2 enabled access point both of these clients will be using two different keys 75 00:06:38,420 --> 00:06:42,620 so client one will not know the private key of client two and client two will 76 00:06:42,620 --> 00:06:50,140 not know the private key of client one so their traffic is basically secure but 77 00:06:50,960 --> 00:06:55,720 GTK is a shared key it is shared among all associated client devices 78 00:06:55,820 --> 00:07:00,260 and it is actually managed by access point so whenever a client connects to 79 00:07:00,260 --> 00:07:08,760 access point it receives a copy of GTK from access point okay so at any point 80 00:07:08,760 --> 00:07:18,100 in time all associated clients are going to have same copy of GTK now I 81 00:07:19,400 --> 00:07:25,780 said GTK is used to protect broadcast traffic or multicast traffic so in 82 00:07:25,820 --> 00:07:30,420 a in a Wi-Fi network if you have noticed all broadcast traffic is 83 00:07:30,420 --> 00:07:34,220 basically sent by access point because access point can talk to each and every 84 00:07:34,220 --> 00:07:41,040 client okay and this traffic is never sent by client device because client can 85 00:07:41,040 --> 00:07:45,660 whenever a client has to talk to other Wi-Fi client device it it first send 86 00:07:45,660 --> 00:07:53,060 packets to access point okay so for a client destination is always fixed which 87 00:07:53,060 --> 00:07:54,520 means client always 88 00:07:56,820 --> 00:08:02,140 send unicast packet and that gets so does that mean client never generate 89 00:08:02,140 --> 00:08:07,660 broadcast packet it generates but it in dot 11 that broadcast frame gets mapped 90 00:08:07,660 --> 00:08:18,420 to unicast frame okay we'll not talk about that but just to you know so which 91 00:08:18,420 --> 00:08:25,700 means by design GTK is going to be used as a one-way key access point is going 92 00:08:25,820 --> 00:08:32,020 to use it for traffic encryption broadcast traffic encryption and all 93 00:08:32,020 --> 00:08:40,180 client devices are going to use it as a decryption key and that's how the 94 00:08:40,180 --> 00:08:46,720 software in access point and clients are programmed and here I'm showing you a 95 00:08:46,720 --> 00:08:52,140 log of Wi-Fi client device there is a software called WPS applicant which runs 96 00:08:52,140 --> 00:08:55,800 on client devices and it shows the 97 00:08:55,820 --> 00:09:06,060 that client has a copy of GTK available right so the group key is always 98 00:09:06,060 --> 00:09:09,520 available to client device it is always known to client device why it is 99 00:09:09,520 --> 00:09:14,440 available why client keeps a copy of GTK because it has to decrypt packet coming 100 00:09:14,440 --> 00:09:22,380 from access point okay now let me ask what is stopping that client not using 101 00:09:22,380 --> 00:09:25,780 that GTK for its own packet encryption so 102 00:09:25,820 --> 00:09:31,680 protocol says something which is a normal of normal behavior right client 103 00:09:31,680 --> 00:09:36,040 should not use this key for packet encryption it should always use this key 104 00:09:36,040 --> 00:09:39,880 for packet decryption but a malicious user can always exploit this key 105 00:09:39,880 --> 00:09:44,720 malicious user present in that network can always use this key to create its 106 00:09:44,720 --> 00:09:55,660 own packet generate its own packet which means for a malicious user one 107 00:09:55,820 --> 00:10:02,240 broadcast frame is available which that malicious insider can generate is 108 00:10:02,240 --> 00:10:08,960 created and send that packet to all other Wi-Fi client devices but Wi-Fi 109 00:10:08,960 --> 00:10:13,140 client devices are programmed to receive packets from access point not from other 110 00:10:13,140 --> 00:10:22,860 Wi-Fi client device right so in order to successfully deliver that packet this 111 00:10:22,860 --> 00:10:25,740 insider is going to spoof the MAC address of access point 112 00:10:28,300 --> 00:10:36,020 So once the attacker keeps the MAC address of access point as the sender of that packet, 113 00:10:36,260 --> 00:10:41,440 all clients present in that network and associated with the same access point is going to receive 114 00:10:41,440 --> 00:10:45,700 that packet and going to decrypt it successfully, right? 115 00:10:45,780 --> 00:10:52,860 Which means a malicious insider has access to a broadcast frame which it can create and 116 00:10:52,860 --> 00:10:53,680 generate and send. 117 00:10:54,640 --> 00:11:00,360 And there is no way for other Wi-Fi client devices to differentiate whether this packet 118 00:11:00,360 --> 00:11:04,140 is coming from other malicious user or it is coming from access point. 119 00:11:04,340 --> 00:11:09,160 Absolutely, there is nothing present in that packet which can help a client to, you know. 120 00:11:12,940 --> 00:11:17,900 So it's now it's clear that attacker can send broadcast packet. 121 00:11:18,520 --> 00:11:21,020 So he can do a lot of attack. 122 00:11:21,240 --> 00:11:21,940 It depends. 123 00:11:21,940 --> 00:11:26,100 It depends what kind of attack payload he's going to encapsulate inside that broadcast 124 00:11:26,100 --> 00:11:27,300 frame, right? 125 00:11:28,120 --> 00:11:34,000 So in this presentation, I'm going to show you three exploits of GTK. 126 00:11:34,680 --> 00:11:43,440 And the first exploit is basically using the ARP payload to encapsulate and create broadcast 127 00:11:43,440 --> 00:11:44,020 frame. 128 00:11:45,960 --> 00:11:50,560 So in this example, attacker is... 129 00:11:50,560 --> 00:11:50,900 Okay. 130 00:11:51,440 --> 00:11:51,920 Okay. 131 00:11:51,940 --> 00:11:58,220 It is generating its own broadcast frame and sending that frame to other Wi-Fi users present 132 00:11:58,220 --> 00:11:58,960 in that network. 133 00:11:59,180 --> 00:12:02,620 And basically, the attacker is advertising that he's a gateway of that network. 134 00:12:05,480 --> 00:12:11,780 All other clients are going to receive that packet and update its ARP cache, thinking that 135 00:12:12,520 --> 00:12:16,040 the gateway, this new machine has become the gateway of that. 136 00:12:16,200 --> 00:12:17,740 That's how our protocol works. 137 00:12:17,940 --> 00:12:19,980 If you send, if you advertise that you are a gateway. 138 00:12:20,340 --> 00:12:20,860 Okay. 139 00:12:20,860 --> 00:12:23,760 All recipients of that packet is going to update its ARP cache. 140 00:12:26,040 --> 00:12:32,300 So attacker becomes the gateway of the network for that client who receives that packet. 141 00:12:32,560 --> 00:12:38,500 And after that, all traffic generated from that victim is going to be destined to this 142 00:12:38,500 --> 00:12:39,960 new gateway, who is the attacker. 143 00:12:40,800 --> 00:12:46,420 So victim sends all its packet to access point, encrypting its packet with its own private 144 00:12:46,420 --> 00:12:50,220 key, which is known to this user or access point. 145 00:12:50,620 --> 00:12:53,600 So access point will be able to decrypt those packets. 146 00:12:55,420 --> 00:13:00,000 And at this point, access point finds that this packet is actually destined for other 147 00:13:00,000 --> 00:13:03,280 Wi-Fi user, who is also part of the same network. 148 00:13:03,800 --> 00:13:07,560 So access point forwards that packet to other Wi-Fi user. 149 00:13:07,760 --> 00:13:10,800 And that other Wi-Fi user happened to be a malicious attacker. 150 00:13:12,380 --> 00:13:15,800 So finally the packet reaches to that insider. 151 00:13:15,800 --> 00:13:22,220 So just by injecting one spoofed gratitude or ARP request frame, the attacker is able 152 00:13:22,220 --> 00:13:31,180 to redirect all the private traffic of a legitimate user in that network to its own machine. 153 00:13:34,880 --> 00:13:41,160 At this point, attacker can actually drop all the packets and do denial of service attack 154 00:13:41,160 --> 00:13:41,820 in the network. 155 00:13:42,020 --> 00:13:44,060 But he wants to steal information. 156 00:13:44,400 --> 00:13:44,920 Right? 157 00:13:44,920 --> 00:13:53,300 So for that, he has to provide a seamless service to the user, a transparent service 158 00:13:53,300 --> 00:13:54,000 to the user. 159 00:13:54,740 --> 00:13:57,960 User should not feel that there is something wrong going on in that network. 160 00:13:58,080 --> 00:14:01,820 For example, if I'm accessing Yahoo, and I'm not able to access that, it means there 161 00:14:01,820 --> 00:14:03,080 is something wrong in that network. 162 00:14:03,360 --> 00:14:09,220 So what happens is that attacker is going to forward all that packet to actual server 163 00:14:09,220 --> 00:14:09,880 or gateway. 164 00:14:10,880 --> 00:14:12,720 And he becomes man in the middle. 165 00:14:13,160 --> 00:14:13,640 Right? 166 00:14:13,640 --> 00:14:21,520 So just by exploiting the GTK shared key and forging its own broadcast packet, attacker 167 00:14:21,520 --> 00:14:27,980 is able to redirect private traffic of other victim to its machine and able to provide 168 00:14:27,980 --> 00:14:28,280 services. 169 00:14:29,360 --> 00:14:35,080 Since attacker is sending a broadcast frames, it means all other Wi-Fi client devices which 170 00:14:35,080 --> 00:14:41,860 are also present in that network are going to receive that packet and update its ARP cache. 171 00:14:42,040 --> 00:14:43,620 So attacker is not just going to send the packet to the server. 172 00:14:43,640 --> 00:14:46,160 He is not just victimizing one Wi-Fi user. 173 00:14:46,320 --> 00:14:51,600 He is victimizing almost all Wi-Fi users who are in the range of that attacker. 174 00:14:53,280 --> 00:15:00,360 Now one can ask, what is the difference between this and the old style, conventional style 175 00:15:00,360 --> 00:15:01,440 of ARP spoofing attack? 176 00:15:02,140 --> 00:15:07,640 One can, I mean, no matter what, I mean, no matter if you are using a WPA2 network, I 177 00:15:07,640 --> 00:15:09,740 can always use ARP spoofing attack. 178 00:15:10,020 --> 00:15:12,260 I can always launch ARP attack. 179 00:15:12,380 --> 00:15:13,620 Do man in the middle. 180 00:15:13,620 --> 00:15:19,200 So in this old style ARP spoofing attack, your packet first goes to access point. 181 00:15:19,760 --> 00:15:26,060 And after that access point decides and forwards those packets to wired segment of the LAN 182 00:15:26,060 --> 00:15:32,160 or wireless segment of the LAN, which means the security systems present on that network, 183 00:15:32,360 --> 00:15:36,020 wired IDS or IPS or switches are going to see that packet. 184 00:15:36,960 --> 00:15:42,640 Which means the footprint of the attack is available on the wire and in any wired security 185 00:15:42,640 --> 00:15:47,520 systems, which are capable of detecting ARP spoofing attack, are going to capture that 186 00:15:47,520 --> 00:15:49,000 packet and detect this attack. 187 00:15:51,240 --> 00:15:57,700 But then when attacker is using this stealth mode attack, packets are directly sent by 188 00:15:57,700 --> 00:16:01,640 one malicious user to other Wi-Fi users in that network. 189 00:16:01,880 --> 00:16:05,680 Packets are never going to access point and it is never reaching to wired segment of the 190 00:16:05,680 --> 00:16:05,860 LAN. 191 00:16:07,020 --> 00:16:11,260 Which means the footprint of attack is limited to the air. 192 00:16:12,100 --> 00:16:12,620 Right? 193 00:16:12,640 --> 00:16:17,460 Which means most of the wired IDS, IPS systems are going, will not detect this. 194 00:16:18,060 --> 00:16:21,160 Because packet is not hitting the wired segment of the LAN. 195 00:16:22,020 --> 00:16:29,020 So without getting detected, attacker can do man in the middle attack and steal private 196 00:16:29,020 --> 00:16:31,760 information of other Wi-Fi users in a WPA2 network. 197 00:16:32,940 --> 00:16:33,500 Okay? 198 00:16:35,140 --> 00:16:40,280 So this is one example of GTK exploit or hole 196 exploit. 199 00:16:40,480 --> 00:16:41,480 I'm going to... 200 00:16:42,780 --> 00:16:44,460 Present here the second exploit. 201 00:16:45,440 --> 00:16:49,980 And it's all about, you know, changing the payload, what kind of payload you are encapsulating 202 00:16:49,980 --> 00:16:51,340 in that broadcast frame. 203 00:16:51,720 --> 00:17:01,520 So this time, attacker is going to use unicast IP payload inside that packet to basically 204 00:17:01,520 --> 00:17:03,380 launch IP level targeted attack. 205 00:17:03,620 --> 00:17:09,900 So for example, if frame is at layer two, frame is broadcast, but I can always use IP 206 00:17:09,900 --> 00:17:10,200 layer. 207 00:17:10,900 --> 00:17:11,460 Okay? 208 00:17:11,480 --> 00:17:13,240 Layer three unicast frame inside that. 209 00:17:16,820 --> 00:17:19,100 And one example could be, you know, port scanning. 210 00:17:19,400 --> 00:17:24,680 If I'm going to use a payload which is used for port scanning, then my packets will actually 211 00:17:24,680 --> 00:17:27,700 reach to the victim and victim will respond to that packet. 212 00:17:27,940 --> 00:17:32,620 Which means I can do port scanning and I can find out whether that Wi-Fi user is vulnerable 213 00:17:32,920 --> 00:17:33,440 or not. 214 00:17:34,620 --> 00:17:36,280 Which can further be exploited. 215 00:17:37,000 --> 00:17:39,160 So just think what else is possible. 216 00:17:40,220 --> 00:17:40,920 I mean... 217 00:17:40,920 --> 00:17:45,760 If I know that this payload is going to cause some buffer overflow, then I can inject that 218 00:17:45,760 --> 00:17:46,120 packet. 219 00:17:47,160 --> 00:17:47,200 Right? 220 00:17:48,200 --> 00:17:49,100 I can... 221 00:17:49,100 --> 00:17:50,600 Probably I can also inject malware. 222 00:17:51,320 --> 00:17:55,680 So a frame is available in which attacker can inject... 223 00:17:55,680 --> 00:18:01,780 In which attacker can encapsulate payload of his choice and cause serious damage to 224 00:18:01,780 --> 00:18:02,600 other Wi-Fi users. 225 00:18:04,960 --> 00:18:08,280 This is second example of GTK exploit. 226 00:18:08,960 --> 00:18:10,900 The third example of GTK exploit. 227 00:18:10,900 --> 00:18:15,720 The third example of GTK exploit is related to the replay detection in WPA2. 228 00:18:15,860 --> 00:18:18,820 There is something called replay detection in WPA2. 229 00:18:19,360 --> 00:18:28,160 So all encrypted data frames have this field called packet number, which is a 48 byte number. 230 00:18:28,620 --> 00:18:32,420 And this number is going to be present in all encrypted data frames. 231 00:18:32,700 --> 00:18:37,080 And this number is used to detect whether a frame is replayed or not. 232 00:18:38,360 --> 00:18:40,480 And how that replay detection works? 233 00:18:40,480 --> 00:18:47,040 When client connects to access point, access point informs that client that this is the 234 00:18:47,640 --> 00:18:49,280 last consumed packet number. 235 00:18:49,520 --> 00:18:52,280 So you should use this number for replay detection. 236 00:18:52,780 --> 00:18:57,280 So for example, last consumed packet number was 700. 237 00:18:57,780 --> 00:19:01,840 Client is going to cache that number, save that number. 238 00:19:02,280 --> 00:19:08,020 And after that, client is expecting data frame having packet number greater than 700. 239 00:19:08,260 --> 00:19:10,120 So for example, if I'm replaying packet. 240 00:19:10,120 --> 00:19:13,520 Which I have captured at the time when packet number was 600. 241 00:19:14,180 --> 00:19:19,700 And if I'm replaying that packet, that packet will not be accepted because client will find 242 00:19:19,700 --> 00:19:25,520 that the packet number is less than the last successfully received packet, which was 700. 243 00:19:27,880 --> 00:19:34,560 When access point sends packet, it will send with 700 one, because that is part of its 244 00:19:35,080 --> 00:19:35,900 traffic stream. 245 00:19:36,280 --> 00:19:38,040 It has already sent 700. 246 00:19:38,180 --> 00:19:40,040 So next packet will be 701. 247 00:19:40,040 --> 00:19:41,580 702, and so on. 248 00:19:41,940 --> 00:19:48,760 So when access point sends packet with 701, client is going to accept that packet. 249 00:19:49,840 --> 00:19:56,020 And once the packet is successfully decrypted, client is going to update its locally cached 250 00:19:56,020 --> 00:19:56,900 packet number. 251 00:19:57,100 --> 00:19:59,500 So now the packet number becomes 701. 252 00:19:59,900 --> 00:20:05,720 And that 701 will be used to detect replayed frames. 253 00:20:08,120 --> 00:20:09,840 So attacker is. 254 00:20:09,840 --> 00:20:12,680 He is going to exploit this replay detection logic. 255 00:20:14,280 --> 00:20:20,360 Here what attacker is doing, he is injecting a very large packet number, arbitrarily generated 256 00:20:20,360 --> 00:20:23,280 number, because it is a 48-bit number, right? 257 00:20:24,020 --> 00:20:30,660 So let's take this example in which client, the last successfully received packet number 258 00:20:30,660 --> 00:20:31,740 was 780. 259 00:20:32,960 --> 00:20:38,340 At this point, attacker is injecting a packet, because attacker knows the GTK, he can create 260 00:20:38,340 --> 00:20:39,520 its broadcast frame. 261 00:20:39,840 --> 00:20:42,760 He can put any number of his choice. 262 00:20:42,880 --> 00:20:48,300 So he is going to put a number, let's say, 9,999, nine, four nines, okay? 263 00:20:49,680 --> 00:20:54,540 Client is going to accept that packet, because at the time of replay detection check, it 264 00:20:54,540 --> 00:20:59,280 finds that packet number is greater than the last successfully received packet number, 265 00:20:59,460 --> 00:21:00,860 which was 780. 266 00:21:03,140 --> 00:21:07,860 So the client is going to update its locally saved packet number. 267 00:21:08,020 --> 00:21:09,400 And the last. 268 00:21:09,400 --> 00:21:13,600 The local packet number becomes 9,999. 269 00:21:15,660 --> 00:21:17,980 Access point has no idea about this. 270 00:21:18,640 --> 00:21:21,560 This change which has happened on the client device. 271 00:21:23,620 --> 00:21:29,500 So access point will send broadcast packet as per its own traffic stream. 272 00:21:29,740 --> 00:21:33,620 So the last packet which was sent by access point was 780. 273 00:21:33,820 --> 00:21:38,860 So next time it will send 781, 782, 783. 274 00:21:39,000 --> 00:21:39,380 And so on. 275 00:21:39,380 --> 00:21:44,260 But let's see what is happening at the client device. 276 00:21:44,460 --> 00:21:51,240 Client device finds that the numbers are too less to the locally saved packet number. 277 00:21:51,520 --> 00:21:56,680 Last saved packet number was 9,000 and I'm getting 781, which means somebody is replaying 278 00:21:56,680 --> 00:21:56,860 packet. 279 00:21:57,600 --> 00:22:02,380 So client device is going to drop all the broadcast packet whose packet number is less 280 00:22:02,380 --> 00:22:04,480 than its locally cast packet number. 281 00:22:04,940 --> 00:22:07,600 Now imagine the implication of this. 282 00:22:07,600 --> 00:22:16,640 All Wi-Fi client devices who have successfully received attacker injected high packet number 283 00:22:18,060 --> 00:22:21,700 will start dropping all the broadcast packet coming from access point. 284 00:22:21,840 --> 00:22:28,200 Which means the protocol which works on broadcast packet will not work. 285 00:22:28,680 --> 00:22:29,080 Right? 286 00:22:29,420 --> 00:22:33,040 Two clients will not be able to communicate with each other because they will not be able 287 00:22:33,040 --> 00:22:34,140 to resolve ARP. 288 00:22:35,580 --> 00:22:36,700 So attacker. 289 00:22:36,860 --> 00:22:37,580 By example. 290 00:22:37,580 --> 00:22:44,620 By exploiting this replay detection logic, he is causing denial of service attack in 291 00:22:45,350 --> 00:22:46,120 downlink direction. 292 00:22:47,300 --> 00:22:50,500 And which can break few protocols. 293 00:22:51,320 --> 00:22:59,720 So this was the third example of exploit of hole 196 or GTK vulnerability. 294 00:23:01,270 --> 00:23:07,480 Now I will talk about the POC code that was written to exploit GTK. 295 00:23:09,320 --> 00:23:12,620 And I have used two open source software. 296 00:23:12,780 --> 00:23:14,640 One is WPS applicant software. 297 00:23:16,040 --> 00:23:17,640 And I have used it. 298 00:23:18,760 --> 00:23:20,460 There was no modification done. 299 00:23:20,520 --> 00:23:22,320 So it was used as it is. 300 00:23:22,820 --> 00:23:26,860 And then I have used open source driver, mad Wi-Fi. 301 00:23:27,700 --> 00:23:32,720 And the main modification was done in the driver part of the mad Wi-Fi. 302 00:23:34,260 --> 00:23:37,560 So before we actually see what kind of modification was done. 303 00:23:40,160 --> 00:23:44,680 Let me quickly present the dot 11 frame here. 304 00:23:45,980 --> 00:23:51,100 When a client sends a packet to access point, it is called to DS frame. 305 00:23:51,760 --> 00:23:53,400 From client to access point. 306 00:23:53,520 --> 00:23:54,060 Uplink packet. 307 00:23:55,960 --> 00:24:01,480 And when access point sends a packet to client, it is called from DS packet. 308 00:24:01,740 --> 00:24:03,720 Or it is a kind of downlink packet. 309 00:24:03,940 --> 00:24:06,400 And there is a field present in the frame. 310 00:24:06,400 --> 00:24:08,760 Which indicates about the direction of frame. 311 00:24:08,820 --> 00:24:10,600 Whether it is going from client to access point. 312 00:24:10,820 --> 00:24:12,960 Or it is coming from access point to client. 313 00:24:15,480 --> 00:24:21,320 But if you notice, there is not much difference between to DS frame and from DS frame. 314 00:24:21,820 --> 00:24:27,520 If you do a cyclic shift, to DS frame will become from DS frame. 315 00:24:27,640 --> 00:24:30,360 You move address 3 to address 1. 316 00:24:30,420 --> 00:24:31,540 Address 1 to address 2. 317 00:24:31,660 --> 00:24:33,240 And address 2 to address 3. 318 00:24:33,280 --> 00:24:35,460 It will become from DS frame. 319 00:24:36,400 --> 00:24:40,120 And this requires three line of code to do that. 320 00:24:41,280 --> 00:24:44,940 And one line of code to change to DS flag to from DS flag. 321 00:24:45,100 --> 00:24:50,860 So in four line of code, you can actually convert two DS packet into four DS packet. 322 00:24:52,020 --> 00:24:53,100 From DS packet. 323 00:24:54,220 --> 00:24:58,720 And then you need to select a right key to encrypt that packet. 324 00:24:59,020 --> 00:25:03,880 Because client always use unicast data traffic. 325 00:25:04,020 --> 00:25:05,660 So it always use unicast key. 326 00:25:06,400 --> 00:25:11,280 So, six lines of code were added to choose the right key. 327 00:25:11,500 --> 00:25:13,000 So it's just about selection. 328 00:25:13,260 --> 00:25:16,240 In which data structure, what kind of key is stored. 329 00:25:16,540 --> 00:25:16,940 Right? 330 00:25:17,000 --> 00:25:21,820 So in just ten lines of code, it was possible to exploit the GTK vulnerability. 331 00:25:25,660 --> 00:25:26,160 So. 332 00:25:27,820 --> 00:25:28,320 . 333 00:25:34,840 --> 00:25:36,080 So now I will. 334 00:25:36,180 --> 00:25:36,380 . 335 00:25:36,380 --> 00:25:42,540 , do a demo of man-in-the-middle attack in which GTK vulnerability will be exploited. 336 00:25:43,600 --> 00:25:46,420 And after that, I will talk about the counter measures. 337 00:25:48,300 --> 00:25:55,380 So in this example, the demo that I'm going to do now, I'll be using two Wi-Fi client devices. 338 00:25:55,760 --> 00:26:00,000 One client device is going to be my, the same laptop which I'm using for presentation. 339 00:26:00,660 --> 00:26:02,540 And then I have one more laptop here. 340 00:26:04,000 --> 00:26:05,780 Which is running backtrack. 341 00:26:07,040 --> 00:26:13,700 And I'm going to use one of the tools available for launching man-in-the-middle attack. 342 00:26:13,860 --> 00:26:16,900 There are a lot of tools available using which one can launch MITM. 343 00:26:17,040 --> 00:26:23,500 So, for example, these are the tools, very popular tools, which are used to launch man-in-the-middle attack. 344 00:26:23,680 --> 00:26:24,960 So I'm going to use one of the tools. 345 00:26:25,100 --> 00:26:31,940 So the only modification, the only soft code changes that was done was in mad Wi-Fi driver. 346 00:26:32,460 --> 00:26:35,300 Everything is available open source. 347 00:26:43,300 --> 00:26:44,700 . 348 00:26:44,700 --> 00:26:44,720 . 349 00:26:51,520 --> 00:26:52,920 . 350 00:26:52,920 --> 00:26:53,160 . 351 00:26:54,960 --> 00:26:56,360 . 352 00:27:06,380 --> 00:27:16,320 access point here and you can see the SSID of that access point is corporate 353 00:27:16,320 --> 00:27:19,380 Wi-Fi and if you go you will see 354 00:27:24,460 --> 00:27:31,140 that this is a WPA2 configured this is a WPA2 access point okay 355 00:28:00,140 --> 00:28:05,040 so I'm going to access my attacker machine with the help of VNC software so 356 00:28:05,040 --> 00:28:06,360 that you can also see what's going on 357 00:28:06,380 --> 00:28:08,180 on the attacker machine 358 00:28:42,240 --> 00:28:43,640 so 359 00:28:49,400 --> 00:28:50,800 so 360 00:28:50,800 --> 00:28:51,800 so 361 00:28:51,800 --> 00:28:52,020 so 362 00:28:52,020 --> 00:28:52,740 so 363 00:28:52,740 --> 00:28:52,760 so 364 00:29:25,180 --> 00:29:30,100 Okay, so my machine is accessible, so we can access this. 365 00:29:33,180 --> 00:29:38,500 So, this is the backtrack running machine which I'm going to use to launch attack. 366 00:29:49,960 --> 00:29:50,860 Okay, perfect. 367 00:29:53,140 --> 00:29:53,720 Okay. 368 00:30:07,060 --> 00:30:10,700 Is this visible to people at the back? 369 00:30:12,100 --> 00:30:13,920 Or should I increase the font size? 370 00:30:17,500 --> 00:30:18,020 Okay. 371 00:30:39,660 --> 00:30:42,160 All my stuff is here. 372 00:30:43,240 --> 00:30:47,020 And I have two Wi-Fi interfaces. 373 00:30:47,020 --> 00:30:49,160 One interface is running on this laptop. 374 00:30:49,540 --> 00:30:53,020 One is running on top of unmodified version of driver. 375 00:30:53,280 --> 00:30:57,160 I will be using it to demonstrate something. 376 00:30:57,500 --> 00:31:03,440 And then I have at zero interface which is running on top of a modified version of driver. 377 00:31:10,680 --> 00:31:15,500 So, let's, so I'm going to use SSL strip software 378 00:31:15,500 --> 00:31:17,720 to launch man-in-the-middle attack. 379 00:31:45,500 --> 00:31:47,900 I'll give you three seconds. 380 00:31:57,640 --> 00:32:00,200 So, I'll show it to you. 381 00:32:00,340 --> 00:32:01,340 So, the first one is a obvious one. 382 00:32:01,640 --> 00:32:01,880 Five, six, seven, eight. 383 00:32:01,880 --> 00:32:02,060 Let's see how fast it is running for the demo. 384 00:32:02,420 --> 00:32:03,560 You can see the time lapse. 385 00:32:03,560 --> 00:32:05,540 Come on. 386 00:32:05,760 --> 00:32:06,260 Here we go. 387 00:32:08,180 --> 00:32:10,620 Five, six, seven, eight. 388 00:32:11,260 --> 00:32:11,860 Wow. 389 00:32:12,180 --> 00:32:12,480 All right. 390 00:32:12,480 --> 00:32:13,120 Now, you can see the time lapse doesn't resist. 391 00:32:13,640 --> 00:32:14,060 You're going to notice it's quite long. 392 00:32:14,460 --> 00:32:15,060 I'm going to push this button to the left. 393 00:32:15,060 --> 00:32:15,480 Oh, I see it. 394 00:32:28,880 --> 00:32:30,280 Okay. 395 00:32:45,480 --> 00:32:45,820 Okay. 396 00:33:24,740 --> 00:33:30,080 So, I'm able to successfully run SSL strips of tool. 397 00:33:30,520 --> 00:33:38,940 Now, the next step is to basically poison the cache of the client, right? 398 00:33:39,020 --> 00:33:41,940 And for that, I'll be using the modified version of driver. 399 00:33:43,380 --> 00:33:43,980 So... 400 00:33:43,980 --> 00:33:44,660 Okay. 401 00:33:44,860 --> 00:33:45,460 Okay. 402 00:33:50,580 --> 00:33:58,760 And let's quickly check what is the default gateway present on this subnet. 403 00:33:59,060 --> 00:34:04,000 So, default gateway is running on 172.16.8.1. 404 00:34:04,120 --> 00:34:08,620 And if you check the ARP cache entry... 405 00:34:14,960 --> 00:34:21,680 You can see the default gateway is running on 8.1, and the MAC address is basically the 406 00:34:21,680 --> 00:34:24,420 last two bytes is FE72, okay? 407 00:34:24,540 --> 00:34:32,340 And we are going to replace the MAC address, the IP and this MAC binding with the attacker's 408 00:34:32,340 --> 00:34:32,900 MAC. 409 00:34:34,400 --> 00:34:34,960 So... 410 00:34:59,220 --> 00:35:04,940 And the Wi-Fi users, the IP address of users to which I have sent my IP address and the 411 00:35:04,940 --> 00:35:13,300 am going to victimize is using IP address 172.16.8.218. So I have used his IP address. 412 00:35:13,780 --> 00:35:20,380 And this is the MAC address of my machine. And this is the IP address of gateway on behalf 413 00:35:20,380 --> 00:35:30,640 of which I am sending this spoofed request packet. Now let's go back and see what is 414 00:35:30,640 --> 00:35:37,260 the ARP entry. So if you remember the last ARP entry for gateway was, the MAC address 415 00:35:37,260 --> 00:35:46,960 was FE72. Now let's quickly check. And you can see the MAC address of the default gateway 416 00:35:46,960 --> 00:35:51,280 has changed. It has become 0AD3. Okay. 417 00:35:52,480 --> 00:35:53,060 . 418 00:35:53,060 --> 00:35:53,820 . 419 00:36:00,980 --> 00:36:07,020 So, so far everything is working fine. Let's hope SSL stream works as per the expectation. 420 00:36:07,420 --> 00:36:17,400 So I'm going to open some site. Let's open, let's say, gmail. 421 00:36:40,200 --> 00:36:43,520 Oops. Let's try running. 422 00:36:46,060 --> 00:36:47,460 . 423 00:36:47,460 --> 00:36:50,220 . 424 00:36:53,820 --> 00:36:54,560 , . 425 00:37:08,720 --> 00:37:10,120 . 426 00:37:10,120 --> 00:37:10,140 . 427 00:37:10,140 --> 00:37:10,160 . 428 00:37:10,160 --> 00:37:10,180 . 429 00:37:10,180 --> 00:37:11,240 . 430 00:37:11,240 --> 00:37:11,260 . 431 00:37:14,920 --> 00:37:16,320 . 432 00:37:16,320 --> 00:37:18,980 . 433 00:37:32,940 --> 00:37:33,260 . 434 00:37:33,260 --> 00:37:33,300 . 435 00:37:44,280 --> 00:37:44,600 . 436 00:37:44,600 --> 00:37:45,000 . 437 00:37:45,000 --> 00:37:45,220 . 438 00:37:45,220 --> 00:37:45,380 . 439 00:37:46,320 --> 00:37:46,640 . 440 00:37:47,360 --> 00:37:47,680 . 441 00:37:47,680 --> 00:37:47,720 . 442 00:37:47,720 --> 00:37:47,780 . 443 00:37:47,780 --> 00:37:47,820 . 444 00:37:47,820 --> 00:37:47,840 . 445 00:37:47,840 --> 00:37:47,880 . 446 00:37:47,880 --> 00:37:53,200 run this SSL strip but I was able to poison the ARP cache entry of a victim 447 00:37:54,340 --> 00:37:58,940 and just to demonstrate that my packets which I am injecting is not actually 448 00:37:58,940 --> 00:38:02,160 flowing on the wire I am going to take a packet capture 449 00:38:32,360 --> 00:38:39,420 here you can see right now I am sniffing on a wireless interface of my client and you 450 00:38:39,420 --> 00:38:45,600 can see ARP request and response frames are being exchanged between my client and the 451 00:38:45,600 --> 00:38:46,200 attacker. 452 00:38:46,480 --> 00:38:47,640 The attacker was sending 453 00:38:47,640 --> 00:38:50,460 request frames and my machine is responding to those requests. 454 00:38:51,260 --> 00:38:52,520 Now let me 455 00:38:52,520 --> 00:39:01,600 quickly connect a wire and we will sniff what kind of traffic is flowing on the wire 456 00:39:08,940 --> 00:39:14,500 and here you can see there is no broadcast ARP request packet coming on the wire. 457 00:39:14,680 --> 00:39:15,380 The packet 458 00:39:15,380 --> 00:39:17,180 which I was injecting 459 00:39:17,180 --> 00:39:19,740 those packets are directly going on the 460 00:39:20,300 --> 00:39:20,860 char. 461 00:39:23,380 --> 00:39:27,920 These are the response which is basically sent by my client devices. 462 00:39:28,540 --> 00:39:34,140 So the footprint of attack is available only in the air, it's not available on the wire. 463 00:39:37,700 --> 00:39:48,360 But if I, instead of using a modified interface which was running on top of a modified version 464 00:39:48,360 --> 00:39:53,440 of driver software, if I run an unmodified version, what will happen? 465 00:40:13,160 --> 00:40:17,840 So let me quickly... 466 00:40:19,860 --> 00:40:25,140 So, in fact, I have demonstrated that my packets are not actually running, going on the wire. 467 00:40:25,340 --> 00:40:33,740 Let me quickly present all basically countermeasure techniques. 468 00:40:34,240 --> 00:40:38,000 The real fix is basically fixing this problem in the protocol. 469 00:40:38,280 --> 00:40:44,900 And for that, one can think of deprecating the use of GTK and group address data frame. 470 00:40:45,160 --> 00:40:46,500 The other solution... 471 00:40:46,500 --> 00:40:46,980 Okay. 472 00:40:47,960 --> 00:40:54,200 ...is basically using the endpoint security software like SNOT or ARP watch which detects 473 00:40:54,200 --> 00:41:00,040 ARP cache, changing the ARP entry, but there is a limitation of this software. 474 00:41:00,340 --> 00:41:03,180 It is not available for all kind of Wi-Fi devices. 475 00:41:04,020 --> 00:41:11,320 Then one can actually think of using PSPF or client isolation feature, but then this 476 00:41:11,320 --> 00:41:15,460 can also break the legitimate communication between legitimate users. 477 00:41:15,760 --> 00:41:17,680 For example, if a user wants to share... 478 00:41:17,680 --> 00:41:23,380 ...some pictures from laptop to smartphone, that kind of thing will not be possible. 479 00:41:24,040 --> 00:41:29,880 And we can probably not use this feature in a voice over Wi-Fi deployment scenario 480 00:41:29,880 --> 00:41:35,920 because then two Wi-Fi client devices will not be able to communicate, which means this 481 00:41:38,220 --> 00:41:39,880 will create a problem. 482 00:41:41,300 --> 00:41:45,580 So can we really think of using wireless monitoring system? 483 00:41:45,860 --> 00:41:46,460 Since... 484 00:41:46,460 --> 00:41:52,480 ...the footprint of attack is available in the air, it is possible to detect that in 485 00:41:52,480 --> 00:41:52,840 the air. 486 00:41:53,160 --> 00:41:56,620 So, WIPS can also serve as an additional layer of security to... 487 00:41:58,140 --> 00:42:00,840 ...in detecting and protecting from such attacks. 488 00:42:02,640 --> 00:42:10,540 So the final conclusion is that all WPA2 networks are exposed to hole 196, and the inter-user 489 00:42:10,540 --> 00:42:14,280 privacy that was guaranteed is now broken in WPA2. 490 00:42:14,800 --> 00:42:16,420 The real fix is to fix... 491 00:42:16,420 --> 00:42:18,120 ...fix this problem in the protocol. 492 00:42:18,560 --> 00:42:26,080 In the meantime, enterprises can think of using PSPF kind of feature, but... 493 00:42:27,000 --> 00:42:31,840 ...for endpoint security, you can use a SNOT or IPSec. 494 00:42:33,180 --> 00:42:35,240 But then you say it is not foolproof. 495 00:42:35,360 --> 00:42:37,200 In some certain scenario, it will not work. 496 00:42:37,360 --> 00:42:38,980 So multi-layer of defense... 497 00:42:38,980 --> 00:42:43,980 ...multi-layer of security is required, and probably over the air, security can be used 498 00:42:43,980 --> 00:42:46,400 to detect attacks like hole 16. 499 00:42:46,400 --> 00:42:47,960 196 or any zero-day vulnerability. 500 00:42:49,540 --> 00:42:53,020 So the final words, be aware, be secure. 501 00:42:53,440 --> 00:42:54,140 That's it.