00:00:00.167,00:00:05.172 >>Singe and Cable Thief. [Audience applauds] >>Thank you. Hello, everyone. So this is the 00:00:10.11-->000:00:13.814 first time I’ve spoken out loud for like, a day and a half, ‘cause I lost my voice and I’ve 00:00:13.814,00:00:18.218 been walking around like a breathy Hannibal Lecter. So if I suddenly start squeaking like a 00:00:18.218,00:00:21.855 teenage boy, please forgive me. I’m just going to be sucking on this thing. So today we’re going 00:00:21.855,00:00:23.857 to be talking about some Wifi hacking stuff, in particular we’re going to be talking about 00:00:23.857,00:00:25.859 rogue access point attacks or evil access point attacks or whatever you feel like calling 00:00:25.859,00:00:27.861 them. And it’s, uh, kind of a continuation of a talk that we did in 2014. Uh, we released 00:00:27.861,00:00:29.863 something called the Mana Tool Kit. So the way we’re going to talk about stuff is this 3 00:00:29.863,00:00:34.868 scenarios. And you might not be doing exactly what the scenarios describing, but I’m just using 00:00:40.707,00:00:45.712 them as examples to kind of go through some of the capabilities, tools, and 00:00:52.452,00:00:58.458 techniques that we’ll be releasing today. So my name’s Singe, this is Michael Kruger, 00:00:58.458,00:01:03.730 underscore cablethief, but we’re trying to call him Squiggle Boy, so if you’re looking to give him 00:01:03.73-->000:01:07.367 a nickname, please help us out there. We work at a company called Sensepost. It’s a 00:01:07.367,00:01:12.506 penetration testing company based predominantly out of South Africa and London. We’ve been 00:01:12.506,00:01:16.610 going for about 18 years. We’re told we’re not allowed to use Powerpoint, so this is a pdf. 00:01:16.61-->000:01:20.914 That used to be an animated gif in the corner, so. Anyway. Alright, so the first scenario 00:01:20.914,00:01:27.888 we’re going to jump straight in. Eh, in 2012 a colleague of mine, Glen Wilkinson, and, uh, Daniel 00:01:27.888,00:01:32.893 Cuthbert released something called Snoopy. Anyone here ever use Snoopy? 3 people. [laughs] 00:01:37.497,00:01:43.236 [audience member speaks inaudibly] Sorry? I- sorry, I can’t hear you. Eh, so Snoopy 00:01:43.236,00:01:48.408 is- was a framework for tracking wireless devices, em, trying to, like, geolocate them based on 00:01:48.408,00:01:52.846 networks that they’re looking for, and then using the fact that the device ID was unique. 00:01:52.846,00:01:57.851 Unfortunately in 2018, Snoopy is dead. Yup, they killed Snoopy. [Laughs] And the primary reason 00:02:02.589,00:02:07.627 Snoopy is dead is because, ah, there’s been some changes to the way device manufacturers make 00:02:07.627,00:02:13.433 their- the things work across Wifi. So the first thing is that, uh, passive sniffing is, 00:02:13.433,00:02:17.237 mostly doesn’t work anymore. It’s for 2 reasons I’ll go into now. And the other thing is that 00:02:17.237,00:02:21.508 device manufacturers have changed the default behavior that instead of a device going, 00:02:21.508,00:02:26.246 “Hey, is my home network nearby?” it just says, “Hey, are there networks nearby, and is 00:02:26.246,00:02:30.250 one of them my home network?” So it does- it tries not to reveal the networks it’s looking for, 00:02:30.25-->000:02:36.490 and it’s referred network list. Eh, but I first spoke about the spectrum issue, so it’s this 00:02:36.49-->000:02:40.227 really awesome tool called Wifi Explorer. It’s commercial, but um, if you want to play with 00:02:40.227,00:02:44.831 Wifi, it’s good. It’s not a hacking tool, it’s more like a, an understanding tool. And this 00:02:44.831,00:02:50.837 is the default view for the Wifi spectrum, so the 2.4GHz and the 5GHz spectrum. Actually, that 00:02:50.837,00:02:56.009 bottom one was something, a snapshot I took at the Blackout keynote that [indiscernible] 00:02:56.009,00:03:01.948 gave. Just an insane number of access points. And when you look at, um, a picture like this, you 00:03:01.948,00:03:07.120 get the idea that the 5GHz spectrum’s a little bit bigger than the 2 GHz spectrum. But in 00:03:07.12-->000:03:13.794 reality, the 2 GHz spectrum has a 3 non-overlapping 20MHz channels, so if you put 00:03:13.794,00:03:19.499 something on channels 1 and 2, they technically overlap. But the 5GHz spectrum has 24 00:03:19.499,00:03:24.071 non-overlap, overlapping, em, channels. So what that means is if we were to draw this to 00:03:24.071,00:03:29.676 scale, it looks a little more like this. There’s way more 5GHz spectrum available for Wifi than 00:03:29.676,00:03:35.849 there is 2.4GHz. And so if you want to passively monitor all of that stuff, before, you know, 00:03:35.849,00:03:39.086 you could do things like hopping channels and stuff, now if you’re hopping through all of 00:03:39.086,00:03:43.056 these channels, you’re just going to miss lots of it. So instead you have to engage in 00:03:43.056,00:03:50.030 the very practical and very good looking attack, like this. [Audience laughs] Um, it’s 00:03:50.03-->000:03:55.235 really great for optic, clients never, clients never see you coming. It’s the pineapple on 00:03:55.235,00:04:00.173 the top. It distracts them. So that’s not hugely practical to try and get, eh, figure out what 00:04:02.609,00:04:08.448 devices are doing in the Wifi around you. And we want to do it with that. You know, I’m from 00:04:08.448,00:04:13.487 Africa, Witch Heap. And so what we can do is we present ourselves as an access point. 00:04:13.487,00:04:18.892 And wireless clients are already very good at finding access points and then broadcasting 00:04:18.892,00:04:24.264 their management frames at them. So if we’re an access point, then the devices come to us, we 00:04:24.264,00:04:28.235 don’t have to go to them and monitor all of the spectrum. And so this is why it’s quite 00:04:28.235,00:04:33.140 desirable to do some of these more active attacks rather than [audio cuts] passive attacks for 00:04:33.14-->000:04:39.446 tracking purposes. The other thing that changed is devices are probing much less, and for 00:04:39.446,00:04:43.016 some reason we were a little pressed in 2014 with that, so we implemented something called 00:04:43.016,00:04:48.088 Loud Mode which provides an ability for Mana and tools that do something similar to learn 00:04:48.088,00:04:54.928 networks nearby and rebroadcast them. So maybe your device isn’t actively probing for Bob’s House 00:04:54.928,00:05:00.500 of Pain, but your older iPad in your back pocket is, or somebody you went there with last night 00:05:00.50-->000:05:04.471 is. And then we can learn that that’s a network that somebody might be connecting to, 00:05:04.471,00:05:11.077 rebroadcast it to your devices, and learn, uh, the nearby networks. But the problem we end 00:05:11.077,00:05:16.149 up with is anonymous devices. So, manufacturers wanted to make it that you couldn’t uniquely 00:05:16.149,00:05:22.022 identify devices, so it increasingly they use these randomized Mac addresses, and 00:05:22.022,00:05:27.561 that’s what you see flying around. Last year at Defcon, Denton Gentry, or Gentry, I’m 00:05:27.561,00:05:32.165 sorry if I’m butchering that, did some really cool work into creating, uh, unique signatures 00:05:32.165,00:05:37.237 for Wifi devices. And that got built into hostapd, which is predominantly what Mana is built 00:05:37.237,00:05:42.242 off of. And so that gave us a really cool way of deanonymizing devices. You probably can’t 00:05:42.242,00:05:47.814 tell, but I drew that myself. [Audience laughs] And, okay. So let me give you a practical 00:05:47.814,00:05:51.318 example of what that looks like. >>Thank you >>I mean this is the best part of the whole talk just 00:05:51.318,00:05:55.589 be care. Alright, so if we’ve got 4 devices, so we’ve got 4 Mac addresses and they’re all 00:05:55.589,00:06:00.026 probing for some non-unique network called Internet. So if they’re probing for something 00:06:00.026,00:06:05.365 unique, then maybe we could identify a device then, because no other devices are probing for 00:06:05.365,00:06:09.836 that. But these ones, we don’t know what device is which. Now the one thing we’ve implemented 00:06:09.836,00:06:13.373 in Mana is random device detection so that output will mark whether something is a 00:06:13.373,00:06:17.510 randomized Mac address or not. So if we put that stuff in there, and this is taken from an 00:06:17.51-->000:06:22.782 actual Mana output and and imported into Maltego, which makes this really easy. So we 00:06:22.782,00:06:26.920 can see that the two randomized Mac addresses and two non randomized Mac addresses. So we 00:06:26.92-->000:06:31.024 can maybe start making some guesses that some belong to the other. But we don’t know which 00:06:31.024,00:06:36.162 randomized probe belongs to which legit Mac address, and we don’t even know that these 00:06:36.162,00:06:41.034 randomized probes belong to those Mac addresses. So what we did is we took Denton’s work and 00:06:41.034,00:06:46.573 extended it to generate the signatures also for devices before association, so that in 00:06:46.573,00:06:52.178 Mana we can make these device signatures. So if we put that in there, this shows that there’s 2 00:06:52.178,00:06:58.051 devices, so probe 1 and 3 belong to 1 device, and probe 2 and 4 belong to another device. Um, so 00:06:58.051,00:07:02.789 he did some really cool work and it effectively allows us to deanonymize addresses. So things 00:07:02.789,00:07:05.792 like Snoopy can work again because you’ve got something like Loud Mode getting them to 00:07:05.792,00:07:09.429 advertise the networks they connect to, and then you’ve got signatures that allow you to 00:07:09.429,00:07:15.402 deanonymize the device, so you can start tracking individual devices again and be creepy. And 00:07:15.402,00:07:21.308 I’m not showing you lots of detail about how to do that stuff, because for a change I 00:07:21.308,00:07:25.979 put a lot of work into documentation, and so like the hostapd-Mana, Wikis got a 00:07:25.979,00:07:30.617 massive amount of information labeling all of the different configuration options, and what 00:07:30.617,00:07:35.588 they do and how to make it work. Um, I’ll give you links to these things at the end, so don’t 00:07:35.588,00:07:41.528 worry too much about taking pictures now. Okay, so that, that first scenario was talking 00:07:41.528,00:07:46.166 about tracking and probing, and it’s kind of well trod territory, we’ve made some 00:07:46.166,00:07:50.603 changes there, uh, but I didn’t want to spend too much time on it. So next we’re going to look 00:07:50.603,00:07:56.743 at enterprise networks, so these are, eh, E P ETLS kind of things that most people are running at 00:07:56.743,00:08:01.881 companies, and, um, so this is the domain where something like hostapd, WPE- Wireless Pwnage 00:08:01.881,00:08:06.486 Edition- has traditionally done its work. Um, Mana was also doing some of this stuff in 00:08:06.486,00:08:11.458 2014; we’ve made some changes there. The nice thing about having, like, both of those 00:08:11.458,00:08:15.628 capabilities in Mana is you can get lots of devices to connect to you, and you can also get 00:08:15.628,00:08:20.567 lots of passwords from devices. So being good at getting devices to connect to you also helps for 00:08:20.567,00:08:26.373 this part. Alright, so the most common implementations the Evil Twin Attack. Ah, so this is 00:08:26.373,00:08:30.844 Spock’s evil twin from the Mirror Universe. And, Evil Twin Attack, you create an access 00:08:30.844,00:08:37.150 point that looks the same as the legit access point that you want to go after. And, like, when 00:08:37.15-->000:08:40.120 people talk about it, they mostly say, “Yeah, that’s what you do. You just make another 00:08:40.12-->000:08:45.425 access point.” But in reality, you’ve got fancy enterprises access points that implement all 00:08:45.425,00:08:51.131 sorts of crazy edit to 11-AC stuff really well with well engineered antennas well placed 00:08:51.131,00:08:55.335 in the ceiling. And you’re walking around with, like, a dinky Alfa card in your 00:08:55.335,00:09:00.540 backpack. Ah, you’re probably not going to beat the enterprise AP, eh, so what often happens is 00:09:00.54-->000:09:04.711 then people do things like deauths, eh, and so people start implementing management frame 00:09:04.711,00:09:09.783 protection, 802-11-W, and this becomes much harder. So actually the way I’d recommend you do 00:09:09.783,00:09:14.054 this is go buy a fancy enterprise access point like a Ruckus or an Aruba, and then you 00:09:14.054,00:09:18.792 can use Mana as just the plain back end radio server, and it will actually capture the creds 00:09:18.792,00:09:23.696 there. Now this is something that’s already implemented in hostapd (WPE), and, uh, if any 00:09:23.696,00:09:27.934 of you are actually familiar with Celeste Barber. So she takes uh, pictures of 00:09:27.934,00:09:32.472 celebrities, and then she kind of rips them off. And it’s pretty hysterical. Most of them 00:09:32.472,00:09:36.409 are her awkwardly wearing underpants. So this is the least awkward one I could find. Uh, 00:09:36.409,00:09:41.414 and so whether Celeste Barber to hostapd (WPE) with Mana, so, eh, Brad Antonovich, Joshua Wright, 00:09:44.417,00:09:49.622 in 2008, they released the freeradius WPE and the sleep tools, which sort of were the 00:09:49.622,00:09:54.561 first attacks against EAP networks where you could capture credentials and crack them. And 00:09:54.561,00:10:00.633 so that stuff’s been in Mana for awhile. I’ve cleaned it up, cleaned the output up, and 00:10:00.633,00:10:04.504 people kept sending me rude messages saying I have to hand carve things into hashcat and 00:10:04.504,00:10:08.808 stuff, so now it just displays it right. Oh, what I’ve also done is extended it so it does 00:10:08.808,00:10:13.012 more EAP modes, at the moment it does about 13 different EAP modes, it’ll try to capture 00:10:13.012,00:10:18.017 creds, plain text, CHAP, MS Chap, MS Chap version 2, GTC, things like that, and about 7 of 00:10:20.587,00:10:26.860 those fairly well tested in real client environments, and that’s working quite well. Um, but we 00:10:26.86-->000:10:31.498 did some other stuff, too, and I want to take you through. So, here’s another back of the 00:10:31.498,00:10:35.735 napkin drawing I attempted to describe, uh, how EAP connections work. So, first 00:10:35.735,00:10:41.574 thing that happens is a Wifi connection, if you’re familiar with um, Air Replay, if you do a 00:10:41.574,00:10:47.680 fake auth it’s that first part, and then these tunneled EAPs, so EAP with TLS, the security comes 00:10:47.68-->000:10:53.920 from this, uh, TLS session that it creates. So the idea is we use best practice TLS stuff, and 00:10:53.92-->000:10:59.559 then we can do crappy MS Chap beside that tunnel because it’s protected by TLS. Now the sort 00:10:59.559,00:11:03.763 of fundamental flaw in all of this, and I’ll cover it a bit more in detail now, is that we 00:11:03.763,00:11:08.601 don’t have a very good way of validating certificates in the wireless world, and I’ll get 00:11:08.601,00:11:12.605 into that in a second. And so you’ve got this MS Chap challenger response. So MSCHAP 00:11:12.605,00:11:18.344 version 2, provides a method for proving that the access point knows the password, proving that 00:11:18.344,00:11:23.416 the client knows the password. Ah, so what we did in 2014 is you did this auto-cracking add 00:11:23.416,00:11:27.887 thing so that if you capture the passwords, it’ll try and crack it, and if it’s weak enough, you 00:11:27.887,00:11:32.492 can quickly add it to the radius users file if the device tries to reconnect, you can also Mana 00:11:32.492,00:11:37.497 the middle then. Uh, but then Brad in Hostapd WPE implemented something he called EAP Success. 00:11:39.599,00:11:44.437 So instead of doing that, ‘cause the access point can’t prove that it knows the password if it 00:11:44.437,00:11:49.709 hasn’t cracked it, uh, it would just send an EAP Success method back. Um, and I just, I thought 00:11:49.709,00:11:53.613 this was silly, because, you know, why would that work? And then Michael kept telling me I 00:11:53.613,00:11:59.252 must make it work, and he wouldn’t let up- really wouldn’t let up. And so I eventually 00:11:59.252,00:12:03.222 spent a hot evening digging through code, trying to figure this out. And what actually 00:12:03.222,00:12:08.228 turns out is that all, um, Mac and iOS devices, um, have a broken implementation, uh, so 00:12:10.463,00:12:13.933 they weren’t validate that the access point actually knows the password if you send an EAP 00:12:13.933,00:12:19.472 Success. They’ll just be like, “Oh okay, sure, I’ll connect.” So it’s, um, I mean from iOS 9, 00:12:19.472,00:12:25.144 I’ve tested it on iOS, my latest one on here, my latest Mac OS, I’ve reported it to Apple. Uh, 00:12:25.144,00:12:30.316 we kind of had the discussion on Twitter, so, uh, and Brad had built this functionality ages 00:12:30.316,00:12:35.154 ago, so it’s not really a Zero Day, but it’s an interesting to know. So you don’t need to use 00:12:35.154,00:12:40.159 things like auto-cracking add on iOS, they’ll just connect. Um, and then the other thing is the 00:12:43.329,00:12:49.602 certificate validation problem. So on the left-hand side is the legitimate certificate chain for 00:12:49.602,00:12:55.842 Defcon’s Wifi certificate, and on the right-hand side is a cloned version of that chain 00:12:55.842,00:12:59.278 that I built using a colleague of mine, Rogan Dawes’ tool called Adds of Steel, which is 00:12:59.278,00:13:03.583 good for cloning certificate chains rather than just an individual certificate. And now, 00:13:03.583,00:13:09.255 on something like iOS, and, um, some other supplicant devices, if you connect to a Wifi 00:13:09.255,00:13:13.459 network, it’ll pop up the certificate. And it could be signed by valid cert authority, 00:13:13.459,00:13:17.196 and it’ll still pop up the certificate for you to hand validate. So if I saw the 00:13:17.196,00:13:20.299 certificate on the right and it had all the Defcon things, everything looks exactly the 00:13:20.299,00:13:26.606 same except for the fingerprint, because of the hashes are going to come out differently. Um, and 00:13:26.606,00:13:31.978 Cubans aren’t very good at memorizing long strings of hashes. So for things that try 00:13:31.978,00:13:36.082 and force you to validate on the actual certificate, that becomes problematic if you aren’t doing 00:13:36.082,00:13:40.019 automated rollout to client devices. And even then, if you are doing automated rollout to 00:13:40.019,00:13:44.824 client devices, we’ve got this problem with IT where client devices tend to stop being 00:13:44.824,00:13:50.830 compliant to your policies, and you always end up with that one MS08-067 or that one 00:13:50.83-->000:13:55.134 poly-configured supplicant. Then on the flip side, there’s a bunch of supplicants which will 00:13:55.134,00:13:59.505 validate on the CA, the certificate authority. So WPA supplicants used in Lennox and 00:13:59.505,00:14:04.177 Android will do that, uh, Windows default configuration will do that. And so here you 00:14:04.177,00:14:09.248 can see that Defcon borders certificate from DigiCert. So I can go spend $15-->0 I mean I know 00:14:09.248,00:14:15.521 exists, right? And then I can buy a certificate with the same CA, it doesn’t have to be a 00:14:15.521,00:14:21.027 Defcon certificate, I can present that on my rogue access point, and devices will connect 00:14:21.027,00:14:24.497 to it. I tested, just to make sure I wasn’t going crazy, I used Defcon’s configuration, 00:14:24.497,00:14:29.836 complete with your user name and your password all in bold, put up my rogue access point, and 00:14:29.836,00:14:34.907 the things happened to connect to it. And there’s not option in WPA supplicant at the moment to 00:14:34.907,00:14:41.447 validate on the actual certificate. Just kind of stupid. And in Windows, you’ve 00:14:41.447,00:14:45.818 got an option to validate on the actual host name, so you can see it’s wifireg.defcon.org, I can’t 00:14:45.818,00:14:51.224 buy a certificate for a defcon domain, so if you validate on the actual server name, like 00:14:51.224,00:14:56.629 Defcon instructed you to, then actually Windows is in a pretty good place, and for iOS, they 00:14:56.629,00:15:01.567 pushed out, um, yeah, only one guy. [Audience laughs] I hope Microsoft’s paying you well. Um, 00:15:03.703,00:15:08.708 and then for iOS, they pushed out a mobile profile like an MDM profile basically, Apple 00:15:11.144,00:15:17.049 configuration profile, to validate on exact search which works quite well, although I 00:15:17.049,00:15:20.920 fat-fingered it and have not been able to connect to the Wifi. And yeah, so we’ve got 00:15:20.92-->000:15:24.423 this problem with Wifi certs. So if any of you saw [indiscernible] keynote, at uh, 00:15:24.423,00:15:29.829 Black Hat, and she’s talking about how, uh, they’re trying to get rid of SSL, or HTTP pages 00:15:29.829,00:15:33.332 and, you know, they’ve got this consistent set of iconography. I was thinking, what a nice 00:15:33.332,00:15:37.236 problem to have, like when your problem is just to get people to do something they already know 00:15:37.236,00:15:41.407 they should, and you need to make some icons more consistent. Wifi devices don’t even have a 00:15:41.407,00:15:45.111 consistent way of validating server certificates. I mean, we’re, we’re in a pretty bad 00:15:45.111,00:15:49.582 place there. And, and all of this is just talking about if somebody is actually trying to 00:15:49.582,00:15:53.820 put effort into validation, because most of us and most users will just click on the 00:15:53.82-->000:15:57.323 Wifi network, type the username and password, and “Yeah, whatever,” the certificate. 00:15:59.559,00:16:02.895 Okay, but the general recommendation is to use something like EAP TLS. So 00:16:02.895,00:16:08.401 again, very advanced diagram of EAP TLS, and what EAP TLS does, is it does away with the 00:16:08.401,00:16:12.205 certificates- I mean the passwords, and you just have certificates. It’s mutual 00:16:12.205,00:16:16.042 authentication so you’ve got a client certificate and you’ve got a server certificate. Yay! 00:16:16.042,00:16:21.614 It’s fixed, we’ll just use EAP TLS. Except the problem is, with normal TLS, you create an 00:16:21.614,00:16:26.352 encrypted tunnel and then the communications can continue. In Wifi, it’s a kind of a once-off 00:16:26.352,00:16:31.290 authentication. Afterwards, the tunnel’s torn down, then you have the WPA two-way handshake 00:16:31.29-->000:16:37.029 and that normal Wifi stuff. So what that means is, if the client is not validating the 00:16:37.029,00:16:41.300 server certificate, then you can just accept whatever certificate it sends you, and yay, now 00:16:41.30-->000:16:46.172 you’re man-in-the-middling, um, EAP TLS. So EAP TLS isn’t necessarily a fix for this. As a 00:16:46.172,00:16:52.111 matter of fact, it comes down to the exact same security decision as PEAP or TTLS decisions, is a 00:16:52.111,00:16:57.216 single certificate validation of the server certificate. So all of that problem with the server, 00:16:57.216,00:17:02.688 with certificate validation and Wifi, kicks back in. Um, so this was actually implemented in Mana 00:17:02.688,00:17:08.527 in 2015 by Meatballs- thanks guy. And then I broke it, sorry. Um, and then I fixed it again 00:17:08.527,00:17:13.532 about a month ago. So that works again. Okay, but then Michael one day was cracking some Wifi 00:17:15.935,00:17:21.140 hashes and he noticed that hashcat, uh, let me, let me go here for a moment, hashcat uses 00:17:21.14-->000:17:26.145 mode 550-->0 I think, for cracking MSCHAP hashes, which is also MTLM V1ESS. And he thought, 00:17:28.214,00:17:32.952 “Hey, there’s an MTLM relay thing, maybe I could do like an MSCHAP relay. And so he came up 00:17:32.952,00:17:37.490 with, uh, what he’s calling Sycophant, it’s a play on supplicant. And so the idea is 00:17:37.49-->000:17:41.694 that you can have two separate devices, you can have Mana being a rogue access point, 00:17:41.694,00:17:47.233 negotiating a session with a victim device, and then you can have WPA Sycophant negotiating a 00:17:47.233,00:17:52.371 session with a legitimate target access point. So those two don’t need to be physically near each 00:17:52.371,00:17:55.808 other, they just need an internet connection so you can be targeting someone at their 00:17:55.808,00:18:01.280 house and then have the, the other thing at the, at the target organization. And what’s 00:18:01.28-->000:18:05.084 really nice about this is you don’t have to crack the password. So if it’s a harder 00:18:05.084,00:18:11.090 password to crack and it’s going to take a little longer, uh, you still get connected to the 00:18:11.09-->000:18:16.095 network fairly instantly. Um, and so, Michael’s going to give you a demo of what that looks 00:18:19.799,00:18:24.804 like, and we’re going to release that tool set today. >> Thank you Dominic. Um, so I’ve got, 00:18:28.774,00:18:33.846 broken this demo down into 3 parts. Uh, the first 2 parts do happen simultaneously ‘cause the 00:18:33.846,00:18:38.451 2 things need to be happening at the same time. Uh, but the first part is, I’m just going to show 00:18:38.451,00:18:43.456 you what Mana looks like when it’s, uh, pretending to be the corporate AP. And then the 00:18:46.692,00:18:51.697 second part is a supplicant retrieving the required information from Mana to connect 00:18:54.10-->000:18:59.105 to the legitimate corporate AP. So, in this scenario we can imagine that there’s a chap, uh, 00:19:02.642,00:19:07.646 at home, he’s got his device for the BYOD network, that also uses domain creds, so if we just 00:19:11.684,00:19:16.322 relay this thing, we should be able to connect to the normal AP, uh, well the normal legit 00:19:16.322,00:19:22.762 corporate domain. So, here’s the command for, for running Mana. This we put on a pie and throw 00:19:22.762,00:19:27.333 it in his garden and hopefully our access point is stronger than his, uh, little router that 00:19:27.333,00:19:33.572 he got from his internet service provider. And hopefully he’s not got any other certificates, uh, 00:19:33.572,00:19:37.810 properly pinned, and those sorts of things. So I’m just gripping out the relevant information, 00:19:37.81-->000:19:42.548 otherwise there’s a lot of, uh, noise, so I’m just gripping for Sycophant in Mana. Uh, I’ve 00:19:42.548,00:19:48.754 added a config option to Mana to say “Enable Sycophant” which just instructs it to not use- to 00:19:48.754,00:19:53.159 not generate, well it still generates a challenge, but to not use that challenge, rather 00:19:53.159,00:20:00.032 retrieve a challenge from my supplicant, Sycophant, so that it may be passed to the, uh, the 00:20:00.032,00:20:05.037 client. So, I just run this, and we wait for CHAP to connect. You know, they’ve, uh, initiated a 00:20:09.475,00:20:14.346 connection with us, so the phase 1 identity and the phase 2 identity, phase 1 establishes 00:20:14.346,00:20:20.820 that Alfa tunnel, phase 2 is starting the actual EAP, uh, the MSCHAP handshake. There is a 00:20:20.82-->000:20:25.624 delay after this because now Sycophant is starting up on the other side, and it’s trying to 00:20:25.624,00:20:32.331 play catch up. So it’s quickly connecting to the actual corporate AP, and getting the 00:20:32.331,00:20:38.838 challenge, which is then passed to Mana to present to the client so that we may get a, uh, valid 00:20:38.838,00:20:44.243 response. As you can see here, it’s retrieved the, the first auth challenge contents is what 00:20:44.243,00:20:50.783 hostapd, our rogue, generated, but we don’t want to use that one, so there’s auth challenge 00:20:50.783,00:20:56.789 contents after copy, which it’s actually got from the legit access point. We send that to 00:20:56.789,00:21:03.262 the, uh, client John in his bedroom and his phone has decided that our access point 00:21:03.262,00:21:08.367 looks more appealing. So it knows the password, it generates a response using our hash, uh, 00:21:08.367,00:21:13.372 Mana takes that response, writes it off, uh, writes it down to a file, and essentially passes it 00:21:15.574,00:21:21.380 on to, um, to my Sycophant. And we get the hash anyway in case we want to crack it later. Uh, 00:21:21.38-->000:21:26.385 yeah. So then, next we have the other half of this, uh, equation, which is, uh, my 00:21:28.854,00:21:33.859 Sycophant, WPA Sycophant. Uh, I’m running it using the adapter ending in u6 thanks to the new 00:21:36.695,00:21:41.667 naming convention. Once again we’re gripping out the relevant data and I’m also gripping for 00:21:41.667,00:21:46.038 an EAP failure, which, just to show that there’s not one. [Laughs] Uh, it’s so we run it. 00:21:46.038,00:21:48.974 Oh, in the config is now, so this is now happening near- in proximity- in close proximity to 00:21:48.974,00:21:50.976 the, an actual legit corporate AP, because we want to connect to it, so this portion has to 00:21:50.976,00:21:52.978 run close to, close to your client. Alright, so then you just put where you want to 00:21:52.978,00:21:57.983 connect to in the config file, uh, using the standard, uh, Syco- well, supplicant syntax, 00:22:13.766,00:22:18.771 uh, and we don’t need creds, so we leave those blank. Cool? So, what we got here is phase 1 came 00:22:21.373,00:22:26.278 in, phase 2 came in, and, uh, supplicant immediately- well Sycophant immediately starts to 00:22:26.278,00:22:32.651 connect to the access point. It gets the challenge data, passes challenge data to Mana and waits 00:22:32.651,00:22:36.722 for the response, Mana at this point has been waiting a little while, the client’s been waiting 00:22:36.722,00:22:42.328 for a little while, they’re both edgy and they immediately come back with the response. See 00:22:42.328,00:22:46.498 here, the Mana contents? Cool! We take that response, we pass it off to the access point, 00:22:46.498,00:22:51.904 access point goes “Okay, cool, it- you’ve shown me the password,” EAP success, you’re 00:22:51.904,00:22:58.544 done. Now you’re connected. Brilliant. I specifically don’t run DHCP, uh, this time just to 00:22:58.544,00:23:04.483 show this bit where we don’t have an IP address, so I then run a DHC client just to get an 00:23:04.483,00:23:10.589 IP. Uh, this is just to prove that we do have full comms to the network I connected to. I 00:23:10.589,00:23:15.594 get an IP of 10 0 0 5, I double check it, and then I attempt to connect to a service, or server 00:23:22.468,00:23:27.973 on the, uh, client’s network. I go back, because I’m lazy, and I copy it, but uh, yeah. 00:23:27.973,00:23:32.978 Essentially I’m going to connect to a web server on ATAT and we get, we automatically just 00:23:35.714,00:23:40.719 connect to people’s Wifi. Cool. Thank you very much! >>So yeah, we’re going to release that 00:23:48.927,00:23:54.233 stuff today, uh, WPS Sycophant and the mods to Mana so that you can, you can do this attack 00:23:54.233,00:23:57.803 yourself. Michael’s used it successfully on some of our client’s engagements, so it’s a 00:23:57.803,00:24:03.642 practical working attack that works in live environments. Um, and then to the most important 00:24:03.642,00:24:07.846 part, coming up with the, a name, Michael sent me this image, which was deeply 00:24:07.846,00:24:12.851 disturbing. [Audience laughs] Which we later found out was called Squirtle Boy, which was, 00:24:18.757,00:24:23.862 I’m not sure it made it less disturbing. So this is why we really want Michael to be known 00:24:23.862,00:24:28.867 as Squirtle Boy from now on. Okay, so interestingly back in, um, in 2002, uh, oh I’m never 00:24:33.872,00:24:40.713 going to get these names. Sorry, let me look them, look them up on my phone here. So um, Anna 00:24:40.713,00:24:46.485 Sockann with Niemeye and Nyburg wrote a paper in 2002 about uh malorie in the middle or 00:24:46.485,00:24:51.490 tunneled authentication modes, and from that the ITF, uh, spec for this thing in 2004 made sure 00:24:53.726,00:24:59.398 it included a section on defending against these attacks. So if you zoom in, there’s 00:24:59.398,00:25:04.603 something called cryptographic binding, or crypto binding, and the point of crypto binding is 00:25:04.603,00:25:10.209 to make sure that some of the key material used in the alta TLS, um, session, is used in the 00:25:10.209,00:25:14.880 inner EAP method so that they can be- you know that they’re same device, that relaying isn’t 00:25:14.88-->000:25:18.617 happening. Um, so it’s always disappointing to implement an attack and think you’re the 00:25:18.617,00:25:23.856 first and then find out that the standards had a defense against it for over a decade. On the 00:25:23.856,00:25:28.460 flip side, people don’t seem to be turning on crypto binding, and we think that’s really just 00:25:28.46-->000:25:33.632 because of a lack of practical attacks. That said, thanks to synchronicity, we were 00:25:33.632,00:25:39.638 definitely not the first. So in 2014 Peter Robbins released, um, a similar sort of an attack, but 00:25:39.638,00:25:44.410 it was against a specific thing that Apple was doing. I think something around leap uh in a 00:25:44.41-->000:25:50.749 Ysec paper in 2014, which Apple then fixed, so it wasn’t a full implementation. And then this 00:25:50.749,00:25:54.386 morning, 15 minutes before we woke up, somebody logged an issue against Mana, asking for 00:25:54.386,00:25:59.958 this as a feature request, and linking to a paper that had been written in 2016, and sent to the 00:25:59.958,00:26:06.131 FASTA mailing list by Siarhei Simiak, I’m so sorry if I’m butchering that name. Um, and, 00:26:06.131,00:26:11.837 so he also has a partial implementation, it was done against the EAP state machine in 00:26:11.837,00:26:17.509 hostapd WPE supplicant, but as far as we can tell, it’s not a full, working, practical 00:26:17.509,00:26:21.113 implementation just yet. So we think this is the first practical implementation of this 00:26:21.113,00:26:27.286 attack that can be, can be used by people. And so because there’s no practical 00:26:27.286,00:26:30.889 implementation of the attack, or certainly not a widely known one, what you see is that the 00:26:30.889,00:26:36.962 default configs for a lot of networks don’t turn on crypto binding. So here’s a picture of 00:26:36.962,00:26:41.567 Microsoft’s radio server configuration, and by default they will not disconnect clients 00:26:41.567,00:26:46.472 that don’t have crypto binding. Um, so because this is something that needs to be done on the 00:26:46.472,00:26:50.275 client’s side, the access the radio server can detect whether it’s been done and disconnect 00:26:50.275,00:26:54.847 clients, which makes it slightly less usable, I guess, but a bit more secure. So maybe that’s why 00:26:54.847,00:26:59.952 they didn’t do it there, they don’t want to make it harder for people to get on the network. 00:26:59.952,00:27:04.723 But here’s a fully updated Windows 10 default connection dialogue, and their crypto 00:27:04.723,00:27:10.329 binding’s not enabled, either. Uh, host AP tries to do some crypto binding by default, so 00:27:10.329,00:27:14.333 there are some places where they try to do it, but most people aren’t running host AP networks 00:27:14.333,00:27:19.538 in their enterprise organizations. Um, so for the most part crypto binding doesn’t 00:27:19.538,00:27:25.110 seem to be turned on. Uh, you can go turn on crypto binding, but I think the biggest defense 00:27:25.11-->000:27:28.680 against these sorts of attacks is just to make sure that your client devices are properly 00:27:28.68-->000:27:33.085 validating the server certificate that gets presented. ‘Cause if that’s done, then this 00:27:33.085,00:27:37.789 part doesn’t matter too much because they won’t get past the tunneled, uh, the alta TLS 00:27:37.789,00:27:42.794 negotiation ‘cause they’ll say, “That’s not the right access point, you’re fake!” Alright. 00:27:46.398,00:27:50.469 Okay, so the first 2 scenarios is one, the first one was getting a bunch of different 00:27:50.469,00:27:54.306 devices to connect to you, and being able to figure out which device is doing what, the second 00:27:54.306,00:27:58.110 one was doing, doing EAP attacks. Oh sorry, one other thing, is you would have seen 00:27:58.11-->000:28:03.682 hashcat and Atom’s PMKID thing, anyone who’s interested in WPA2 handshake cracking, uh, put some 00:28:03.682,00:28:08.987 basic stuff in just to try like if a client ever sends a PMKID to just log that into the same 00:28:08.987,00:28:13.358 file. I need to do way more testing to see if that’s, if it’s a practical attack from a 00:28:13.358,00:28:17.930 rogue access point perspective. Um, but that might be fun. Okay, so now we’re going to look at 00:28:17.93-->000:28:23.802 some, some Mitm stuff. So back in 2014 we released, uh, the Mana tool kit, and the idea 00:28:23.802,00:28:29.141 there was lots of people take, and then you can Mitm as, you know, for granted. But the 00:28:29.141,00:28:33.212 reality was, uh, particularly if you’re new to this, you have to sort of orchestrate networking, 00:28:33.212,00:28:39.585 and access point stuff, and protocol stuff, and that can be quite, quite a lot to do. And 00:28:39.585,00:28:46.024 then with the increase in certificate pinning and things like HSTS, sorry I’m just gonna- 00:28:46.024,00:28:52.931 mm, it’s about to get breathy. With things like certificate pinning and HSTS, it’s not sort 00:28:52.931,00:28:56.201 of a given that you’re going to be able to man-in-the-middle all the things and get all of the 00:28:56.201,00:29:01.740 passwords. Uh, so the big problem we ran into with Mana tool kit is the ability to 00:29:01.74-->000:29:06.378 construct pipelines. We were using IP tables to redirect traffic from one place to 00:29:06.378,00:29:11.216 another place, so for example, you can SSL strip something, but you can’t then pass the traffic 00:29:11.216,00:29:16.555 through to SSL split. Maybe there’s some IP tables gurus in here who can show us how to do 00:29:16.555,00:29:21.560 it, but um, it wasn’t, wasn’t pleasant. Uh, and then along came betacap. So betacap written 00:29:24.029,00:29:29.034 by Evil Socket in Go, it, it can do all of this stuff and is really fantastic. So initially I 00:29:31.136,00:29:35.540 actually, we wanted to get, uh, Evil Socket up on the stage to talk about some of this stuff, 00:29:35.54-->000:29:41.213 uh, but he’s got a whole bunch of really cool Wifi attack things built into to betacap. So 00:29:41.213,00:29:46.284 if you want to do captive portal attacks or you want to beef hook browsers through Mitm, um, all 00:29:46.284,00:29:50.622 sort of things, you can now do that with betacap. So we’re just effectively deprecating Mana 00:29:50.622,00:29:56.061 tool kit and saying, “Use betacap, it’s better.” And just a big shoutout to Evil Socket 00:29:56.061,00:30:02.367 for the awesome work he’s done in there. I know, um, based on the issues that get logged, that 00:30:02.367,00:30:07.572 guy takes some bullets. The other problem you face is trying to orchestrate, uh, setting up a 00:30:07.572,00:30:12.477 network and all the net- well, the Wifi network and all of the networking. Okay, I keep seeing 00:30:12.477,00:30:18.583 people waving hands. And uh, Michael found a cool tool uh, written and maintained by a guy 00:30:18.583,00:30:25.090 named Oblique called create_ap, and what this does is just makes it really easy to say create an 00:30:25.09-->000:30:30.862 access point and bridge it between this network and this network on nato, without all of 00:30:30.862,00:30:35.634 the sort of complexity that Mana toolkit brought in. However, there were some things that it 00:30:35.634,00:30:39.137 didn’t do, uh, it doesn’t allow you to create EAP networks, certainly doesn’t allow you to 00:30:39.137,00:30:44.776 do Mana modes, and it doesn’t allow you to create more than one Wifi network. Sometimes you 00:30:44.776,00:30:49.014 might want to create more than one Wifi network, because probes don’t say what kind of security 00:30:49.014,00:30:55.153 principle they’re connecting to, so you might want to present an open PSK and EAP network and see 00:30:55.153,00:31:00.425 which one it connects to. So Michael made berate_ap, which is a fork of create_ap, uh, that 00:31:00.425,00:31:03.829 can do all of these things. It’s something else we’re releasing today. So it does all that 00:31:03.829,00:31:07.699 networking and access point orchestration for the most obvious ways in which you would 00:31:07.699,00:31:14.206 use Mana toolkit to do this stuff. If you want to get into the detail of all the other 00:31:14.206,00:31:18.443 config options, then you can handcraft your own config files and do it that way. And we’ve 00:31:18.443,00:31:24.549 written it all up in the Wiki, uh, but this just makes life much easier. So that’s an 00:31:24.549,00:31:30.388 example. Ignore the -n that crept in there, but this is an example of setting up a Mana-ed 00:31:30.388,00:31:37.129 EAP malicious access point, uh, that’s- if you don’t have the -n, natting traffic from wlan0 00:31:37.129,00:31:42.334 to eth0 to EvilCorp. That’s, if any of you have used Mana to edit some of the scripts, this 00:31:42.334,00:31:47.339 is way easier than any of the stuff we did before. Okay, and then there’s also a bunch of 00:31:49.841,00:31:53.979 really cool proportionality options that have been built into Mana. See it’s a sniper 00:31:53.979,00:32:00.285 rifle, “proportionality.” So by default Mana is a bit of a flamethrower, like it’ll just 00:32:00.285,00:32:04.656 target every device it sees and any network it sees, but if you’re on an engagement where 00:32:04.656,00:32:08.393 you’ve got specific scope, you might want to limit it to specific devices or specific 00:32:08.393,00:32:12.697 networks, um, or if you’re in law enforcement or something, and you’ve got a specific 00:32:12.697,00:32:18.236 mandate, you might want to limit what it does. So we built a lot of options in there like SSID 00:32:18.236,00:32:23.875 filters, that was contributed by a guy named Cyber Devil, uh, but one of the things we think is 00:32:23.875,00:32:29.414 really cool is we extended Mac ACLs down to a management frame level. So any of you should be 00:32:29.414,00:32:34.519 familiar with, uh, the way Mac address ACLs work on Wifi, you know your home router does it, 00:32:34.519,00:32:39.024 you can say “Only these Mac addresses can connect,” uh, you can see the AP but if you try 00:32:39.024,00:32:42.594 and connect and you’re not in there, you’ll get rejected. So we brought that down to 00:32:42.594,00:32:48.400 management frame level. So if the access point receives a probe request, sorry? If the 00:32:48.40-->000:32:53.972 management, if the access point receives a probe request from a disallowed, uh, Mac address, 00:32:53.972,00:32:57.275 then it’s not even going to respond to the probe address. So that means, for the most part, 00:32:57.275,00:33:01.379 it won’t even show up in their list of available networks. Also provides some ability to kind of 00:33:01.379,00:33:06.618 hide from, um, people who might be looking for these devices or wireless intrusion prevention 00:33:06.618,00:33:11.523 systems. Uh, we think it’s quite cool. And then I borrowed a concept from, uh, the aircraft 00:33:11.523,00:33:16.461 guys, they’ve got this idea of binary net masks, so that you can kind of mask out certain 00:33:16.461,00:33:21.166 bits in a Mac address, so you can do things like anything with this OUI, you know, any of these 00:33:21.166,00:33:26.271 devices can connect but these can’t, uh, but it also allows you to do things like for 00:33:26.271,00:33:30.709 randomized Mac addresses go full Mana on them, but when they try and connect, be a little more 00:33:30.709,00:33:35.881 circumspect about checking what the, the Mac address is. So it’s a really flexible way of dealing 00:33:35.881,00:33:40.886 with, with different Mac addresses. And then lastly, if you want to get into Wifi 00:33:43.421,00:33:47.525 hacking, it’s really difficult to practice. On the one hand, you’ve got to buy hardware, 00:33:47.525,00:33:52.063 you’ve got to make sure the chips that work with what you’re doing. Uh, so for example, the 00:33:52.063,00:33:56.234 those new black Alfas, the chunky ones, those things, because they’re doing more stuff 00:33:56.234,00:34:01.606 in firmware, you can’t use Mana’s, uh, probe manipulation stuff. The radio stuff will 00:34:01.606,00:34:06.645 work, but not those things. So you got to make sure you get the right hardware. Uh, and then 00:34:06.645,00:34:10.215 also it’s really difficult to kind of not target people you don’t mean to. You know, you 00:34:10.215,00:34:13.785 might be testing between your two devices, but it’s meanwhile it’s like man-in-the-middling 00:34:13.785,00:34:18.023 somebody next door. Any time somebody’s playing with stuff in the office, we just plug into 00:34:18.023,00:34:22.394 the wired network, because it’s just like DOS-ing the Wifi. I’ve even had really weird situations 00:34:22.394,00:34:27.132 in busy environments where it ends up kind of DOS-ing Bluetooth, um, which is kind of 00:34:27.132,00:34:32.137 strange. So in 2014 we built some CTFs in AWS where you could practice Wifi hacking, which 00:34:34.572,00:34:38.677 we’re kind of proud of, because Wifi in the cloud is a thing now. And, uh, today we’re going 00:34:38.677,00:34:44.015 to release some docket images that let you, well at the moment it’s one docket image, but 00:34:44.015,00:34:49.154 hopefully some more docket images in the future, that allow you to practice some of these, 00:34:49.154,00:34:53.258 these things. So you don’t need any hardware, it’s not going to target any live, live 00:34:53.258,00:34:57.195 environments, and you’ve got some kind of known completion criteria so you can make sure 00:34:57.195,00:35:02.100 you’re able to run these commands and they work. So that’s actually Michael in the 00:35:02.10-->000:35:07.305 picture there, if you look carefully. Uh, Michael’s a kendo nerd, and he told me that these 00:35:07.305,00:35:13.178 wooden swords are, uh, called chennais. So hardest problem in computer science: naming things, 00:35:13.178,00:35:19.484 so I’m calling the environment Chennai-fi. [Audience laughs] Uh, and I’m just going to show 00:35:19.484,00:35:24.189 you a little silly demo of what that looks like. So here’s the docker, the docker container 00:35:24.189,00:35:28.326 running on my Mac, there’s a whole ‘nother story about it, so if you’re, if you’re running 00:35:28.326,00:35:34.299 docker for Mac, just don’t try and do this on that. There are ways, but like I’m currently was 00:35:34.299,00:35:39.871 asked to politely take that stuff down by docker. So rather to do it on your Kalis or your 00:35:39.871,00:35:43.675 linux boxes ‘cause it needs certain kernel modules. But okay. So here’s a docker 00:35:43.675,00:35:49.080 container, doesn’t have anything, any hardware plugged into it. So if we look, there’s 00:35:49.08-->000:35:54.085 a wlan-->0 which means there’s a Wifi device, uh, and if you use airmon, you’ll see that that’s a 00:35:56.187,00:36:00.325 software simulator of 802 11 radios, so there’s this kernel module mac80211_hwsim, which 00:36:00.325,00:36:05.330 allows you to simulate fake Wifi devices that can connect to each other. And so if you then run, 00:36:09.567,00:36:14.906 if you put one of those devices into monitor mode, we’ve got some sticky chip- sticky tape 00:36:14.906,00:36:18.576 and chewing gum in the background which tries to figure out when you’re, you’re doing 00:36:18.576,00:36:24.816 these things. So if you run airodump, you’ll actually see Wifi networks and devices that 00:36:24.816,00:36:29.888 are there. Again, no hardware, these aren’t real things. Uh, there’s a WPA handshake, so you 00:36:29.888,00:36:35.827 can try and capture that handshake. If you bring up a Mana network, you’ll see, uh, 00:36:35.827,00:36:40.398 clients trying to connect to you, you can capture those credentials and crack them, and 00:36:40.398,00:36:45.370 you can do all of this without needing any actual hardware. Uh, so yeah, we’re going to release 00:36:45.37-->000:36:52.010 that docket image, you can just docker pull it and run it, and away you go. And that’s, that’s 00:36:52.01-->000:36:57.048 kind of the end of our, our talk. So we’re going to, we want, I bought a domain called 00:36:57.048,00:37:02.587 wifi dot net but with 1s, w1f1 dot net. Uh, so a little bit later after this if somebody 00:37:02.587,00:37:08.059 will lend me a computer- thanks guys. Um, I’m going to push, uh, all of the tools we mentioned up 00:37:08.059,00:37:12.764 there so that you can grab it. Um, so don’t be disappointed if you do it right now. Um, we’ll 00:37:12.764,00:37:17.302 try to go to the chill room and do it. And we also just want to use it as a bit of a repository 00:37:17.302,00:37:22.640 for kind of how to do these attacks and which tools are working, um, keep updating that 00:37:22.64-->000:37:26.411 as time goes, and maybe if some of you are playing with things is this room and it's going 00:37:26.411,00:37:31.683 well, you can send [mic cuts out] requests or write Wiki things for up there. Uh, 00:37:31.683,00:37:35.453 otherwise you can, you can tell us you hated the talk on Twitter. I am at singe and he is 00:37:35.453,00:37:41.559 underscore cablethief. Um, we’re going to check if Squirtle Boy is available. And, uh, we’re uh 00:37:41.559,00:37:46.564 we’re from sensepost. So thank you very much for your time and patience. [Audience applauds]