[00:00.740 --> 00:02.240] Hello everyone. [00:05.540 --> 00:07.100] Hi at the back. [00:07.360 --> 00:09.620] Alright, I'm going to do that awkward thing. [00:09.620 --> 00:12.340] How quiet does it get in here before I start talking? [00:13.040 --> 00:13.880] Yes. [00:14.300 --> 00:15.500] Do we have to look at people? [00:15.960 --> 00:17.320] Alright, okay. [00:17.600 --> 00:18.420] Hello. [00:18.660 --> 00:23.100] Today we are talking about rogue access point attacks. [00:23.480 --> 00:25.860] Improvements on the Karma toolkit. [00:25.860 --> 00:28.000] We built a toolkit called Mana. [00:30.000 --> 00:33.620] So just a quick disclaimer, I'm sure you've seen a hundred of these today. [00:34.720 --> 00:39.620] It's really difficult to demo this stuff without picking somebody up. [00:39.900 --> 00:42.460] So please turn off your Wi-Fi if you don't want to be part of it. [00:42.460 --> 00:45.480] We've reduced our transmit power, things like that. [00:45.820 --> 00:49.620] We're not trying to be malicious, but we can't demo the research otherwise. [00:50.060 --> 00:54.640] If you leave your Wi-Fi on and you stay here, we're going to take that as your consent [00:54.640 --> 00:56.700] that you're okay with stuff to continue. [00:56.700 --> 00:57.460] But it's not our intent. [00:57.460 --> 00:59.720] We're not going to be putting up people's passwords or anything like that. [00:59.720 --> 01:02.060] We're going to be targeting our devices. [01:02.060 --> 01:03.200] So just a quick disclaimer. [01:03.200 --> 01:07.700] If any of you are for law enforcement, please don't arrest us. [01:09.900 --> 01:10.700] Okay. [01:11.200 --> 01:13.180] Hi, I'm Dominic and this is Ian. [01:13.180 --> 01:14.700] We did this work. [01:14.740 --> 01:17.940] We work for a company in South Africa called SensePost. [01:18.880 --> 01:24.060] We're a pen testing firm and those are our contact details if you want them. [01:25.460 --> 01:26.140] Okay. [01:26.140 --> 01:31.220] So why are we looking at Wi-Fi in particular and rogue access point attacks? [01:31.220 --> 01:32.340] Those things are lame. [01:32.340 --> 01:35.120] Every pineapple has got Karma on it. [01:35.120 --> 01:36.760] We can run this stuff. [01:36.760 --> 01:37.380] Yeah, so what? [01:37.380 --> 01:38.080] Nothing new. [01:38.080 --> 01:39.800] Karma attacks 2004. [01:40.160 --> 01:42.260] This is old school. [01:42.600 --> 01:48.000] So Wi-Fi is at a point where it's like your skiddy's first day out. [01:48.000 --> 01:50.320] You want to get into hacking, you either pick up a pair of lockpicks [01:50.320 --> 01:53.480] or you pick up a pineapple and you start doing Wi-Fi stuff. [01:53.480 --> 01:56.380] And there's a couple of reasons for that. [01:56.380 --> 01:59.740] So the one is we all recognize that Wi-Fi is ubiquitous. [01:59.740 --> 02:01.560] We've got it just everywhere. [02:02.320 --> 02:04.300] Plus it gives us access to coolness. [02:04.300 --> 02:08.640] We've got all the cloud services that people are going to use. [02:08.940 --> 02:09.800] Should I? [02:09.880 --> 02:11.000] Do I need to like stare up here? [02:11.000 --> 02:11.460] Okay. [02:11.460 --> 02:14.040] We've got all the cloud services that you can get access to. [02:14.040 --> 02:15.380] It gives us lots of goods. [02:15.500 --> 02:18.080] It's not like you're just communicating with some local server. [02:18.080 --> 02:20.580] You're communicating with stuff that runs your life. [02:20.580 --> 02:24.500] And it means we can use 20-year-old Ethernet attacks [02:24.500 --> 02:26.200] because we're on the same local network. [02:26.200 --> 02:30.600] So we've got toolkits spanning decades that allow us to bring a taxi. [02:30.600 --> 02:32.660] I mean, ARP spoofing is still a thing. [02:33.320 --> 02:37.100] So Wi-Fi is a pretty exciting thing to go for. [02:37.100 --> 02:40.660] Except the attacks, like we haven't really seen anything new [02:40.660 --> 02:46.000] coming out from Rogue AP stuff really since Karma in 2009. [02:46.840 --> 02:51.200] So we've got these vulnerabilities at every layer of the Wi-Fi protocol. [02:51.200 --> 02:55.620] So we can spoof, trick devices into connecting to our malicious networks [02:55.620 --> 02:57.360] with Karma attacks. [02:57.360 --> 03:02.420] Dino Daizovi, Sean McCauley, 2009-2004, they presented that stuff. [03:02.800 --> 03:07.080] Once we get something to connect to it, we can crack the crates. [03:07.080 --> 03:10.360] If you can capture a handshake, you can crack WPA. [03:10.360 --> 03:14.280] If you capture MS-CHAP things, you can send that through [03:14.760 --> 03:17.860] a sleep or cloud cracker, and you can crack that stuff. [03:17.860 --> 03:20.220] Cool, so those two layers are handled. [03:20.220 --> 03:23.660] Once you're connected to the network, we can sniff everyone's passwords. [03:23.660 --> 03:26.280] Doug Song released DSniff back in 2000. [03:26.740 --> 03:31.660] Since then, we had Robert Graham release, I think it was at DefCon, [03:31.660 --> 03:35.560] Hamster and Ferret, does anyone remember Hamster and Ferret? [03:35.840 --> 03:38.700] In 2007, I think it was. [03:38.700 --> 03:42.060] Then we had Fire Sheep in 2010, which got everyone excited. [03:42.060 --> 03:46.260] It's all the same stuff, it's just new implementations of it. [03:47.900 --> 03:50.760] Once you connect to a network, we can capture all these creds. [03:51.720 --> 03:55.080] We've got these vulnerabilities at every layer of the network, [03:55.080 --> 03:57.360] and we should have creds falling from the sky. [03:57.660 --> 04:01.520] You should be able to be a pen tester where you can walk into a company [04:01.520 --> 04:03.800] and you'll just have passwords showing up, [04:03.800 --> 04:07.440] and then you can go home and log in remotely, [04:07.440 --> 04:10.320] and you've saved yourself a bunch of on-site work. [04:10.320 --> 04:13.260] But the truth is, that doesn't happen. [04:13.680 --> 04:15.680] You've played with your pineapple, you've done it, [04:15.680 --> 04:19.460] and you've got a few people who are still checking mail over pop, [04:20.000 --> 04:22.360] but you haven't really got much else. [04:22.560 --> 04:25.420] Because these tools don't work as well as they used to. [04:25.460 --> 04:29.340] So in 2004, when Karma was released, that stuff worked really well, [04:29.340 --> 04:31.320] but now Karma doesn't work so well. [04:31.320 --> 04:35.620] If you look at your average Android device, particularly the newer ones, [04:35.620 --> 04:38.060] if you look at the list of available networks, [04:38.060 --> 04:44.520] the networks that the Karma device is probing, responding from, don't show up. [04:44.520 --> 04:46.400] So it means it doesn't automatically connect to them. [04:46.400 --> 04:49.180] Your home network is not going to get automatically connected to you. [04:49.580 --> 04:54.160] iOS devices have dramatically reduced how much probing they do through a variety of things. [04:54.160 --> 04:55.880] I'll go into more detail on this stuff. [04:55.880 --> 04:58.740] But we end up in a state where the Karma attacks don't work so well. [04:58.900 --> 05:02.340] When it comes to the network-sniffing stuff, [05:02.340 --> 05:03.940] the stuff is old. [05:03.940 --> 05:06.380] Doug Song released that stuff in 2000. [05:06.380 --> 05:08.760] If any of you have run message-snarf recently, [05:08.760 --> 05:12.920] it's still looking for MSN messenger messages. [05:12.920 --> 05:16.000] You're not going to see that stuff going over your average network anymore. [05:16.840 --> 05:18.480] FireSheep was a flash in the pan. [05:18.480 --> 05:20.240] That stuff doesn't work anymore. [05:21.260 --> 05:23.500] Over the years, these tools have been written. [05:23.620 --> 05:24.940] They stopped working. [05:24.960 --> 05:26.700] So right now, the current state, [05:26.700 --> 05:29.420] we've got this promise of vulnerabilities at every level, [05:29.420 --> 05:31.480] where we should have creds falling from the sky, [05:31.480 --> 05:33.800] but actually we're crawling through the desert [05:33.800 --> 05:36.060] with a little bite to eat every now and again. [05:36.920 --> 05:39.620] So we put this toolkit together called M.A.N.N.A. [05:41.220 --> 05:43.840] Truthfully, we liked the idea of M.A.N.N.A. from heaven for the talk, [05:43.840 --> 05:45.260] so we tried to come up with a backronym [05:45.680 --> 05:47.380] that would be something cool. [05:47.380 --> 05:48.680] We can't come up with anything cool. [05:48.680 --> 05:50.340] At the moment, we're sitting with M.A.N.N. in the middle [05:50.340 --> 05:52.320] and Network Attack Toolkit. [05:53.160 --> 05:54.160] It's still stupid. [05:54.160 --> 05:56.080] So if you have a better backronym, please share that with us. [05:56.080 --> 05:57.360] We'd be really open to it. [05:57.820 --> 06:00.260] So the M.A.N.N.A. toolkit, we've built some stuff [06:00.260 --> 06:02.000] and we've combined a bunch of things together [06:02.000 --> 06:07.160] and it's, at the moment, a horrible mash of lots and lots of things [06:07.160 --> 06:09.640] but you can run a single command on Kali and it'll work. [06:09.640 --> 06:11.740] So it's a horrible mash that works. [06:11.740 --> 06:14.460] We hope to get it into a better state. [06:14.720 --> 06:18.300] Alright, I'm going to teach some of you to suck some RF eggs. [06:18.740 --> 06:23.000] Just a quick targeted Wi-Fi primer on stuff you need to understand this. [06:23.220 --> 06:24.640] So we're talking Wi-Fi. [06:24.640 --> 06:29.220] We're not talking 3G, Bluetooth, RFID, anything like that. [06:29.220 --> 06:33.320] We're talking 802.11 a, b, g, n, a, c. [06:34.560 --> 06:38.100] We're specifically, for the beginning part at least, looking at management packets. [06:38.100 --> 06:42.080] So some of you will know, in Wi-Fi, you've got control packets, data packets, and management packets. [06:42.180 --> 06:44.220] So control packets are the things that'll say... [06:45.000 --> 06:47.940] the device will say, hey AP, I want to send some data [06:47.940 --> 06:49.620] and AP will say, everyone shut up! [06:49.620 --> 06:52.980] And then it'll send some data. Those are request to sends and clear to sends. [06:53.200 --> 06:55.200] And then data packets are the actual data. [06:55.200 --> 06:59.460] And management packets have got probe requests, probe responses, and beacons, [06:59.460 --> 07:01.780] which are the ones we're most interested in. [07:01.820 --> 07:06.400] So every wireless network has beacons that come out constantly. [07:06.400 --> 07:09.780] It's how you get the timing on the network, know when to communicate. [07:10.000 --> 07:12.820] And they've got a bunch of information in it, like the SSID. [07:12.820 --> 07:17.060] If you hide your SSID, then the beacon won't have the SSID in it. [07:17.060 --> 07:21.540] And then probe requests and responses are how devices talk, [07:21.540 --> 07:24.880] figure out how to associate two networks and which networks are nearby. [07:25.380 --> 07:27.800] So this is a really simplistic diagram. [07:27.800 --> 07:32.800] But when you, on your average device, be it a laptop or a mobile device, [07:32.800 --> 07:36.220] when you click on the Wi-Fi thing and look at the networks nearby, [07:36.220 --> 07:40.140] what'll happen is your client will send out a broadcast probe request, [07:40.140 --> 07:42.340] and then all the nearby access points, we've only got one here, [07:42.340 --> 07:45.580] but all the nearby access points will respond with a probe response. [07:45.580 --> 07:48.080] If the network's hidden, then it won't respond. [07:48.080 --> 07:50.480] It'll only respond if you probe directly for that network, [07:50.480 --> 07:52.460] so you have to know the name beforehand. [07:52.760 --> 07:56.480] Okay, so I'm sorry if some of you know this, but it's necessary. [07:57.540 --> 08:02.520] Okay, once you decide to associate to a network, then this step happens. [08:02.620 --> 08:06.300] I've actually cut out a bit in the middle because nobody used shared key authentication. [08:07.080 --> 08:12.600] So once I've done my search and I've seen there's a DEFCON network nearby, [08:12.600 --> 08:14.420] I'll then click on the DEFCON network. [08:14.420 --> 08:18.460] My device will send another probe request, but now it's directed for the DEFCON network, [08:18.920 --> 08:21.780] get a probe response from the access points, and then it associates. [08:21.780 --> 08:23.560] Any of you familiar with the AirCrack suite? [08:23.560 --> 08:26.940] If you use AirReplay fake auth, this is exactly what fake auth does. [08:26.940 --> 08:30.500] When you get that association ID, you've hit this part here. [08:30.980 --> 08:32.480] So this is how stuff associates. [08:32.480 --> 08:34.220] Now, it's important to note that there's two things. [08:34.220 --> 08:37.300] There's finding networks, and there's associating to networks. [08:37.600 --> 08:40.880] Because current Karma attacks deal with this part only. [08:42.600 --> 08:46.120] Okay, so Karma attacks. Sean McCauley's at IOActive. [08:46.540 --> 08:48.180] I'm not sure what Dino is these days. [08:48.560 --> 08:50.840] He's either fun-employed or something. [08:51.780 --> 08:56.600] 2004, I mentioned that they came up with this really cool stuff that if... [08:57.800 --> 08:58.520] I mean... [08:59.060 --> 09:00.840] Yeah, they came up with these Karma attacks. [09:01.280 --> 09:02.980] So I've got a... [09:02.980 --> 09:06.080] Do Americans play Marco Polo when you're kids? [09:06.080 --> 09:08.580] Oh, I don't want to be prescriptive. Some of you aren't Americans. [09:08.580 --> 09:10.220] So you guys know what Marco Polo is. [09:10.220 --> 09:12.400] Okay, so just in case, because I saw some people doing this. [09:12.400 --> 09:14.620] Marco Polo is a kid's game you play in the pool. [09:14.620 --> 09:16.500] Somebody closes their eyes. They're it. [09:16.700 --> 09:18.620] And then they have to shout out, Marco. [09:18.620 --> 09:20.160] And everyone around them shouts, Polo. [09:20.160 --> 09:23.680] And they have to acoustically figure out where you are and try and catch you. [09:23.840 --> 09:26.140] So Wi-Fi networks are a bit like this. [09:26.420 --> 09:29.600] My device, when it is looking for a nearby network, [09:29.600 --> 09:30.460] shouts out, Marco. [09:30.460 --> 09:33.040] And all the access points nearby say, Polo. [09:33.040 --> 09:35.180] And it knows where the access points are. [09:36.020 --> 09:38.620] And there's no authentication at this level. [09:38.620 --> 09:41.420] Because nobody uses shared-key authentication because it's got ROMs. [09:41.420 --> 09:45.980] So what happens is, if this is a legitimate access point over here, [09:45.980 --> 09:49.560] and I shout, Marco, and it goes, Hey, I'm Polo. [09:49.600 --> 09:54.580] Then you can have another access point over here say, Hey, I'm Polo too. [09:54.580 --> 09:57.820] And that's not even a vulnerability because this is how your corporate networks run. [09:57.820 --> 10:01.020] Like if you've got 500 access points spread across your campus, [10:01.020 --> 10:04.740] and they're all called Acme Corp Wi-Fi, [10:04.740 --> 10:08.540] you need to have lots of things that can respond to the same ESS ID, [10:08.540 --> 10:10.360] but they've got different BSS IDs. [10:10.360 --> 10:13.980] So calmer attacks take advantage of this. [10:14.560 --> 10:18.500] And in particular, what they rely on is the fact that devices have something called a PNL, [10:18.560 --> 10:19.840] a preferred network list. [10:19.840 --> 10:24.260] So when you add a Wi-Fi network and you click Remember Me or Save This Network, [10:24.260 --> 10:30.380] then typically what happened before is those devices will send directed probes out for those networks. [10:30.620 --> 10:31.640] Now, I'm not sure why. [10:31.640 --> 10:35.520] It was the stupidest design decision ever because it's led to a world of hurt since then. [10:35.540 --> 10:39.620] But if I've clicked on Save This Network, my home network, [10:39.620 --> 10:40.580] it's called HomeNet, [10:40.580 --> 10:46.100] when I come to a new area like DEF CON and I click Open Up My Wi-Fi, [10:46.100 --> 10:49.540] my device historically would probe for a network called HomeNet. [10:49.540 --> 10:53.280] It wouldn't send out a broadcast, wait to see if something called HomeNet exists, [10:53.280 --> 10:54.560] and then connect to it. [10:54.560 --> 10:55.760] It would just probe. [10:55.840 --> 10:57.340] And there's all sorts of different reasons. [10:57.340 --> 11:00.460] So like historically, that's just how they built it on computers. [11:00.600 --> 11:06.060] Recently we found out in Android that actually the problem is when it gets offloaded for low power mode, [11:06.060 --> 11:09.920] there's a separate subsystem which deals with that, which is sending out the probes. [11:10.280 --> 11:12.900] So there's all sorts of different reasons as to why it's doing it. [11:12.900 --> 11:14.400] But the truth is it does it. [11:14.420 --> 11:17.960] If some of you have seen some of our other research, we built something called Snoopy. [11:18.220 --> 11:20.520] The guy is actually presenting just after us. [11:20.860 --> 11:24.360] All this does is it looks at the probes that your devices are sending out. [11:24.360 --> 11:25.820] It geolocates it. [11:25.820 --> 11:28.260] And then it can try and track where you've been. [11:28.260 --> 11:32.120] So if one of your devices is probing for a network that only exists in Saudi Arabia [11:32.120 --> 11:36.540] and a network that only exists in the United States, we can start getting an idea. [11:36.540 --> 11:37.620] So it's really lame, right? [11:37.620 --> 11:41.080] The single little probe request was leaking all this stuff out. [11:41.620 --> 11:43.740] And so that's how CalmAttacks worked. [11:43.740 --> 11:50.080] It responded to these directed probes and then you could get somebody to connect to your network. [11:51.640 --> 11:53.700] There was supposed to be an animation there. [11:55.340 --> 11:56.700] Okay, well let's... [11:57.340 --> 12:01.960] Okay, so recently two guys built newer versions of it. [12:01.960 --> 12:06.760] So the pale guy is DigiNinja, or Robin Wood. [12:06.760 --> 12:11.580] And he built the version of HostAPD that implements Canva that's on the Pineapple. [12:11.900 --> 12:15.880] The guy on the right is Thomas, if anyone can pronounce his surname. [12:15.880 --> 12:16.720] Anyone here? [12:17.360 --> 12:18.480] Jotrep. [12:18.640 --> 12:21.280] The guy who built the Aircrack suite. [12:21.280 --> 12:24.200] I'm really sorry for not being able to pronounce his surname. [12:24.200 --> 12:25.940] Awesome, they both did great work. [12:25.940 --> 12:27.960] And they've built modern versions of Canva. [12:27.960 --> 12:31.780] So if you run AirbaseNG, you can have Canva implemented in software. [12:31.860 --> 12:36.180] Or if you're running the Pineapple, you're using HostAPD written by Robin. [12:36.920 --> 12:40.800] Okay, but Canva doesn't work so well anymore, as I mentioned before. [12:41.200 --> 12:42.200] It doesn't... [12:42.200 --> 12:51.260] Your PNL list, when you're looking for networks, those networks don't show up. [12:51.260 --> 12:54.620] Canva is only going to respond when you send a directed probe. [12:55.280 --> 13:00.960] So the most obvious change here is let's get Canva to respond to broadcasts. [13:01.740 --> 13:04.900] And that's one of the first things that we implemented in Mana. [13:04.900 --> 13:12.040] So we took HostAPD and we ported it to HostAPD 2.2 because the Pineapple is still running version 1. [13:12.660 --> 13:18.780] And we've got a hash that we just look at all of the probe requests that we've received. [13:18.780 --> 13:22.400] And we build up a view of the PNL of the individual devices. [13:22.520 --> 13:29.940] So now when one of your devices sends out a broadcast probe request, we can respond with broadcast probe responses. [13:30.640 --> 13:34.220] So you should see when we do our demo just now, if you're up for it, [13:34.220 --> 13:41.420] networks that your device is probing for would show up as available networks on your phone or whatever you've got. [13:41.840 --> 13:45.100] Now, that implies some interesting stuff. [13:45.100 --> 13:49.340] For the longest time I thought, well, and actually there was an implementation thing on iOS. [13:49.340 --> 13:54.220] If you ever, with old iOS, I think like iOS 6, ran comma attacks, [13:54.220 --> 13:59.280] you would have noticed, you'd see like the network name changing and then the UI would get all screwed up. [13:59.940 --> 14:04.980] So I was convinced that you needed to change the BSSID, like have a different BSSID for things. [14:05.360 --> 14:10.580] It turns out none of that's true. Ian pointed it out to me. He figured it out. [14:10.580 --> 14:18.240] We can send multiple probe responses from the same BSSID and all devices respect that. That's fine. [14:18.240 --> 14:19.940] It will show up as different networks. [14:20.900 --> 14:23.980] So that was the one finding which allowed us to handle Discovery better. [14:23.980 --> 14:25.820] It's implemented. It's working really well. [14:25.820 --> 14:27.880] I'm going to hand over to Ian now to do a demo. [14:29.280 --> 14:33.200] Unfortunately, we didn't sacrifice enough chickens to the demo gods. [14:33.440 --> 14:36.320] So his thing is not displaying up there. [14:36.320 --> 14:38.980] So we've got an iPhone. The Android thing I don't think is going to work. [14:38.980 --> 14:41.200] We've got some video backups just in case. [14:42.680 --> 14:43.840] Right, great, everyone. [14:43.840 --> 14:45.740] Before I carry on, I just want to make one thing. [14:45.740 --> 14:49.020] This is a note I've got stuck on my wall in the office. [14:49.220 --> 14:52.940] I've been battling with HostAPD probably for the last couple of months. [14:53.020 --> 14:56.220] I've had sleepless nights about it, including last night. [14:56.320 --> 15:01.760] And so there's probably a lot of very bad code inside that... [15:01.760 --> 15:03.220] Sorry, can you hear me? [15:03.220 --> 15:06.500] Is that better? [15:09.220 --> 15:15.760] Okay, as I was saying, I've been battling with the code in HostAPD for a couple of months. [15:15.760 --> 15:19.700] I've had sleepless nights, including last night. [15:20.680 --> 15:22.800] No, that's not an amplifier, is it not? [15:22.800 --> 15:25.340] Okay, apologies. I'll speak louder. [15:25.460 --> 15:30.040] But in any case, this was a sticker I had up on my office wall, [15:30.040 --> 15:34.180] just to remind myself that I'm rather annoyed with the way things work. [15:34.540 --> 15:38.420] In any case, we had a couple of demo-god things. [15:38.420 --> 15:41.900] As normal, Linux and projectors just don't want to work. [15:41.960 --> 15:46.360] I'm going to have to try and present off an Apple laptop. [15:46.360 --> 15:49.960] The key bindings are all funny, so apologies about this. [15:49.960 --> 15:54.040] We're going to plug in an iPhone now, and I am going to... [16:21.260 --> 16:26.080] Okay, so iPhone, it's looking at nearby Wi-Fi networks. [16:27.240 --> 16:29.080] Somebody's running Pineapple. [16:29.920 --> 16:32.120] Get better offset, whoever you are. [16:32.560 --> 16:36.320] I've now fired up Karma, and what we should see is we should start seeing [16:36.320 --> 16:41.220] networks we've connected to before start showing up as open. [16:41.520 --> 16:43.020] Go right to the top, Dominic. [16:43.020 --> 16:44.700] I haven't connected to anything. [16:46.680 --> 16:51.720] There are a hell of a lot of networks currently being shown all over the place here. [16:59.160 --> 17:01.800] There's also a lot of traffic, which is... [17:03.560 --> 17:07.280] There's also a lot of traffic which is interfering with things, [17:07.280 --> 17:10.420] so I'm going to just switch to a demo here. [17:10.420 --> 17:12.980] Okay, you've got to switch that way. [17:13.380 --> 17:16.140] We hope for a live demo. It's not working. [17:16.240 --> 17:18.500] I'll try again a little later. [17:18.500 --> 17:22.720] I think you've just gone on to password. [17:59.350 --> 18:03.730] Right, so over here, what we have actually got is actually [18:05.050 --> 18:08.470] a... this is my phone. [18:08.470 --> 18:11.930] And I'm starting up Karma over here, and you'll see I've got a bunch of [18:12.950 --> 18:17.370] networks which I previously connected to at other places. [18:17.510 --> 18:21.330] And what we'll see happening is as I start Karma, [18:21.330 --> 18:23.470] we're literally going to come along and [18:24.610 --> 18:28.170] different networks are actually going to start showing as [18:28.870 --> 18:31.290] available. As we sort of see, for every [18:32.390 --> 18:35.670] broadcast I send, I'm getting responses here. [18:35.670 --> 18:39.830] I'm getting a response for food. I'm getting a response for... [18:41.670 --> 18:43.490] one of these. I can't read it. [18:43.490 --> 18:47.650] It's a little bit... but there's a bunch of different networks which are all of a sudden starting to [18:47.650 --> 18:52.290] come up and responding to my specific device. [18:52.290 --> 18:55.530] So what's happened over here right now is [18:55.530 --> 18:59.930] the phone is actually just connected to internet, an open network I previously [18:59.930 --> 19:03.990] connected to. Simply from various probes, [19:03.990 --> 19:06.710] my phone was actually making. [19:07.510 --> 19:10.530] Sorry, it's connected to Foo. Apologies about that. [19:10.530 --> 19:15.690] So it's connected to Foo. No complaints. Android device didn't complain at all. [19:15.690 --> 19:19.870] And all of a sudden we're now on the... we've connected to that specific [19:19.870 --> 19:21.030] network. [19:23.230 --> 19:27.410] Okay, so it's a standard Karma demo, but what's [19:27.990 --> 19:32.230] relevant about that stuff is if you look at modern Android, [19:32.230 --> 19:35.550] so 4.4, things like that, networks which are on your [19:36.350 --> 19:39.370] PNL with current Karma don't show up as available. [19:39.610 --> 19:44.270] Because now we're responding to the broadcast, it shows up as available. And the big thing there is that you'll [19:44.270 --> 19:48.170] get stuff automatically connecting to you. So if it's sitting in someone's pocket and it's [19:48.170 --> 19:52.190] configured to auto pull mail, you now get that stuff connecting. Whereas before they had [19:52.190 --> 19:56.430] to explicitly click on the network. It makes a big difference [19:56.430 --> 20:00.110] in a bunch of different scenarios. You get a higher connection rate. [20:00.110 --> 20:04.090] So now the problem... the next problem we ran into is that [20:04.090 --> 20:07.690] Apple devices have radically reduced the amount of probing they do. [20:07.890 --> 20:11.830] So they've gotten savvy and they don't probe for [20:11.830 --> 20:16.010] public networks, or open networks, sorry, not public networks, in their PNL. [20:16.010 --> 20:20.210] They wait to see a broadcast response from it. But while investigating this stuff [20:20.210 --> 20:24.130] we noticed that Apple devices weren't even probing for hidden networks. [20:24.170 --> 20:28.190] Now if you remember the description about hidden networks, you have to probe for that exact [20:28.190 --> 20:32.370] network with that network name for the thing to respond and for you to be able to associate. [20:32.570 --> 20:36.390] So what typically happens with other devices is that if you have a hidden network [20:36.390 --> 20:40.290] in your PNL, everywhere you go this thing is spamming out directed probes [20:40.290 --> 20:44.510] for that. But with Apple devices they weren't. So like, well this is impossible. [20:44.510 --> 20:48.250] How does it connect to a network? We record it connecting to the network, fine, it would send [20:48.250 --> 20:52.350] out probes. After a bunch of time trying to construct ridiculous [20:52.350 --> 20:56.530] Faraday cages which didn't work, I managed to figure out that Apple devices [20:56.530 --> 21:00.050] need to see at least one hidden network. Then they will [21:00.050 --> 21:03.970] disgorge all of their networks on the PNL which are hidden. [21:04.090 --> 21:08.150] So if you're not seeing probes from Apple devices bring up a hidden network, it doesn't have to be [21:08.270 --> 21:11.930] a real network. It can be on your MiFi device, it can be something here. [21:11.930 --> 21:15.810] We've got an example configuration here that you can use. Just at least one nearby. [21:15.810 --> 21:18.590] Doesn't matter what it looks like. It'll start probing for those. [21:21.190 --> 21:23.870] But there's... oh, and interestingly, so the hypothesis is [21:23.870 --> 21:28.010] not that Apple did this for privacy reasons, but to try and get everyone to use iBeacon. [21:28.010 --> 21:31.690] They were sick of the fact that retailers and ad trackers are using [21:31.690 --> 21:35.850] Wi-Fi probes to start tracking people. They want them to use iBeacon to track people. [21:35.850 --> 21:39.870] So they started fixing this stuff up, supposedly. There's also claims that iOS 8 is [21:39.870 --> 21:43.810] going to use random MAC addresses for their probing. I've got [21:43.810 --> 21:47.850] iOS 8, I haven't seen it do any randomized MAC probes yet, so I think that's [21:47.850 --> 21:51.610] just a threat at this point in time. So it was [21:51.610 --> 21:55.750] then presented an interesting challenge to us. How do we get iOS devices [21:55.750 --> 21:59.450] which aren't probing for open networks to connect to that stuff? [21:59.710 --> 22:03.610] So we implemented something called loud mode. So right now, when [22:03.610 --> 22:07.590] this stuff's running, you'll see networks for your device. So if your device [22:07.590 --> 22:11.450] is probing for foo and your device is probing for bar, you'll each see [22:11.450 --> 22:15.610] foo and bar, but you won't see bar and you won't see foo. It's individual to your [22:15.610 --> 22:19.930] device. Loud mode just takes that away. You start seeing everyone's device. [22:19.930 --> 22:23.730] But it lives up to its name. In a busy place like this, you'll start seeing [22:23.730 --> 22:27.750] hundreds of networks showing up. And it also leads to interesting [22:27.750 --> 22:30.910] undefined behavior in really busy environments. [22:31.570 --> 22:35.910] My VM spontaneously rebooted at some point while I was testing this [22:35.910 --> 22:39.950] stuff last night, because the list gets bigger over time. [22:39.950 --> 22:43.950] And eventually it's just spamming out hundreds of networks, broadcast [22:43.950 --> 22:48.050] responses in response to one thing. But the advantage is the ramp-up in getting [22:48.050 --> 22:52.070] things connected is really good. And what we're relying on there is the fact [22:52.070 --> 22:56.290] that laptops have had none of this stuff. So Windows machines, [22:56.290 --> 23:00.190] Apple, OS X devices, Linux devices, all happily probe [23:00.190 --> 23:04.570] for their remembered networks. Mobile devices, they're limiting the stuff, but not these. [23:04.570 --> 23:07.710] So if you've got two devices with you, one your laptop [23:07.710 --> 23:12.170] and one your phone, then we're gonna get the probe and it should get to it. If two of you [23:12.170 --> 23:15.490] work at the same company and one of you's got a promiscuous device [23:15.930 --> 23:19.650] and the other doesn't, then it's gonna connect. If two of you have been to the [23:19.650 --> 23:23.550] same airport, if two of you are from the same country and have a similar thing, we just rely [23:23.550 --> 23:27.490] on the fact there's gonna be some commonality somewhere. And it works [23:27.490 --> 23:31.490] pretty well. We end up getting a higher rate of connections. [23:31.690 --> 23:35.610] But once it ramps up, you get a lot more connections. [23:45.330 --> 23:47.130] Sorry, Apple, I really... [23:49.310 --> 23:50.970] You've gone into a corner. [23:50.970 --> 23:55.010] Okay, thank you. Apologies, I used to work on an Apple [23:55.010 --> 23:59.430] years ago. I don't really... gone into a corner again. [23:59.870 --> 24:03.790] Apologies. It's fine, I think I'll manage. [24:04.130 --> 24:06.710] So, okay, comma two. [24:07.510 --> 24:09.970] Right, so here what we've got is we've got [24:10.990 --> 24:15.250] the same thing happening. You see there's a whole bunch of responses coming in here. [24:15.410 --> 24:18.950] And we've only got a couple of networks [24:18.950 --> 24:22.850] open on the right. But as soon as this starts [24:22.850 --> 24:26.970] building up, you'll see that list is going to get bigger and bigger. Apologies, this is just [24:26.970 --> 24:30.970] me connecting. What's nice about this is if you connect to a network [24:30.970 --> 24:35.130] that isn't there, it'll connect automatically. Wrong video. [24:35.130 --> 24:38.870] Sorry, so I mean that network is a brand new network. It just [24:38.870 --> 24:41.610] works perfectly. It's comma three then. [24:43.810 --> 24:47.090] Comma loud. Okay, so what we've got over here, [24:47.090 --> 24:50.950] we've got the same thing. We've got a couple of networks [24:50.950 --> 24:54.930] open. What I've done is I've just edited the [24:54.930 --> 24:58.830] config file. I've enabled loud mode. And what we'll see here when I switch [25:00.230 --> 25:03.250] Wi-Fi on is we're going to see [25:03.250 --> 25:07.190] that it's connecting to MANA, but at some point we're going to get a couple [25:07.190 --> 25:11.030] of networks coming up over here. So [25:11.030 --> 25:15.310] there's someone TGUNJCDM etc etc. When we scan [25:15.310 --> 25:19.490] we're going to see that coming up over there. That's not a network my device [25:19.490 --> 25:23.670] is probing for. That's a network that some other device has been looking for. [25:23.670 --> 25:27.010] But now because we've enabled loud mode, it's broadcasting it [25:27.010 --> 25:31.410] every time it receives any type of request. So that literally [25:31.410 --> 25:35.290] just increases the stuff. And as we give it a bit more time, you're going to see this list is [25:35.290 --> 25:38.610] going to grow and grow and grow as it picks up more and more networks [25:39.430 --> 25:43.230] responded to by other devices. So here we've got [25:43.230 --> 25:47.210] Yankees. Yankees rule was recorded last night. And it's going to carry [25:47.210 --> 25:51.690] on growing and growing until it actually ends up with quite a [25:52.510 --> 25:58.010] sizable list of devices. [25:59.810 --> 26:00.370] So... [26:00.370 --> 26:03.910] Ashton Wireless etc etc. The list just grows [26:03.910 --> 26:09.070] and grows. But in any case, that's loud mode. It does significantly increase [26:09.070 --> 26:11.250] the number of connections you're going to get in. And I'll hand over [26:11.250 --> 26:12.770] to Dominic. Thanks. [26:15.290 --> 26:18.630] I'm looking at it now and I'm like, oh man, that's really trivial. [26:18.790 --> 26:23.330] But I can't underestimate how much work it was to get this implemented in HostAPD. It's like this low level [26:23.330 --> 26:27.130] C that interacts with drivers and it doesn't have any comments. There are no comments. [26:27.130 --> 26:30.650] There's one comment every now and again. I'm not sure why. [26:30.930 --> 26:35.310] You have to put debugging statements everywhere. At some point Ian was in GDB [26:35.310 --> 26:37.610] just trying to figure out what the hell was going on. [26:39.530 --> 26:41.510] Okay, so the next [26:41.510 --> 26:45.630] is secure networks. Karma attacks don't handle secure networks at all. They need [26:45.630 --> 26:49.870] to be open networks. Now, we confess we haven't come up with any new [26:49.870 --> 26:53.590] ways of pwning secure networks. But we have integrated some [26:53.590 --> 26:57.230] stuff in here. So just to be clear [26:57.230 --> 27:01.350] WEP, WPA, EAP networks or Ada2 1x [27:01.350 --> 27:05.830] this is what we mean by secure networks. Right now your options for going over those [27:05.830 --> 27:09.890] are to use Freeradius WPE. I think that [27:09.890 --> 27:12.710] was 2008. [27:13.710 --> 27:17.950] So it's Joshua Wright and Brad Antonovich. I'm sorry if I've [27:17.950 --> 27:21.750] ruined his surname. I think that's the right one. So they wrote Freeradius WPE. [27:21.750 --> 27:25.630] It's a radius server that would dump the MSChap hashes. [27:25.630 --> 27:29.890] You can then send it to Joshua Wright's asleep or these days hashcat and things. [27:30.510 --> 27:33.110] You crack it and you get crates. [27:34.670 --> 27:37.250] So what's quite nice about HostAPD [27:38.970 --> 27:40.490] let me go... [27:41.010 --> 27:45.290] HostAPD has got an EAP server built into it. So we can modify [27:45.290 --> 27:49.230] HostAPD's EAP server and actually Brad Antonovich started doing this a couple [27:49.230 --> 27:52.830] of years ago and then he just kind of left it. So Ian took Brad's patches [27:52.830 --> 27:57.170] he brought them up to date for HostAPD 2.2, merged them in. So now [27:57.170 --> 28:00.990] the EAP stuff is integrated. So this version of HostAPD does all the new [28:00.990 --> 28:04.070] comma stuff, plus it gives you an updated version of [28:05.150 --> 28:09.290] Freeradius. So we're not using Freeradius, we're using the HostAPD's radius. [28:09.290 --> 28:12.970] But it's all integrated. Cool, so now we've got it integrated, why must we [28:12.970 --> 28:16.990] send this off to another process and then edit configuration files and bring this [28:16.990 --> 28:21.190] stuff up again? We can do that automatically. If somebody tries to associate to an EAP network [28:21.730 --> 28:25.250] then we can record that hash, try and crack it. [28:25.250 --> 28:28.610] If it's easy enough to crack, we can put it in the config file [28:28.610 --> 28:32.610] and if they try and connect again, they'll connect. So we've got a higher [28:32.610 --> 28:36.210] potential of now getting people to connect. Particularly in corporate environments, because [28:36.210 --> 28:40.690] people are more likely to be running 802.1X in corporate environments. [28:41.150 --> 28:44.470] So just to give you an idea of how that works, this was my attempt to draw a simple [28:44.470 --> 28:48.730] PEEP diagram. It's actually a little more... I have to remove some things here. [28:48.870 --> 28:52.810] But there's two things happening. For PEEP, there's [28:53.270 --> 28:56.650] a TLS and SSL exchange, there's a server certificate that comes down [28:56.650 --> 29:00.870] so the vulnerability there, not our vulnerability, but the vulnerability [29:00.870 --> 29:04.970] that's happened historically, is that people don't validate that service certificate. [29:04.990 --> 29:08.570] And you can say, yeah, you guys, you're stupid, you didn't validate the service certificate. [29:08.570 --> 29:12.830] But actually certificates, you can't set a common name that matches a network. [29:12.830 --> 29:17.410] There is no field in a certificate that is matched on four Wi-Fi networks. [29:17.730 --> 29:20.830] So we get some advantage there. And then there's like weird [29:20.830 --> 29:24.550] ass prompts. Like OSX, I don't know, it's changing [29:24.550 --> 29:28.110] quite a lot. But different things give you just stupid prompts. Like if you try and connect [29:28.110 --> 29:32.370] to networks with different things. If you press the wrong thing once, like you're screwed. [29:33.030 --> 29:36.370] And then MSChat is weak. Moxie Marlinspike did his [29:36.370 --> 29:40.250] talk last year, 2013. They can go through the entire [29:40.250 --> 29:42.790] DES space using stuff like Cloudcrack. [29:43.970 --> 29:48.590] And what we've implemented, what Ian's implemented for this, you can plug whatever you want. [29:48.590 --> 29:52.150] At the moment we're using Asleep, but if you wanted to use Hashcat or Cloudcrack, you can. [29:52.970 --> 29:56.170] So essentially we're going to man-in-the-middle it. We send our own [29:56.170 --> 30:00.210] certificate. We capture the MSChat challenge response. [30:00.210 --> 30:03.950] We crack it. Once we get it, we add it back in the EAP file. [30:03.950 --> 30:05.310] And then people can connect. [30:13.960 --> 30:16.340] Right, so here's the same thing. [30:16.340 --> 30:19.580] I've got a couple of screens open over here. I've got my [30:19.580 --> 30:23.560] Android device, the actual device. I've got two. This one I'm actually just going to [30:23.560 --> 30:27.160] look at the EAP users file. This defines what users are [30:27.160 --> 30:30.920] allowed to connect to the EAP network. And this is just going to be the output [30:30.920 --> 30:35.020] from MANA. And I'm going to pause in various locations. [30:35.220 --> 30:39.160] So first what I go through, I just have a look at my WiFi networks. I've got that always [30:39.160 --> 30:43.060] on secure. If I have a look at the config, it's basically peep [30:43.060 --> 30:47.100] MSChat. Username is user. Password is [30:47.100 --> 30:51.140] password. It's unchanged, et cetera, et cetera. Just turning off WiFi [30:51.140 --> 30:54.100] so it will scan immediately to save some time. [30:54.660 --> 31:00.810] And now I am going to [31:00.810 --> 31:05.090] just tail the host APD [31:05.090 --> 31:08.470] EAP user. So these are just the default ones that come through. [31:08.470 --> 31:12.450] So those are the last couple of entries in that specific file. [31:12.510 --> 31:16.570] Just so that we can go through the stuff. So you can't really see it, but just to be clear, [31:16.570 --> 31:19.730] so that's a user of T and a password of 1234 [31:20.870 --> 31:21.830] test. [31:23.010 --> 31:25.750] Sorry, I don't know why it looks like that on the projector. [31:26.410 --> 31:31.610] How do I zoom out? So I'm going to let Dominic handle the zooming. I've got no idea. [31:32.770 --> 31:35.670] Okay, something started again over there. [31:35.670 --> 31:37.170] Let's just go here. [31:47.030 --> 31:50.530] Okay, and now I'm going to fire up a new config. [31:50.530 --> 31:53.190] I'm going to switch on my network. [31:54.550 --> 31:58.070] And it's starting up and I'm going to switch on my WiFi now. [32:00.090 --> 32:01.230] And what you should [32:01.230 --> 32:04.970] see is... okay, it's not on yet. [32:07.010 --> 32:08.770] It's turning on. [32:10.210 --> 32:13.990] So it's fairly difficult to read over here. [32:14.170 --> 32:17.330] But literally we've got each app, so username, user, [32:17.330 --> 32:21.090] challenge, the challenge and the response, which is actually just being [32:21.090 --> 32:24.670] added to a queue, we use a PyFo queue, with an external [32:24.670 --> 32:29.010] Python script. And the reason why I do this is just so that if you want to... [32:29.010 --> 32:32.730] I mean, I've got ideas at some point for building other stuff in terms of the thing. [32:32.730 --> 32:36.890] But if you want to go along and replace that with some cloud-based cracking [32:36.890 --> 32:40.930] service, it'll be ridiculously easy. You just read from the PyFo, you push it out, [32:40.930 --> 32:44.890] and you push the user's back. But literally adding the [32:44.890 --> 32:48.850] item to the PyFo, the Python script passes off to, in this case, [32:48.970 --> 32:52.910] a sleep buzz, using the second roughly wordless, obviously it's a ridiculous [32:52.910 --> 32:56.990] password, so it's cracked virtually immediately. And here we've already [32:56.990 --> 33:00.930] got credentials cracked. User is user, and password is [33:00.930 --> 33:04.730] password. And when we go along and carry on over here, [33:04.730 --> 33:08.790] it says save secured, and now it's actually going to come along and obtain [33:08.790 --> 33:13.830] an IP address and actually connect. So once again we've now got a [33:13.830 --> 33:16.630] hidden, protected network to actually go along and [33:16.630 --> 33:19.610] connect to our access point. [33:22.270 --> 33:24.690] Okay, so the promise here is creds from the [33:24.690 --> 33:28.650] sky. So at the very least you'll get a challenge that you can go chew on [33:28.650 --> 33:32.630] somewhere or send to Moxie's Cloud Crack or something like that. But if it's simple [33:32.630 --> 33:36.470] or you've got things set up nicely, you've got a nice targeted word list or something, then [33:36.470 --> 33:40.650] it'll crack and you get the advantage that you can then man in the middle of the people and hopefully get some other [33:40.650 --> 33:44.630] creds. Alright. [33:44.630 --> 33:48.650] So the point of all of this stuff is to get people to [33:48.650 --> 33:52.650] connect to us so that we can then man in the middle of them. Now, truthfully [33:52.650 --> 33:56.070] most of our work was in everything coming up to this point. [33:56.070 --> 34:01.350] The changes to the Karma stuff and integrating the EAP stuff. [34:01.350 --> 34:04.530] But it's kind of pointless if we stop there. It's like, okay, [34:04.530 --> 34:08.250] technically we get it, but we want to see some creds falling from the sky. [34:08.650 --> 34:12.510] So I'm going to half give you that promise, because we built a ton of things that just make [34:12.510 --> 34:15.690] kind of make the man-in-the-middle stuff work a little better. [34:16.110 --> 34:20.230] But we don't have particularly good demos of it, because it's really hard [34:20.230 --> 34:24.630] So we'd like to do a live demo of that. It's really hard to do that here. Naturally we're going to pick up [34:24.630 --> 34:28.670] something from someone and then we end up in legal trouble. [34:29.710 --> 34:32.330] So I apologize. So first off, we didn't do this. [34:33.210 --> 34:36.510] SSLSplit is an awesome tool. It's much... like if you're [34:36.510 --> 34:40.990] going to be man-in-the-middling lots of different protocols, use it. It's fantastic. [34:40.990 --> 34:45.590] There's a guy, his name also scares me, Daniel Rothlisberger. [34:46.050 --> 34:49.590] That's why there's a burger. I was very proud of that. [34:49.590 --> 34:50.490] You guys know. [34:52.310 --> 34:57.530] But that's, I mean really, we've just got a bunch of scripts which integrate intelligently so you get creds. [34:57.530 --> 35:00.850] And this actually leads to tons of creds. People, lots of [35:00.850 --> 35:04.410] well, the muggles, they leave their mail connecting over [35:04.810 --> 35:08.750] they're not validating certs, they're connecting to POP and IMAP without [35:08.750 --> 35:12.830] stuff, so you just get their passwords all the time. But not so muggly [35:12.830 --> 35:16.830] Microsoft and Apple, if you use ActiveSync with [35:16.830 --> 35:21.450] Apple's mail.app, that thing doesn't validate certs. I have no idea why. [35:21.690 --> 35:25.210] So that thing, you get tons of corporate creds. It's basic authorization [35:25.210 --> 35:28.150] so you've just got to pay 60 for it. [35:28.210 --> 35:33.390] So we haven't actually done anything. We're just using his tool once they're connected to us. We get that stuff. [35:33.390 --> 35:37.090] So it's cool. We start getting creds from the sky. This is fun. [35:37.790 --> 35:41.190] One of the things I really like doing is running this in places where there [35:41.190 --> 35:42.850] shouldn't be Wi-Fi networks. [35:45.010 --> 35:49.170] We'll leave it at that. Let's pretend we're down a mine, right? You're not necessarily going to have [35:49.250 --> 35:52.550] a network connection back up. But people leave their Wi-Fi on. [35:53.990 --> 35:56.790] So there's a version in the Mana toolkit called no upstream [35:57.670 --> 36:01.310] and that tries to fake part enough of the internet so that you can get some [36:01.310 --> 36:04.610] credentials from people. To do that, we have to [36:04.610 --> 36:08.570] trick devices into thinking that they're online. So particularly mobile devices [36:08.570 --> 36:12.950] they all do some check. They try and fetch a file on the internet and if they can get it, then they're online. [36:13.170 --> 36:16.690] Apple's the one that got a little tricksy with it. So as part of their [36:16.690 --> 36:20.290] captive network portal detection thing, they make [36:20.970 --> 36:24.810] typically two requests. They'll make one request with a user agent of captive network portal [36:24.810 --> 36:28.610] to one of over 200 different CNAMEs on a particular IP [36:28.610 --> 36:32.830] and then to a completely random URL on it. So we just built some simple [36:32.830 --> 36:36.210] Apache V hosts. Generally for this no upstream stuff, it's using Apache V hosts [36:37.010 --> 36:40.890] which handle all of that. So you can tell the device that it's up there. [36:41.070 --> 36:44.690] Plus, you can do really cool stuff. So I'll get on to the next slide. You can [36:44.690 --> 36:48.790] automatically push rogue CA certs or malicious IOS [36:48.790 --> 36:51.830] profiles as part of the captive network portal thing. [36:52.970 --> 36:56.810] Somebody connects to your network and this thing automatically pops up and if they don't know what they're doing [36:56.810 --> 37:00.470] and they click the wrong button and they type in their password, you can like fundamentally [37:00.470 --> 37:03.930] control their device in different ways. Or at least just add a rogue CA. [37:04.230 --> 37:08.510] The nice thing about the... okay wait, I'm jumping ahead. Anyway, so it's a small little thing but it leads to [37:08.510 --> 37:12.410] coolness. The other... this is a bit lame [37:12.410 --> 37:16.650] but it also leads to some coolness. You can have your own captive network portal up there. [37:16.650 --> 37:20.010] So they go to a site that you haven't implemented a thing for on your fake internet [37:20.010 --> 37:24.530] it pops up a captive portal thing and it says use OAuth and log in with your Google creds [37:24.530 --> 37:27.550] or Facebook or something and they type it in and you get those. [37:27.550 --> 37:30.990] Okay, nothing particularly interesting there but [37:30.990 --> 37:35.470] you know, you get some stuff. But what's interesting is if you can [37:35.470 --> 37:39.110] get an evil CA cert in their device [37:39.110 --> 37:42.570] because now your man in the middle stuff works much better. [37:43.010 --> 37:47.870] So it's not particularly new research but there's not a lot out there. [37:47.870 --> 37:51.010] It's really easy to do that actually. If you just serve [37:51.770 --> 37:56.190] a .cer file to either an iOS device or an Android device [37:56.770 --> 37:59.990] they will offer to add that to their [37:59.990 --> 38:03.610] root CA list. Just like that. [38:04.350 --> 38:08.270] I mean, can you imagine that if you went to a site like in your normal browser on your [38:08.270 --> 38:12.330] computer and it served you a .cer file, it would prompt you to add that [38:12.330 --> 38:16.110] to your root CAs. That would just be ridiculous. [38:16.150 --> 38:20.310] Everyone would rail about it. But mobile devices allow you to do that. Now granted, the user [38:20.310 --> 38:24.310] does have to type in their password. So on an iOS device [38:24.310 --> 38:28.070] you'll type in your password. On Android, you just have to give it a name [38:28.070 --> 38:32.230] and then click save. So there's some stuff but that's not a huge thing [38:32.230 --> 38:36.370] to get over. And if you get that right, then you've got a root CA in there. [38:36.370 --> 38:39.630] So now you can start man-in-the-middling all sorts of things. But [38:40.170 --> 38:44.030] you don't get to man-in-the-middle everything because [38:45.410 --> 38:48.230] HSTS is a real pain in the ass. So once again [38:48.230 --> 38:52.250] not our research. A guy named Leonardo presented Black Hat Asia this year [38:52.250 --> 38:56.150] 2014. And he came up with a nifty little bypass [38:56.150 --> 39:00.010] for HSTS. So HSTS is HTTP [39:00.010 --> 39:03.550] strict transport security. And what that means is [39:04.070 --> 39:08.790] a site can put a header which says, when you speak to me, speak to me via SSL. [39:08.790 --> 39:11.390] Your browser will remember that. So when you type something like [39:12.050 --> 39:15.930] gmail.com, it'll go directly to HTTPS gmail.com. Even if you type in [39:15.930 --> 39:20.130] HTTP gmail.com, it'll still go directly to HTTPS because it's [39:20.130 --> 39:24.170] remembered that this is an HSTS site and it should go to it. Now what that [39:24.170 --> 39:28.130] screws is Moxie's SSL strip. So SSL [39:28.130 --> 39:31.770] strip relies on people hitting HTTP sites first [39:31.770 --> 39:36.230] and then preventing it from ever upgrading to SSL. And HSTS is a direct [39:36.230 --> 39:40.130] response to that. So what Leonardo worked out is that [39:40.130 --> 39:44.110] some places still have to have HTTP jumps. [39:44.130 --> 39:48.230] So if you look at google.com. If you typed google.com, it serves it [39:48.230 --> 39:52.190] over HTTP and then redirects to HTTPS. The standard thing that [39:52.190 --> 39:56.210] SSL strip can deal with. Sorry, I always get SSL strip [39:56.210 --> 40:00.150] and split confused. But then within that page, if you click [40:00.150 --> 40:02.570] accounts.google and SSL [40:04.910 --> 40:08.190] strip will try and rewrite that to HTTP. When you actually [40:08.190 --> 40:12.230] make the request, that gets denied. It's only going to serve that stuff over HTTPS because it's [40:12.230 --> 40:16.190] got HSTS. So what Leonardo did is he made [40:16.190 --> 40:20.510] some mods to SSL strip to... when you go to google.com [40:20.510 --> 40:23.530] it actually redirects you to quadw.google.com [40:24.190 --> 40:28.030] which is a whole different domain. So there's no pre-saved HSTS [40:28.030 --> 40:32.190] stuff for it. And there he can do the normal SSL strip rewrites on it [40:32.190 --> 40:36.610] and instead of... so when you click sign in, instead of redirecting to accounts.google.com [40:36.610 --> 40:40.190] he'll redirect you to like webaccounts.google.com. Once again [40:40.190 --> 40:44.330] another domain, HSTS doesn't apply. Google seems to have pushed something down [40:44.330 --> 40:48.230] or at least came into effect last night, the first time I spotted it. They've actually now got it [40:48.230 --> 40:52.130] going over the domain. So we've made some mods that it actually appends the stuff [40:52.130 --> 40:56.510] on the end. So it won't take you to accounts.google.com, it'll take you to accounts.google.com.x [40:56.510 --> 40:59.890] Hold other domain, the HSTS doesn't apply. But it's really nifty [40:59.890 --> 41:04.010] for certain places. So it works for Facebook if you go to touch.facebook. It works for Twitter [41:04.010 --> 41:08.330] if you go to m.twitter.com. The reason you have to go to those is those are sites [41:08.330 --> 41:12.390] for which it doesn't have HSTS necessarily saved [41:12.390 --> 41:16.530] for that particular site. So then we start getting cookies and things that we can use [41:16.530 --> 41:20.590] there. Cookies, so creds [41:20.590 --> 41:24.190] are really useful. Cookies are also really useful because it gives us auth to sites. [41:24.370 --> 41:28.250] FireSheep was fantastic for this. A little Firefox browser extension. It would [41:28.250 --> 41:31.430] sniff stuff and you could then just click and log in on the site. [41:31.970 --> 41:34.570] It doesn't work anymore so we wrote FireLamb. [41:35.930 --> 41:40.310] So that's a lamb rye. So FireLamb, all it does is it's a [41:40.310 --> 41:44.210] Python script that will use a scapy, goes into monitor [41:44.210 --> 41:48.950] mode, looks for cookies, sticks into database, and then will generate Firefox profiles. [41:48.950 --> 41:52.050] So you can just say, okay, show me that guy there. It'll load up Firefox [41:52.050 --> 41:55.910] with all that guy's cookies and all the links that he visited. So you can just click on it. [41:55.910 --> 41:59.810] Much the same as FireSheep and go there. [42:00.310 --> 42:04.330] Okay, so we basically implemented all of this stuff in [42:04.890 --> 42:08.090] the Mana toolkit to deal with all of those things. [42:08.090 --> 42:12.030] I think we're pretty short of time so I'm not sure how many demos [42:12.030 --> 42:15.910] we can go through. How much time do we have? Okay, so we're going to [42:15.910 --> 42:19.890] try and go through some of them. These are a lot more manually demos. [42:20.730 --> 42:22.910] So they might not work as well. [42:32.910 --> 42:34.010] Thank you. [42:34.010 --> 42:38.470] Sorry, I just can't get the hang of this Apple. Apologies about that. [42:38.470 --> 42:41.930] Right, so if we have a look at a bunch of things. [42:43.710 --> 42:46.230] So this is using a malicious [42:46.230 --> 42:50.550] cert. Basically what we're doing is we're running it [42:50.550 --> 42:54.530] with no upstream, just to sort of try and get to a captive [42:54.530 --> 42:58.610] portal, which will then allow us to either socially engineer [42:58.610 --> 43:02.570] the user or alternatively provide him a link to sort of say automatically [43:02.570 --> 43:06.330] configure your stuff. Please pick here. You'll see we're connected to internet [43:06.330 --> 43:10.690] now and what we'll do is we'll go to foo.com [43:10.690 --> 43:14.750] or wherever and we'll end up with a... well, moo.com [43:16.230 --> 43:18.490] We'll end up with a captive portal [43:18.490 --> 43:19.790] page. [43:21.950 --> 43:26.510] There we go. If you scroll down right at the back we give him the option of [43:26.510 --> 43:30.330] logging in via Google or... [43:34.150 --> 43:36.250] Well, we give him the option of [43:36.250 --> 43:40.350] using some overall thing or signing in via Google creds or mail [43:40.350 --> 43:44.210] or Twitter or etc etc. But we also provide this nice [43:44.210 --> 43:49.190] little link sort of saying please auto-configure and it'll connect automatically. [43:49.350 --> 43:52.450] And if we auto-configure that then basically what happens [43:52.450 --> 43:55.830] we get prompted to install a specific root CA [43:56.550 --> 43:59.430] which has now been installed. [44:00.010 --> 44:04.570] There is an icon that comes up which you'll see right at the top left there. [44:05.470 --> 44:08.190] You drag down the bar it'll sort of say [44:08.190 --> 44:12.470] your communication may be subject [44:12.470 --> 44:15.990] interception which is fine, probably good practice. [44:19.450 --> 44:20.650] So I'm just waiting for [44:20.650 --> 44:24.630] the network to come up again. So yeah, here it says network may [44:24.630 --> 44:30.130] be monitored. But in any case now if I go to accounts.google.com [44:38.180 --> 44:39.680] Let's enter. [44:42.480 --> 44:43.240] We're actually [44:43.240 --> 44:47.460] going to get to... but it works one time, sorry. It's almost as slow [44:47.460 --> 44:51.100] as South African internet. But we're actually getting to Dominic's [44:51.100 --> 44:55.440] personal information over there. So we've actually had access [44:55.440 --> 44:59.360] to his Gmail account. And we're man in the middling [44:59.360 --> 45:03.140] so you're getting the full... Got the full clear text from SSL [45:03.140 --> 45:05.400] strip, etc, etc, etc. [45:07.240 --> 45:11.360] Right, other one which is... I'm going to skip FireLAM. [45:12.300 --> 45:15.020] So FireLAM is not working so well [45:15.020 --> 45:18.940] just yet. But basically FireLAM [45:18.940 --> 45:23.120] will extract the stuff from SCAPI and also from the files that we [45:23.120 --> 45:27.160] collect as the program is run. And you can literally go along and fire [45:27.160 --> 45:31.000] it up. And these are all the sites selected for a specific [45:31.700 --> 45:32.980] user. [45:39.060 --> 45:42.180] So this is literally just pulled out of the [45:42.180 --> 45:46.840] log files and pulled out of the network captures. [45:46.840 --> 45:50.420] And everyone of... every different device [45:50.420 --> 45:54.780] you can sort it by MAC address or IP address will literally build a [45:54.780 --> 45:58.740] different Firefox profile which includes the cookies for [45:58.740 --> 46:02.140] the specific thing. Now this was captured live, so I don't want to show [46:02.140 --> 46:05.740] the information that I'm doing here. I'm just changing it to the directory [46:05.740 --> 46:09.940] of someone who I've captured. Now I'm just going to do a count of the [46:11.380 --> 46:14.200] cookies SQLite database. You'll see there's [46:14.200 --> 46:17.820] just one cookie in that database. So that's [46:17.820 --> 46:22.260] the schema, that's the actual database schema, and that's the select count star [46:22.260 --> 46:26.320] from most cookies. And you'll see we'll get a result [46:26.320 --> 46:30.180] of one, which is just very poorly described over there. But in any case [46:30.180 --> 46:34.120] that's FireLamb. It's not working perfectly, but [46:34.120 --> 46:38.240] it does potentially work. I did some nasty stuff to Dominic this [46:38.240 --> 46:42.300] morning. Yeah, Ian announced to me [46:42.300 --> 46:45.740] that this stuff was working by posting as me on my Facebook wall saying [46:45.740 --> 46:50.240] Hey Dominic, this is Ian. The first person who liked it was his wife. [46:51.260 --> 46:54.240] Right, okay. So what's happening over here, because [46:54.240 --> 46:57.920] one thing we also see quite a bit is that the interception [46:57.920 --> 47:01.960] is, believe it or not, mail creds. Cleartext. There's so many [47:01.960 --> 47:06.020] people running the stuff over cleartext. Either this is man in the middle using [47:06.020 --> 47:09.500] SSL split. Right. And [47:09.500 --> 47:12.800] basically it's just a demo account of ours [47:13.660 --> 47:17.940] thrown away in the meantime, but literally we've got cleartext creds in the [47:19.260 --> 47:22.400] log files, etc, etc, etc. [47:22.400 --> 47:24.580] So it's very poor. [47:27.900 --> 47:28.700] Okay. [47:32.200 --> 47:36.480] I'll be around for a bit, so if anybody wants to see a live demo, I can just fire up [47:36.480 --> 47:39.400] my Linux machine and you can bother me there. It'll be a lot easier. [47:39.960 --> 47:44.360] So yeah, you couldn't see that particularly well, but one of the advantages of SSL split is [47:44.360 --> 47:47.960] you can get non-HTTP protocols, so you get lots of mail creds. [47:49.860 --> 47:52.480] So the big difference with fire lamb [47:52.480 --> 47:56.980] over something like fire sheep is it goes through the SSL interception stuff too. [47:56.980 --> 48:00.600] So the things that you SSL man in the middling, you get those cookies as well, not just cookies [48:00.600 --> 48:04.720] that you could passively monitor from stuff in monitor mode. [48:04.720 --> 48:08.600] But you also get that. And the other nice thing is that all of this man in the middle stuff [48:08.600 --> 48:12.040] can be run not in Wi-Fi. Like if you're trying to man in the middle [48:12.780 --> 48:16.620] on physical networks, all of these tools are reusable for there. So you could [48:16.620 --> 48:20.540] point fire lamb at x0 if you happen to be ARP spoofing on [48:20.900 --> 48:24.380] a LAN or something like that. So it's kind of assembling these [48:24.380 --> 48:27.920] things into something that's a little more usable. [48:28.680 --> 48:32.640] Alright, so that takes us to, like back to the promise. [48:32.640 --> 48:35.220] We were stuck in the desert. [48:35.940 --> 48:40.440] Karma stuff wasn't working so well. We didn't have support for secure networks and those [48:40.440 --> 48:44.700] credentials. You had to assemble your own man in the middle assemblage [48:44.700 --> 48:48.560] which didn't necessarily work so well. There's these new changes coming in from mobile [48:48.560 --> 48:51.320] devices which lead to things being a bit more complicated. [48:52.120 --> 48:56.480] We've taken all the research that others have done to try and deal with a lot of these problems [48:56.480 --> 48:59.980] we've assembled it into a package where you can just run a script and it'll work. [48:59.980 --> 49:04.800] We've done some of our own research to build some tools which deal with some of these problems. [49:04.800 --> 49:07.920] And we've put it together into this thing called the Mana Toolkit. [49:08.800 --> 49:12.380] It's on a GitHub repository at the moment. We're going to be releasing it tomorrow [49:12.380 --> 49:15.280] when we do this talk at DEF CON May. [49:15.280 --> 49:18.920] I'll have the demos working properly from Windows. [49:19.200 --> 49:24.080] But if you're looking for them, it'll be at github.com forward slash sensepost. [49:24.440 --> 49:27.000] We split it up so there's a bunch of repositories. [49:27.000 --> 49:31.440] If you just wanted FileM or something like that. But there's also a global repository. [49:31.440 --> 49:35.460] We'll put a blog entry up on sensepost.com. And then if you want a lot more [49:35.460 --> 49:39.300] technical detail about this stuff, on the DEF CON CD, the slides we've [49:39.300 --> 49:43.280] included there have much more detailed diagrams and technical information [49:44.160 --> 49:46.960] that works better if you're reading it. So that's us. [49:46.960 --> 49:48.620] Thank you very much for your time and patience.