1 00:00:00,740 --> 00:00:02,240 Hello everyone. 2 00:00:05,540 --> 00:00:07,100 Hi at the back. 3 00:00:07,360 --> 00:00:09,620 Alright, I'm going to do that awkward thing. 4 00:00:09,620 --> 00:00:12,340 How quiet does it get in here before I start talking? 5 00:00:13,040 --> 00:00:13,880 Yes. 6 00:00:14,300 --> 00:00:15,500 Do we have to look at people? 7 00:00:15,960 --> 00:00:17,320 Alright, okay. 8 00:00:17,600 --> 00:00:18,420 Hello. 9 00:00:18,660 --> 00:00:23,100 Today we are talking about rogue access point attacks. 10 00:00:23,480 --> 00:00:25,860 Improvements on the Karma toolkit. 11 00:00:25,860 --> 00:00:28,000 We built a toolkit called Mana. 12 00:00:30,000 --> 00:00:33,620 So just a quick disclaimer, I'm sure you've seen a hundred of these today. 13 00:00:34,720 --> 00:00:39,620 It's really difficult to demo this stuff without picking somebody up. 14 00:00:39,900 --> 00:00:42,460 So please turn off your Wi-Fi if you don't want to be part of it. 15 00:00:42,460 --> 00:00:45,480 We've reduced our transmit power, things like that. 16 00:00:45,820 --> 00:00:49,620 We're not trying to be malicious, but we can't demo the research otherwise. 17 00:00:50,060 --> 00:00:56,700 If you leave your Wi-Fi on and you stay here, we're going to take that as your consent that you're okay with stuff to continue. 18 00:00:56,700 --> 00:00:57,460 But it's not our intent. 19 00:00:57,460 --> 00:00:59,720 We're not going to be putting up people's passwords or anything like that. 20 00:00:59,720 --> 00:01:02,060 We're going to be targeting our devices. 21 00:01:02,060 --> 00:01:03,200 So just a quick disclaimer. 22 00:01:03,200 --> 00:01:07,700 If any of you are for law enforcement, please don't arrest us. 23 00:01:09,900 --> 00:01:10,700 Okay. 24 00:01:11,200 --> 00:01:13,180 Hi, I'm Dominic and this is Ian. 25 00:01:13,180 --> 00:01:14,700 We did this work. 26 00:01:14,740 --> 00:01:17,940 We work for a company in South Africa called SensePost. 27 00:01:18,880 --> 00:01:24,060 We're a pen testing firm and those are our contact details if you want them. 28 00:01:25,460 --> 00:01:26,140 Okay. 29 00:01:26,140 --> 00:01:31,220 So why are we looking at Wi-Fi in particular and rogue access point attacks? 30 00:01:31,220 --> 00:01:32,340 Those things are lame. 31 00:01:32,340 --> 00:01:35,120 Every pineapple has got Karma on it. 32 00:01:35,120 --> 00:01:36,760 We can run this stuff. 33 00:01:36,760 --> 00:01:37,380 Yeah, so what? 34 00:01:37,380 --> 00:01:38,080 Nothing new. 35 00:01:38,080 --> 00:01:39,800 Karma attacks 2004. 36 00:01:40,160 --> 00:01:42,260 This is old school. 37 00:01:42,600 --> 00:01:48,000 So Wi-Fi is at a point where it's like your skiddy's first day out. 38 00:01:48,000 --> 00:01:53,480 You want to get into hacking, you either pick up a pair of lockpicks or you pick up a pineapple and you start doing Wi-Fi stuff. 39 00:01:53,480 --> 00:01:56,380 And there's a couple of reasons for that. 40 00:01:56,380 --> 00:01:59,740 So the one is we all recognize that Wi-Fi is ubiquitous. 41 00:01:59,740 --> 00:02:01,560 We've got it just everywhere. 42 00:02:02,320 --> 00:02:04,300 Plus it gives us access to coolness. 43 00:02:04,300 --> 00:02:08,640 We've got all the cloud services that people are going to use. 44 00:02:08,940 --> 00:02:09,800 Should I? 45 00:02:09,880 --> 00:02:11,000 Do I need to like stare up here? 46 00:02:11,000 --> 00:02:11,460 Okay. 47 00:02:11,460 --> 00:02:14,040 We've got all the cloud services that you can get access to. 48 00:02:14,040 --> 00:02:15,380 It gives us lots of goods. 49 00:02:15,500 --> 00:02:18,080 It's not like you're just communicating with some local server. 50 00:02:18,080 --> 00:02:20,580 You're communicating with stuff that runs your life. 51 00:02:20,580 --> 00:02:26,200 And it means we can use 20-year-old Ethernet attacks because we're on the same local network. 52 00:02:26,200 --> 00:02:30,600 So we've got toolkits spanning decades that allow us to bring a taxi. 53 00:02:30,600 --> 00:02:32,660 I mean, ARP spoofing is still a thing. 54 00:02:33,320 --> 00:02:37,100 So Wi-Fi is a pretty exciting thing to go for. 55 00:02:37,100 --> 00:02:46,000 Except the attacks, like we haven't really seen anything new coming out from Rogue AP stuff really since Karma in 2009. 56 00:02:46,840 --> 00:02:51,200 So we've got these vulnerabilities at every layer of the Wi-Fi protocol. 57 00:02:51,200 --> 00:02:57,360 So we can spoof, trick devices into connecting to our malicious networks with Karma attacks. 58 00:02:57,360 --> 00:03:02,420 Dino Daizovi, Sean McCauley, 2009-2004, they presented that stuff. 59 00:03:02,800 --> 00:03:07,080 Once we get something to connect to it, we can crack the crates. 60 00:03:07,080 --> 00:03:10,360 If you can capture a handshake, you can crack WPA. 61 00:03:10,360 --> 00:03:17,860 If you capture MS-CHAP things, you can send that through a sleep or cloud cracker, and you can crack that stuff. 62 00:03:17,860 --> 00:03:20,220 Cool, so those two layers are handled. 63 00:03:20,220 --> 00:03:23,660 Once you're connected to the network, we can sniff everyone's passwords. 64 00:03:23,660 --> 00:03:26,280 Doug Song released DSniff back in 2000. 65 00:03:26,740 --> 00:03:35,560 Since then, we had Robert Graham release, I think it was at DefCon, Hamster and Ferret, does anyone remember Hamster and Ferret? 66 00:03:35,840 --> 00:03:38,700 In 2007, I think it was. 67 00:03:38,700 --> 00:03:42,060 Then we had Fire Sheep in 2010, which got everyone excited. 68 00:03:42,060 --> 00:03:46,260 It's all the same stuff, it's just new implementations of it. 69 00:03:47,900 --> 00:03:50,760 Once you connect to a network, we can capture all these creds. 70 00:03:51,720 --> 00:03:57,360 We've got these vulnerabilities at every layer of the network, and we should have creds falling from the sky. 71 00:03:57,660 --> 00:04:10,320 You should be able to be a pen tester where you can walk into a company and you'll just have passwords showing up, and then you can go home and log in remotely, and you've saved yourself a bunch of on-site work. 72 00:04:10,320 --> 00:04:13,260 But the truth is, that doesn't happen. 73 00:04:13,680 --> 00:04:22,360 You've played with your pineapple, you've done it, and you've got a few people who are still checking mail over pop, but you haven't really got much else. 74 00:04:22,560 --> 00:04:25,420 Because these tools don't work as well as they used to. 75 00:04:25,460 --> 00:04:31,320 So in 2004, when Karma was released, that stuff worked really well, but now Karma doesn't work so well. 76 00:04:31,320 --> 00:04:44,520 If you look at your average Android device, particularly the newer ones, if you look at the list of available networks, the networks that the Karma device is probing, responding from, don't show up. 77 00:04:44,520 --> 00:04:46,400 So it means it doesn't automatically connect to them. 78 00:04:46,400 --> 00:04:49,180 Your home network is not going to get automatically connected to you. 79 00:04:49,580 --> 00:04:54,160 iOS devices have dramatically reduced how much probing they do through a variety of things. 80 00:04:54,160 --> 00:04:55,880 I'll go into more detail on this stuff. 81 00:04:55,880 --> 00:04:58,740 But we end up in a state where the Karma attacks don't work so well. 82 00:04:58,900 --> 00:05:03,940 When it comes to the network-sniffing stuff, the stuff is old. 83 00:05:03,940 --> 00:05:06,380 Doug Song released that stuff in 2000. 84 00:05:06,380 --> 00:05:12,920 If any of you have run message-snarf recently, it's still looking for MSN messenger messages. 85 00:05:12,920 --> 00:05:16,000 You're not going to see that stuff going over your average network anymore. 86 00:05:16,840 --> 00:05:18,480 FireSheep was a flash in the pan. 87 00:05:18,480 --> 00:05:20,240 That stuff doesn't work anymore. 88 00:05:21,260 --> 00:05:23,500 Over the years, these tools have been written. 89 00:05:23,620 --> 00:05:24,940 They stopped working. 90 00:05:24,960 --> 00:05:36,060 So right now, the current state, we've got this promise of vulnerabilities at every level, where we should have creds falling from the sky, but actually we're crawling through the desert with a little bite to eat every now and again. 91 00:05:36,920 --> 00:05:39,620 So we put this toolkit together called M.A.N.N.A. 92 00:05:41,220 --> 00:05:42,880 Truthfully, we liked the idea of M.A.N.N.A. 93 00:05:42,880 --> 00:05:47,380 from heaven for the talk, so we tried to come up with a backronym that would be something cool. 94 00:05:47,380 --> 00:05:48,680 We can't come up with anything cool. 95 00:05:48,680 --> 00:05:49,940 At the moment, we're sitting with M.A.N.N. 96 00:05:49,940 --> 00:05:52,320 in the middle and Network Attack Toolkit. 97 00:05:53,160 --> 00:05:54,160 It's still stupid. 98 00:05:54,160 --> 00:05:56,080 So if you have a better backronym, please share that with us. 99 00:05:56,080 --> 00:05:57,360 We'd be really open to it. 100 00:05:57,820 --> 00:05:58,580 So the M.A.N.N.A. 101 00:05:58,580 --> 00:06:09,640 toolkit, we've built some stuff and we've combined a bunch of things together and it's, at the moment, a horrible mash of lots and lots of things but you can run a single command on Kali and it'll work. 102 00:06:09,640 --> 00:06:11,740 So it's a horrible mash that works. 103 00:06:11,740 --> 00:06:14,460 We hope to get it into a better state. 104 00:06:14,720 --> 00:06:18,300 Alright, I'm going to teach some of you to suck some RF eggs. 105 00:06:18,740 --> 00:06:23,000 Just a quick targeted Wi-Fi primer on stuff you need to understand this. 106 00:06:23,220 --> 00:06:24,640 So we're talking Wi-Fi. 107 00:06:24,640 --> 00:06:29,220 We're not talking 3G, Bluetooth, RFID, anything like that. 108 00:06:29,220 --> 00:06:33,320 We're talking 802.11 a, b, g, n, a, c. 109 00:06:34,560 --> 00:06:38,100 We're specifically, for the beginning part at least, looking at management packets. 110 00:06:38,100 --> 00:06:42,080 So some of you will know, in Wi-Fi, you've got control packets, data packets, and management packets. 111 00:06:42,180 --> 00:06:44,220 So control packets are the things that'll say... 112 00:06:45,000 --> 00:06:49,620 the device will say, hey AP, I want to send some data and AP will say, everyone shut up! 113 00:06:49,620 --> 00:06:50,800 And then it'll send some data. 114 00:06:50,800 --> 00:06:52,980 Those are request to sends and clear to sends. 115 00:06:53,200 --> 00:06:55,200 And then data packets are the actual data. 116 00:06:55,200 --> 00:07:01,780 And management packets have got probe requests, probe responses, and beacons, which are the ones we're most interested in. 117 00:07:01,820 --> 00:07:06,400 So every wireless network has beacons that come out constantly. 118 00:07:06,400 --> 00:07:09,780 It's how you get the timing on the network, know when to communicate. 119 00:07:10,000 --> 00:07:12,820 And they've got a bunch of information in it, like the SSID. 120 00:07:12,820 --> 00:07:17,060 If you hide your SSID, then the beacon won't have the SSID in it. 121 00:07:17,060 --> 00:07:24,880 And then probe requests and responses are how devices talk, figure out how to associate two networks and which networks are nearby. 122 00:07:25,380 --> 00:07:27,800 So this is a really simplistic diagram. 123 00:07:27,800 --> 00:07:42,340 But when you, on your average device, be it a laptop or a mobile device, when you click on the Wi-Fi thing and look at the networks nearby, what'll happen is your client will send out a broadcast probe request, and then all the nearby access points, we've only got one here, 124 00:07:42,340 --> 00:07:45,580 but all the nearby access points will respond with a probe response. 125 00:07:45,580 --> 00:07:48,080 If the network's hidden, then it won't respond. 126 00:07:48,080 --> 00:07:52,460 It'll only respond if you probe directly for that network, so you have to know the name beforehand. 127 00:07:52,760 --> 00:07:56,480 Okay, so I'm sorry if some of you know this, but it's necessary. 128 00:07:57,540 --> 00:08:02,520 Okay, once you decide to associate to a network, then this step happens. 129 00:08:02,620 --> 00:08:06,300 I've actually cut out a bit in the middle because nobody used shared key authentication. 130 00:08:07,080 --> 00:08:14,420 So once I've done my search and I've seen there's a DEFCON network nearby, I'll then click on the DEFCON network. 131 00:08:14,420 --> 00:08:21,780 My device will send another probe request, but now it's directed for the DEFCON network, get a probe response from the access points, and then it associates. 132 00:08:21,780 --> 00:08:23,560 Any of you familiar with the AirCrack suite? 133 00:08:23,560 --> 00:08:26,940 If you use AirReplay fake auth, this is exactly what fake auth does. 134 00:08:26,940 --> 00:08:30,500 When you get that association ID, you've hit this part here. 135 00:08:30,980 --> 00:08:32,480 So this is how stuff associates. 136 00:08:32,480 --> 00:08:34,220 Now, it's important to note that there's two things. 137 00:08:34,220 --> 00:08:37,300 There's finding networks, and there's associating to networks. 138 00:08:37,600 --> 00:08:40,880 Because current Karma attacks deal with this part only. 139 00:08:42,600 --> 00:08:44,560 Okay, so Karma attacks. 140 00:08:44,560 --> 00:08:46,120 Sean McCauley's at IOActive. 141 00:08:46,540 --> 00:08:48,180 I'm not sure what Dino is these days. 142 00:08:48,560 --> 00:08:50,840 He's either fun-employed or something. 143 00:08:51,780 --> 00:08:56,600 2004, I mentioned that they came up with this really cool stuff that if... 144 00:08:57,800 --> 00:08:58,520 I mean... 145 00:08:59,060 --> 00:09:00,840 Yeah, they came up with these Karma attacks. 146 00:09:01,280 --> 00:09:02,980 So I've got a... 147 00:09:02,980 --> 00:09:06,080 Do Americans play Marco Polo when you're kids? 148 00:09:06,080 --> 00:09:07,600 Oh, I don't want to be prescriptive. 149 00:09:07,600 --> 00:09:08,580 Some of you aren't Americans. 150 00:09:08,580 --> 00:09:10,220 So you guys know what Marco Polo is. 151 00:09:10,220 --> 00:09:12,400 Okay, so just in case, because I saw some people doing this. 152 00:09:12,400 --> 00:09:14,620 Marco Polo is a kid's game you play in the pool. 153 00:09:14,620 --> 00:09:15,740 Somebody closes their eyes. 154 00:09:15,740 --> 00:09:16,500 They're it. 155 00:09:16,700 --> 00:09:18,620 And then they have to shout out, Marco. 156 00:09:18,620 --> 00:09:20,160 And everyone around them shouts, Polo. 157 00:09:20,160 --> 00:09:23,680 And they have to acoustically figure out where you are and try and catch you. 158 00:09:23,840 --> 00:09:26,140 So Wi-Fi networks are a bit like this. 159 00:09:26,420 --> 00:09:30,460 My device, when it is looking for a nearby network, shouts out, Marco. 160 00:09:30,460 --> 00:09:33,040 And all the access points nearby say, Polo. 161 00:09:33,040 --> 00:09:35,180 And it knows where the access points are. 162 00:09:36,020 --> 00:09:38,620 And there's no authentication at this level. 163 00:09:38,620 --> 00:09:41,420 Because nobody uses shared-key authentication because it's got ROMs. 164 00:09:41,420 --> 00:09:49,560 So what happens is, if this is a legitimate access point over here, and I shout, Marco, and it goes, Hey, I'm Polo. 165 00:09:49,600 --> 00:09:54,580 Then you can have another access point over here say, Hey, I'm Polo too. 166 00:09:54,580 --> 00:09:57,820 And that's not even a vulnerability because this is how your corporate networks run. 167 00:09:57,820 --> 00:10:10,360 Like if you've got 500 access points spread across your campus, and they're all called Acme Corp Wi-Fi, you need to have lots of things that can respond to the same ESS ID, but they've got different BSS IDs. 168 00:10:10,360 --> 00:10:13,980 So calmer attacks take advantage of this. 169 00:10:14,560 --> 00:10:19,840 And in particular, what they rely on is the fact that devices have something called a PNL, a preferred network list. 170 00:10:19,840 --> 00:10:30,380 So when you add a Wi-Fi network and you click Remember Me or Save This Network, then typically what happened before is those devices will send directed probes out for those networks. 171 00:10:30,620 --> 00:10:31,640 Now, I'm not sure why. 172 00:10:31,640 --> 00:10:35,520 It was the stupidest design decision ever because it's led to a world of hurt since then. 173 00:10:35,540 --> 00:10:49,540 But if I've clicked on Save This Network, my home network, it's called HomeNet, when I come to a new area like DEF CON and I click Open Up My Wi-Fi, my device historically would probe for a network called HomeNet. 174 00:10:49,540 --> 00:10:54,560 It wouldn't send out a broadcast, wait to see if something called HomeNet exists, and then connect to it. 175 00:10:54,560 --> 00:10:55,760 It would just probe. 176 00:10:55,840 --> 00:10:57,340 And there's all sorts of different reasons. 177 00:10:57,340 --> 00:11:00,460 So like historically, that's just how they built it on computers. 178 00:11:00,600 --> 00:11:09,920 Recently we found out in Android that actually the problem is when it gets offloaded for low power mode, there's a separate subsystem which deals with that, which is sending out the probes. 179 00:11:10,280 --> 00:11:12,900 So there's all sorts of different reasons as to why it's doing it. 180 00:11:12,900 --> 00:11:14,400 But the truth is it does it. 181 00:11:14,420 --> 00:11:17,960 If some of you have seen some of our other research, we built something called Snoopy. 182 00:11:18,220 --> 00:11:20,520 The guy is actually presenting just after us. 183 00:11:20,860 --> 00:11:24,360 All this does is it looks at the probes that your devices are sending out. 184 00:11:24,360 --> 00:11:25,820 It geolocates it. 185 00:11:25,820 --> 00:11:28,260 And then it can try and track where you've been. 186 00:11:28,260 --> 00:11:36,540 So if one of your devices is probing for a network that only exists in Saudi Arabia and a network that only exists in the United States, we can start getting an idea. 187 00:11:36,540 --> 00:11:37,620 So it's really lame, right? 188 00:11:37,620 --> 00:11:41,080 The single little probe request was leaking all this stuff out. 189 00:11:41,620 --> 00:11:43,740 And so that's how CalmAttacks worked. 190 00:11:43,740 --> 00:11:50,080 It responded to these directed probes and then you could get somebody to connect to your network. 191 00:11:51,640 --> 00:11:53,700 There was supposed to be an animation there. 192 00:11:55,340 --> 00:11:56,700 Okay, well let's... 193 00:11:57,340 --> 00:12:01,960 Okay, so recently two guys built newer versions of it. 194 00:12:01,960 --> 00:12:06,760 So the pale guy is DigiNinja, or Robin Wood. 195 00:12:06,760 --> 00:12:11,580 And he built the version of HostAPD that implements Canva that's on the Pineapple. 196 00:12:11,900 --> 00:12:15,880 The guy on the right is Thomas, if anyone can pronounce his surname. 197 00:12:15,880 --> 00:12:16,720 Anyone here? 198 00:12:17,360 --> 00:12:18,480 Jotrep. 199 00:12:18,640 --> 00:12:21,280 The guy who built the Aircrack suite. 200 00:12:21,280 --> 00:12:24,200 I'm really sorry for not being able to pronounce his surname. 201 00:12:24,200 --> 00:12:25,940 Awesome, they both did great work. 202 00:12:25,940 --> 00:12:27,960 And they've built modern versions of Canva. 203 00:12:27,960 --> 00:12:31,780 So if you run AirbaseNG, you can have Canva implemented in software. 204 00:12:31,860 --> 00:12:36,180 Or if you're running the Pineapple, you're using HostAPD written by Robin. 205 00:12:36,920 --> 00:12:40,800 Okay, but Canva doesn't work so well anymore, as I mentioned before. 206 00:12:41,200 --> 00:12:42,200 It doesn't... 207 00:12:42,200 --> 00:12:51,260 Your PNL list, when you're looking for networks, those networks don't show up. 208 00:12:51,260 --> 00:12:54,620 Canva is only going to respond when you send a directed probe. 209 00:12:55,280 --> 00:13:00,960 So the most obvious change here is let's get Canva to respond to broadcasts. 210 00:13:01,740 --> 00:13:04,900 And that's one of the first things that we implemented in Mana. 211 00:13:04,900 --> 00:13:12,040 So we took HostAPD and we ported it to HostAPD 2.2 because the Pineapple is still running version 1. 212 00:13:12,660 --> 00:13:18,780 And we've got a hash that we just look at all of the probe requests that we've received. 213 00:13:18,780 --> 00:13:22,400 And we build up a view of the PNL of the individual devices. 214 00:13:22,520 --> 00:13:29,940 So now when one of your devices sends out a broadcast probe request, we can respond with broadcast probe responses. 215 00:13:30,640 --> 00:13:41,420 So you should see when we do our demo just now, if you're up for it, networks that your device is probing for would show up as available networks on your phone or whatever you've got. 216 00:13:41,840 --> 00:13:45,100 Now, that implies some interesting stuff. 217 00:13:45,100 --> 00:13:49,340 For the longest time I thought, well, and actually there was an implementation thing on iOS. 218 00:13:49,340 --> 00:13:59,280 If you ever, with old iOS, I think like iOS 6, ran comma attacks, you would have noticed, you'd see like the network name changing and then the UI would get all screwed up. 219 00:13:59,940 --> 00:14:04,980 So I was convinced that you needed to change the BSSID, like have a different BSSID for things. 220 00:14:05,360 --> 00:14:06,700 It turns out none of that's true. 221 00:14:06,700 --> 00:14:09,500 Ian pointed it out to me. 222 00:14:09,500 --> 00:14:10,580 He figured it out. 223 00:14:10,580 --> 00:14:17,800 We can send multiple probe responses from the same BSSID and all devices respect that. 224 00:14:17,800 --> 00:14:18,240 That's fine. 225 00:14:18,240 --> 00:14:19,940 It will show up as different networks. 226 00:14:20,900 --> 00:14:23,980 So that was the one finding which allowed us to handle Discovery better. 227 00:14:23,980 --> 00:14:24,640 It's implemented. 228 00:14:24,640 --> 00:14:25,820 It's working really well. 229 00:14:25,820 --> 00:14:27,880 I'm going to hand over to Ian now to do a demo. 230 00:14:29,280 --> 00:14:33,200 Unfortunately, we didn't sacrifice enough chickens to the demo gods. 231 00:14:33,440 --> 00:14:36,320 So his thing is not displaying up there. 232 00:14:36,320 --> 00:14:37,480 So we've got an iPhone. 233 00:14:37,480 --> 00:14:38,980 The Android thing I don't think is going to work. 234 00:14:38,980 --> 00:14:41,200 We've got some video backups just in case. 235 00:14:42,680 --> 00:14:43,840 Right, great, everyone. 236 00:14:43,840 --> 00:14:45,740 Before I carry on, I just want to make one thing. 237 00:14:45,740 --> 00:14:49,020 This is a note I've got stuck on my wall in the office. 238 00:14:49,220 --> 00:14:52,940 I've been battling with HostAPD probably for the last couple of months. 239 00:14:53,020 --> 00:14:56,220 I've had sleepless nights about it, including last night. 240 00:14:56,320 --> 00:15:01,760 And so there's probably a lot of very bad code inside that... 241 00:15:01,760 --> 00:15:03,220 Sorry, can you hear me? 242 00:15:03,220 --> 00:15:06,500 Is that better? 243 00:15:09,220 --> 00:15:15,760 Okay, as I was saying, I've been battling with the code in HostAPD for a couple of months. 244 00:15:15,760 --> 00:15:19,700 I've had sleepless nights, including last night. 245 00:15:20,680 --> 00:15:22,800 No, that's not an amplifier, is it not? 246 00:15:22,800 --> 00:15:24,060 Okay, apologies. 247 00:15:24,060 --> 00:15:25,340 I'll speak louder. 248 00:15:25,460 --> 00:15:34,180 But in any case, this was a sticker I had up on my office wall, just to remind myself that I'm rather annoyed with the way things work. 249 00:15:34,540 --> 00:15:38,420 In any case, we had a couple of demo-god things. 250 00:15:38,420 --> 00:15:41,900 As normal, Linux and projectors just don't want to work. 251 00:15:41,960 --> 00:15:46,360 I'm going to have to try and present off an Apple laptop. 252 00:15:46,360 --> 00:15:49,960 The key bindings are all funny, so apologies about this. 253 00:15:49,960 --> 00:15:54,040 We're going to plug in an iPhone now, and I am going to... 254 00:16:21,260 --> 00:16:26,080 Okay, so iPhone, it's looking at nearby Wi-Fi networks. 255 00:16:27,240 --> 00:16:29,080 Somebody's running Pineapple. 256 00:16:29,920 --> 00:16:32,120 Get better offset, whoever you are. 257 00:16:32,560 --> 00:16:41,220 I've now fired up Karma, and what we should see is we should start seeing networks we've connected to before start showing up as open. 258 00:16:41,520 --> 00:16:43,020 Go right to the top, Dominic. 259 00:16:43,020 --> 00:16:44,700 I haven't connected to anything. 260 00:16:46,680 --> 00:16:51,720 There are a hell of a lot of networks currently being shown all over the place here. 261 00:16:59,160 --> 00:17:01,800 There's also a lot of traffic, which is... 262 00:17:03,560 --> 00:17:10,420 There's also a lot of traffic which is interfering with things, so I'm going to just switch to a demo here. 263 00:17:10,420 --> 00:17:12,980 Okay, you've got to switch that way. 264 00:17:13,380 --> 00:17:15,040 We hope for a live demo. 265 00:17:15,040 --> 00:17:16,140 It's not working. 266 00:17:16,240 --> 00:17:18,500 I'll try again a little later. 267 00:17:18,500 --> 00:17:22,720 I think you've just gone on to password. 268 00:17:59,350 --> 00:18:08,470 Right, so over here, what we have actually got is actually a... this is my phone. 269 00:18:08,470 --> 00:18:17,370 And I'm starting up Karma over here, and you'll see I've got a bunch of networks which I previously connected to at other places. 270 00:18:17,510 --> 00:18:29,830 And what we'll see happening is as I start Karma, we're literally going to come along and different networks are actually going to start showing as available. 271 00:18:29,830 --> 00:18:35,670 As we sort of see, for every broadcast I send, I'm getting responses here. 272 00:18:35,670 --> 00:18:38,270 I'm getting a response for food. 273 00:18:38,270 --> 00:18:39,830 I'm getting a response for... 274 00:18:41,670 --> 00:18:42,670 one of these. 275 00:18:42,670 --> 00:18:43,490 I can't read it. 276 00:18:43,490 --> 00:18:52,290 It's a little bit... but there's a bunch of different networks which are all of a sudden starting to come up and responding to my specific device. 277 00:18:52,290 --> 00:19:01,090 So what's happened over here right now is the phone is actually just connected to internet, an open network I previously connected to. 278 00:19:01,090 --> 00:19:06,710 Simply from various probes, my phone was actually making. 279 00:19:07,510 --> 00:19:09,150 Sorry, it's connected to Foo. 280 00:19:09,150 --> 00:19:10,530 Apologies about that. 281 00:19:10,530 --> 00:19:11,870 So it's connected to Foo. 282 00:19:11,870 --> 00:19:13,150 No complaints. 283 00:19:13,150 --> 00:19:15,690 Android device didn't complain at all. 284 00:19:15,690 --> 00:19:21,030 And all of a sudden we're now on the... we've connected to that specific network. 285 00:19:23,230 --> 00:19:39,370 Okay, so it's a standard Karma demo, but what's relevant about that stuff is if you look at modern Android, so 4.4, things like that, networks which are on your PNL with current Karma don't show up as available. 286 00:19:39,610 --> 00:19:42,490 Because now we're responding to the broadcast, it shows up as available. 287 00:19:42,490 --> 00:19:46,510 And the big thing there is that you'll get stuff automatically connecting to you. 288 00:19:46,510 --> 00:19:51,370 So if it's sitting in someone's pocket and it's configured to auto pull mail, you now get that stuff connecting. 289 00:19:51,370 --> 00:19:54,890 Whereas before they had to explicitly click on the network. 290 00:19:55,210 --> 00:19:57,930 It makes a big difference in a bunch of different scenarios. 291 00:19:57,930 --> 00:20:00,110 You get a higher connection rate. 292 00:20:00,110 --> 00:20:07,690 So now the problem... the next problem we ran into is that Apple devices have radically reduced the amount of probing they do. 293 00:20:07,890 --> 00:20:16,010 So they've gotten savvy and they don't probe for public networks, or open networks, sorry, not public networks, in their PNL. 294 00:20:16,010 --> 00:20:18,710 They wait to see a broadcast response from it. 295 00:20:18,710 --> 00:20:24,130 But while investigating this stuff we noticed that Apple devices weren't even probing for hidden networks. 296 00:20:24,170 --> 00:20:32,370 Now if you remember the description about hidden networks, you have to probe for that exact network with that network name for the thing to respond and for you to be able to associate. 297 00:20:32,570 --> 00:20:41,230 So what typically happens with other devices is that if you have a hidden network in your PNL, everywhere you go this thing is spamming out directed probes for that. 298 00:20:41,270 --> 00:20:43,390 But with Apple devices they weren't. 299 00:20:43,530 --> 00:20:44,510 So like, well this is impossible. 300 00:20:44,510 --> 00:20:45,790 How does it connect to a network? 301 00:20:45,790 --> 00:20:49,230 We record it connecting to the network, fine, it would send out probes. 302 00:20:49,610 --> 00:20:59,030 After a bunch of time trying to construct ridiculous Faraday cages which didn't work, I managed to figure out that Apple devices need to see at least one hidden network. 303 00:20:59,150 --> 00:21:03,970 Then they will disgorge all of their networks on the PNL which are hidden. 304 00:21:04,090 --> 00:21:08,850 So if you're not seeing probes from Apple devices bring up a hidden network, it doesn't have to be a real network. 305 00:21:08,850 --> 00:21:11,930 It can be on your MiFi device, it can be something here. 306 00:21:11,930 --> 00:21:14,130 We've got an example configuration here that you can use. 307 00:21:14,130 --> 00:21:15,810 Just at least one nearby. 308 00:21:15,810 --> 00:21:17,050 Doesn't matter what it looks like. 309 00:21:17,050 --> 00:21:18,590 It'll start probing for those. 310 00:21:21,190 --> 00:21:28,010 But there's... oh, and interestingly, so the hypothesis is not that Apple did this for privacy reasons, but to try and get everyone to use iBeacon. 311 00:21:28,010 --> 00:21:33,670 They were sick of the fact that retailers and ad trackers are using Wi-Fi probes to start tracking people. 312 00:21:33,670 --> 00:21:35,850 They want them to use iBeacon to track people. 313 00:21:35,850 --> 00:21:38,310 So they started fixing this stuff up, supposedly. 314 00:21:38,330 --> 00:21:42,650 There's also claims that iOS 8 is going to use random MAC addresses for their probing. 315 00:21:43,350 --> 00:21:49,650 I've got iOS 8, I haven't seen it do any randomized MAC probes yet, so I think that's just a threat at this point in time. 316 00:21:50,350 --> 00:21:53,790 So it was then presented an interesting challenge to us. 317 00:21:53,790 --> 00:21:59,450 How do we get iOS devices which aren't probing for open networks to connect to that stuff? 318 00:21:59,710 --> 00:22:01,870 So we implemented something called loud mode. 319 00:22:01,870 --> 00:22:06,930 So right now, when this stuff's running, you'll see networks for your device. 320 00:22:06,930 --> 00:22:14,570 So if your device is probing for foo and your device is probing for bar, you'll each see foo and bar, but you won't see bar and you won't see foo. 321 00:22:14,570 --> 00:22:16,430 It's individual to your device. 322 00:22:16,490 --> 00:22:18,190 Loud mode just takes that away. 323 00:22:18,190 --> 00:22:19,930 You start seeing everyone's device. 324 00:22:19,930 --> 00:22:21,310 But it lives up to its name. 325 00:22:21,310 --> 00:22:25,790 In a busy place like this, you'll start seeing hundreds of networks showing up. 326 00:22:25,950 --> 00:22:30,910 And it also leads to interesting undefined behavior in really busy environments. 327 00:22:31,570 --> 00:22:39,950 My VM spontaneously rebooted at some point while I was testing this stuff last night, because the list gets bigger over time. 328 00:22:39,950 --> 00:22:45,810 And eventually it's just spamming out hundreds of networks, broadcast responses in response to one thing. 329 00:22:45,810 --> 00:22:50,070 But the advantage is the ramp-up in getting things connected is really good. 330 00:22:50,310 --> 00:22:54,650 And what we're relying on there is the fact that laptops have had none of this stuff. 331 00:22:54,650 --> 00:23:01,710 So Windows machines, Apple, OS X devices, Linux devices, all happily probe for their remembered networks. 332 00:23:01,710 --> 00:23:04,570 Mobile devices, they're limiting the stuff, but not these. 333 00:23:04,570 --> 00:23:11,550 So if you've got two devices with you, one your laptop and one your phone, then we're gonna get the probe and it should get to it. 334 00:23:11,550 --> 00:23:18,610 If two of you work at the same company and one of you's got a promiscuous device and the other doesn't, then it's gonna connect. 335 00:23:18,610 --> 00:23:26,350 If two of you have been to the same airport, if two of you are from the same country and have a similar thing, we just rely on the fact there's gonna be some commonality somewhere. 336 00:23:26,630 --> 00:23:27,910 And it works pretty well. 337 00:23:27,910 --> 00:23:31,490 We end up getting a higher rate of connections. 338 00:23:31,690 --> 00:23:35,610 But once it ramps up, you get a lot more connections. 339 00:23:45,330 --> 00:23:47,130 Sorry, Apple, I really... 340 00:23:49,310 --> 00:23:50,970 You've gone into a corner. 341 00:23:50,970 --> 00:23:52,370 Okay, thank you. 342 00:23:52,370 --> 00:23:55,950 Apologies, I used to work on an Apple years ago. 343 00:23:55,950 --> 00:23:59,430 I don't really... gone into a corner again. 344 00:23:59,870 --> 00:24:00,910 Apologies. 345 00:24:01,570 --> 00:24:03,790 It's fine, I think I'll manage. 346 00:24:04,130 --> 00:24:06,710 So, okay, comma two. 347 00:24:07,510 --> 00:24:12,550 Right, so here what we've got is we've got the same thing happening. 348 00:24:12,550 --> 00:24:15,250 You see there's a whole bunch of responses coming in here. 349 00:24:15,410 --> 00:24:20,810 And we've only got a couple of networks open on the right. 350 00:24:21,630 --> 00:24:25,850 But as soon as this starts building up, you'll see that list is going to get bigger and bigger. 351 00:24:25,850 --> 00:24:27,850 Apologies, this is just me connecting. 352 00:24:27,850 --> 00:24:33,890 What's nice about this is if you connect to a network that isn't there, it'll connect automatically. 353 00:24:34,210 --> 00:24:35,130 Wrong video. 354 00:24:35,130 --> 00:24:38,310 Sorry, so I mean that network is a brand new network. 355 00:24:38,310 --> 00:24:40,090 It just works perfectly. 356 00:24:40,170 --> 00:24:41,610 It's comma three then. 357 00:24:43,810 --> 00:24:45,130 Comma loud. 358 00:24:45,430 --> 00:24:48,230 Okay, so what we've got over here, we've got the same thing. 359 00:24:48,230 --> 00:24:51,970 We've got a couple of networks open. 360 00:24:52,170 --> 00:24:55,910 What I've done is I've just edited the config file. 361 00:24:55,910 --> 00:24:57,350 I've enabled loud mode. 362 00:24:57,350 --> 00:25:10,890 And what we'll see here when I switch Wi-Fi on is we're going to see that it's connecting to MANA, but at some point we're going to get a couple of networks coming up over here. 363 00:25:10,890 --> 00:25:14,390 So there's someone TGUNJCDM etc etc. 364 00:25:14,390 --> 00:25:17,610 When we scan we're going to see that coming up over there. 365 00:25:17,610 --> 00:25:20,450 That's not a network my device is probing for. 366 00:25:20,450 --> 00:25:23,670 That's a network that some other device has been looking for. 367 00:25:23,670 --> 00:25:30,870 But now because we've enabled loud mode, it's broadcasting it every time it receives any type of request. 368 00:25:30,870 --> 00:25:32,610 So that literally just increases the stuff. 369 00:25:32,610 --> 00:25:42,490 And as we give it a bit more time, you're going to see this list is going to grow and grow and grow as it picks up more and more networks responded to by other devices. 370 00:25:42,590 --> 00:25:43,910 So here we've got Yankees. 371 00:25:43,910 --> 00:25:46,590 Yankees rule was recorded last night. 372 00:25:46,590 --> 00:25:54,710 And it's going to carry on growing and growing until it actually ends up with quite a sizable list of devices. 373 00:25:57,450 --> 00:25:58,010 So... 374 00:25:59,810 --> 00:26:02,230 Ashton Wireless etc etc. 375 00:26:02,230 --> 00:26:03,910 The list just grows and grows. 376 00:26:03,910 --> 00:26:05,510 But in any case, that's loud mode. 377 00:26:05,510 --> 00:26:10,610 It does significantly increase the number of connections you're going to get in. 378 00:26:10,610 --> 00:26:12,170 And I'll hand over to Dominic. 379 00:26:12,170 --> 00:26:12,770 Thanks. 380 00:26:15,290 --> 00:26:18,630 I'm looking at it now and I'm like, oh man, that's really trivial. 381 00:26:18,790 --> 00:26:22,490 But I can't underestimate how much work it was to get this implemented in HostAPD. 382 00:26:22,490 --> 00:26:25,970 It's like this low level C that interacts with drivers and it doesn't have any comments. 383 00:26:25,970 --> 00:26:27,130 There are no comments. 384 00:26:27,130 --> 00:26:29,510 There's one comment every now and again. 385 00:26:29,510 --> 00:26:30,650 I'm not sure why. 386 00:26:30,930 --> 00:26:33,650 You have to put debugging statements everywhere. 387 00:26:33,650 --> 00:26:37,610 At some point Ian was in GDB just trying to figure out what the hell was going on. 388 00:26:39,530 --> 00:26:43,190 Okay, so the next is secure networks. 389 00:26:43,250 --> 00:26:45,370 Karma attacks don't handle secure networks at all. 390 00:26:45,370 --> 00:26:47,330 They need to be open networks. 391 00:26:47,330 --> 00:26:52,210 Now, we confess we haven't come up with any new ways of pwning secure networks. 392 00:26:52,210 --> 00:26:54,950 But we have integrated some stuff in here. 393 00:26:55,750 --> 00:27:03,630 So just to be clear WEP, WPA, EAP networks or Ada2 1x this is what we mean by secure networks. 394 00:27:03,670 --> 00:27:09,110 Right now your options for going over those are to use Freeradius WPE. 395 00:27:09,330 --> 00:27:12,710 I think that was 2008. 396 00:27:13,710 --> 00:27:17,190 So it's Joshua Wright and Brad Antonovich. 397 00:27:17,250 --> 00:27:18,730 I'm sorry if I've ruined his surname. 398 00:27:18,730 --> 00:27:19,990 I think that's the right one. 399 00:27:19,990 --> 00:27:21,750 So they wrote Freeradius WPE. 400 00:27:21,750 --> 00:27:25,630 It's a radius server that would dump the MSChap hashes. 401 00:27:25,630 --> 00:27:29,890 You can then send it to Joshua Wright's asleep or these days hashcat and things. 402 00:27:30,510 --> 00:27:33,110 You crack it and you get crates. 403 00:27:34,670 --> 00:27:40,490 So what's quite nice about HostAPD let me go... 404 00:27:41,010 --> 00:27:44,610 HostAPD has got an EAP server built into it. 405 00:27:44,610 --> 00:27:51,610 So we can modify HostAPD's EAP server and actually Brad Antonovich started doing this a couple of years ago and then he just kind of left it. 406 00:27:51,610 --> 00:27:56,730 So Ian took Brad's patches he brought them up to date for HostAPD 2.2, merged them in. 407 00:27:56,730 --> 00:27:59,030 So now the EAP stuff is integrated. 408 00:27:59,030 --> 00:28:05,710 So this version of HostAPD does all the new comma stuff, plus it gives you an updated version of Freeradius. 409 00:28:05,870 --> 00:28:09,290 So we're not using Freeradius, we're using the HostAPD's radius. 410 00:28:09,290 --> 00:28:10,390 But it's all integrated. 411 00:28:10,430 --> 00:28:17,610 Cool, so now we've got it integrated, why must we send this off to another process and then edit configuration files and bring this stuff up again? 412 00:28:17,610 --> 00:28:19,010 We can do that automatically. 413 00:28:19,070 --> 00:28:25,250 If somebody tries to associate to an EAP network then we can record that hash, try and crack it. 414 00:28:25,250 --> 00:28:31,510 If it's easy enough to crack, we can put it in the config file and if they try and connect again, they'll connect. 415 00:28:31,650 --> 00:28:34,770 So we've got a higher potential of now getting people to connect. 416 00:28:34,770 --> 00:28:40,690 Particularly in corporate environments, because people are more likely to be running 802.1X in corporate environments. 417 00:28:41,150 --> 00:28:45,810 So just to give you an idea of how that works, this was my attempt to draw a simple PEEP diagram. 418 00:28:46,050 --> 00:28:48,730 It's actually a little more... I have to remove some things here. 419 00:28:48,870 --> 00:28:51,490 But there's two things happening. 420 00:28:51,490 --> 00:29:04,970 For PEEP, there's a TLS and SSL exchange, there's a server certificate that comes down so the vulnerability there, not our vulnerability, but the vulnerability that's happened historically, is that people don't validate that service certificate. 421 00:29:04,990 --> 00:29:08,570 And you can say, yeah, you guys, you're stupid, you didn't validate the service certificate. 422 00:29:08,570 --> 00:29:12,830 But actually certificates, you can't set a common name that matches a network. 423 00:29:12,830 --> 00:29:17,410 There is no field in a certificate that is matched on four Wi-Fi networks. 424 00:29:17,730 --> 00:29:19,750 So we get some advantage there. 425 00:29:19,750 --> 00:29:21,990 And then there's like weird ass prompts. 426 00:29:21,990 --> 00:29:25,210 Like OSX, I don't know, it's changing quite a lot. 427 00:29:25,210 --> 00:29:27,210 But different things give you just stupid prompts. 428 00:29:27,210 --> 00:29:29,830 Like if you try and connect to networks with different things. 429 00:29:29,830 --> 00:29:32,370 If you press the wrong thing once, like you're screwed. 430 00:29:33,030 --> 00:29:35,070 And then MSChat is weak. 431 00:29:35,070 --> 00:29:38,170 Moxie Marlinspike did his talk last year, 2013. 432 00:29:38,790 --> 00:29:42,790 They can go through the entire DES space using stuff like Cloudcrack. 433 00:29:43,970 --> 00:29:48,590 And what we've implemented, what Ian's implemented for this, you can plug whatever you want. 434 00:29:48,590 --> 00:29:52,150 At the moment we're using Asleep, but if you wanted to use Hashcat or Cloudcrack, you can. 435 00:29:52,970 --> 00:29:55,090 So essentially we're going to man-in-the-middle it. 436 00:29:55,090 --> 00:29:56,850 We send our own certificate. 437 00:29:56,850 --> 00:30:00,210 We capture the MSChat challenge response. 438 00:30:00,210 --> 00:30:00,950 We crack it. 439 00:30:00,950 --> 00:30:03,950 Once we get it, we add it back in the EAP file. 440 00:30:03,950 --> 00:30:05,310 And then people can connect. 441 00:30:13,960 --> 00:30:16,340 Right, so here's the same thing. 442 00:30:16,340 --> 00:30:19,020 I've got a couple of screens open over here. 443 00:30:19,020 --> 00:30:21,900 I've got my Android device, the actual device. 444 00:30:22,060 --> 00:30:22,560 I've got two. 445 00:30:22,560 --> 00:30:25,660 This one I'm actually just going to look at the EAP users file. 446 00:30:25,660 --> 00:30:29,380 This defines what users are allowed to connect to the EAP network. 447 00:30:29,540 --> 00:30:32,900 And this is just going to be the output from MANA. 448 00:30:32,900 --> 00:30:35,020 And I'm going to pause in various locations. 449 00:30:35,220 --> 00:30:38,440 So first what I go through, I just have a look at my WiFi networks. 450 00:30:38,440 --> 00:30:40,300 I've got that always on secure. 451 00:30:40,580 --> 00:30:44,140 If I have a look at the config, it's basically peep MSChat. 452 00:30:44,260 --> 00:30:45,980 Username is user. 453 00:30:46,380 --> 00:30:48,020 Password is password. 454 00:30:48,020 --> 00:30:50,060 It's unchanged, et cetera, et cetera. 455 00:30:50,100 --> 00:30:54,100 Just turning off WiFi so it will scan immediately to save some time. 456 00:30:54,660 --> 00:31:05,970 And now I am going to just tail the host APD EAP user. 457 00:31:05,970 --> 00:31:08,470 So these are just the default ones that come through. 458 00:31:08,470 --> 00:31:12,450 So those are the last couple of entries in that specific file. 459 00:31:12,510 --> 00:31:14,430 Just so that we can go through the stuff. 460 00:31:14,430 --> 00:31:21,830 So you can't really see it, but just to be clear, so that's a user of T and a password of 1234 test. 461 00:31:23,010 --> 00:31:25,750 Sorry, I don't know why it looks like that on the projector. 462 00:31:26,410 --> 00:31:27,610 How do I zoom out? 463 00:31:27,610 --> 00:31:30,270 So I'm going to let Dominic handle the zooming. 464 00:31:30,270 --> 00:31:31,610 I've got no idea. 465 00:31:32,770 --> 00:31:35,670 Okay, something started again over there. 466 00:31:35,670 --> 00:31:37,170 Let's just go here. 467 00:31:47,030 --> 00:31:50,530 Okay, and now I'm going to fire up a new config. 468 00:31:50,530 --> 00:31:53,190 I'm going to switch on my network. 469 00:31:54,550 --> 00:31:58,070 And it's starting up and I'm going to switch on my WiFi now. 470 00:32:00,090 --> 00:32:04,970 And what you should see is... okay, it's not on yet. 471 00:32:07,010 --> 00:32:08,770 It's turning on. 472 00:32:10,210 --> 00:32:13,990 So it's fairly difficult to read over here. 473 00:32:14,170 --> 00:32:25,570 But literally we've got each app, so username, user, challenge, the challenge and the response, which is actually just being added to a queue, we use a PyFo queue, with an external Python script. 474 00:32:25,570 --> 00:32:29,010 And the reason why I do this is just so that if you want to... 475 00:32:29,010 --> 00:32:32,730 I mean, I've got ideas at some point for building other stuff in terms of the thing. 476 00:32:32,730 --> 00:32:38,770 But if you want to go along and replace that with some cloud-based cracking service, it'll be ridiculously easy. 477 00:32:38,770 --> 00:32:42,750 You just read from the PyFo, you push it out, and you push the user's back. 478 00:32:42,770 --> 00:32:55,530 But literally adding the item to the PyFo, the Python script passes off to, in this case, a sleep buzz, using the second roughly wordless, obviously it's a ridiculous password, so it's cracked virtually immediately. 479 00:32:56,210 --> 00:32:59,210 And here we've already got credentials cracked. 480 00:32:59,210 --> 00:33:01,770 User is user, and password is password. 481 00:33:01,930 --> 00:33:10,510 And when we go along and carry on over here, it says save secured, and now it's actually going to come along and obtain an IP address and actually connect. 482 00:33:10,510 --> 00:33:19,610 So once again we've now got a hidden , protected network to actually go along and connect to our access point. 483 00:33:22,270 --> 00:33:25,390 Okay, so the promise here is creds from the sky. 484 00:33:25,470 --> 00:33:31,550 So at the very least you'll get a challenge that you can go chew on somewhere or send to Moxie's Cloud Crack or something like that. 485 00:33:31,590 --> 00:33:41,350 But if it's simple or you've got things set up nicely, you've got a nice targeted word list or something, then it'll crack and you get the advantage that you can then man in the middle of the people and hopefully get some other creds. 486 00:33:43,830 --> 00:33:44,630 Alright. 487 00:33:44,630 --> 00:33:51,670 So the point of all of this stuff is to get people to connect to us so that we can then man in the middle of them. 488 00:33:51,850 --> 00:33:56,070 Now, truthfully most of our work was in everything coming up to this point. 489 00:33:56,070 --> 00:34:01,350 The changes to the Karma stuff and integrating the EAP stuff. 490 00:34:01,350 --> 00:34:03,570 But it's kind of pointless if we stop there. 491 00:34:03,570 --> 00:34:08,250 It's like, okay, technically we get it, but we want to see some creds falling from the sky. 492 00:34:08,650 --> 00:34:15,690 So I'm going to half give you that promise, because we built a ton of things that just make kind of make the man-in-the-middle stuff work a little better. 493 00:34:16,110 --> 00:34:22,030 But we don't have particularly good demos of it, because it's really hard So we'd like to do a live demo of that. 494 00:34:22,030 --> 00:34:23,570 It's really hard to do that here. 495 00:34:23,610 --> 00:34:28,670 Naturally we're going to pick up something from someone and then we end up in legal trouble. 496 00:34:29,710 --> 00:34:30,330 So I apologize. 497 00:34:30,330 --> 00:34:32,330 So first off, we didn't do this. 498 00:34:33,210 --> 00:34:35,250 SSLSplit is an awesome tool. 499 00:34:35,290 --> 00:34:39,930 It's much... like if you're going to be man-in-the-middling lots of different protocols, use it. 500 00:34:39,930 --> 00:34:40,990 It's fantastic. 501 00:34:40,990 --> 00:34:45,590 There's a guy, his name also scares me, Daniel Rothlisberger. 502 00:34:46,050 --> 00:34:47,410 That's why there's a burger. 503 00:34:48,230 --> 00:34:49,590 I was very proud of that. 504 00:34:49,590 --> 00:34:50,490 You guys know. 505 00:34:52,310 --> 00:34:57,530 But that's, I mean really, we've just got a bunch of scripts which integrate intelligently so you get creds. 506 00:34:57,530 --> 00:34:59,450 And this actually leads to tons of creds. 507 00:34:59,450 --> 00:35:11,490 People, lots of well, the muggles, they leave their mail connecting over they're not validating certs, they're connecting to POP and IMAP without stuff, so you just get their passwords all the time. 508 00:35:11,510 --> 00:35:19,890 But not so muggly Microsoft and Apple, if you use ActiveSync with Apple's mail.app, that thing doesn't validate certs. 509 00:35:19,890 --> 00:35:21,450 I have no idea why. 510 00:35:21,690 --> 00:35:24,170 So that thing, you get tons of corporate creds. 511 00:35:24,170 --> 00:35:28,150 It's basic authorization so you've just got to pay 60 for it. 512 00:35:28,210 --> 00:35:29,870 So we haven't actually done anything. 513 00:35:29,870 --> 00:35:32,130 We're just using his tool once they're connected to us. 514 00:35:32,130 --> 00:35:33,390 We get that stuff. 515 00:35:33,390 --> 00:35:34,430 So it's cool. 516 00:35:34,430 --> 00:35:35,730 We start getting creds from the sky. 517 00:35:35,730 --> 00:35:37,090 This is fun. 518 00:35:37,790 --> 00:35:42,850 One of the things I really like doing is running this in places where there shouldn't be Wi-Fi networks. 519 00:35:45,010 --> 00:35:46,310 We'll leave it at that. 520 00:35:46,310 --> 00:35:47,970 Let's pretend we're down a mine, right? 521 00:35:47,970 --> 00:35:50,790 You're not necessarily going to have a network connection back up. 522 00:35:50,790 --> 00:35:52,550 But people leave their Wi-Fi on. 523 00:35:53,990 --> 00:36:02,970 So there's a version in the Mana toolkit called no upstream and that tries to fake part enough of the internet so that you can get some credentials from people. 524 00:36:03,230 --> 00:36:07,330 To do that, we have to trick devices into thinking that they're online. 525 00:36:07,330 --> 00:36:10,030 So particularly mobile devices they all do some check. 526 00:36:10,030 --> 00:36:12,950 They try and fetch a file on the internet and if they can get it, then they're online. 527 00:36:13,170 --> 00:36:15,670 Apple's the one that got a little tricksy with it. 528 00:36:15,830 --> 00:36:22,270 So as part of their captive network portal detection thing, they make typically two requests. 529 00:36:22,270 --> 00:36:31,770 They'll make one request with a user agent of captive network portal to one of over 200 different CNAMEs on a particular IP and then to a completely random URL on it. 530 00:36:31,770 --> 00:36:33,810 So we just built some simple Apache V hosts. 531 00:36:33,810 --> 00:36:38,210 Generally for this no upstream stuff, it's using Apache V hosts which handle all of that. 532 00:36:38,210 --> 00:36:40,890 So you can tell the device that it's up there. 533 00:36:41,070 --> 00:36:42,990 Plus, you can do really cool stuff. 534 00:36:42,990 --> 00:36:44,310 So I'll get on to the next slide. 535 00:36:44,310 --> 00:36:51,830 You can automatically push rogue CA certs or malicious IOS profiles as part of the captive network portal thing. 536 00:36:52,970 --> 00:37:02,370 Somebody connects to your network and this thing automatically pops up and if they don't know what they're doing and they click the wrong button and they type in their password, you can like fundamentally control their device in different ways. 537 00:37:02,370 --> 00:37:03,930 Or at least just add a rogue CA. 538 00:37:04,230 --> 00:37:06,530 The nice thing about the... okay wait, I'm jumping ahead. 539 00:37:06,770 --> 00:37:09,290 Anyway, so it's a small little thing but it leads to coolness. 540 00:37:10,730 --> 00:37:13,870 The other... this is a bit lame but it also leads to some coolness. 541 00:37:13,870 --> 00:37:16,650 You can have your own captive network portal up there. 542 00:37:16,650 --> 00:37:27,550 So they go to a site that you haven't implemented a thing for on your fake internet it pops up a captive portal thing and it says use OAuth and log in with your Google creds or Facebook or something and they type it in and you get those. 543 00:37:27,550 --> 00:37:32,730 Okay, nothing particularly interesting there but you know, you get some stuff. 544 00:37:33,570 --> 00:37:42,570 But what's interesting is if you can get an evil CA cert in their device because now your man in the middle stuff works much better. 545 00:37:43,010 --> 00:37:47,870 So it's not particularly new research but there's not a lot out there. 546 00:37:47,870 --> 00:37:50,030 It's really easy to do that actually. 547 00:37:50,030 --> 00:38:01,730 If you just serve a .cer file to either an iOS device or an Android device they will offer to add that to their root CA list. 548 00:38:02,190 --> 00:38:03,610 Just like that. 549 00:38:04,350 --> 00:38:14,750 I mean, can you imagine that if you went to a site like in your normal browser on your computer and it served you a .cer file, it would prompt you to add that to your root CAs. 550 00:38:14,750 --> 00:38:16,110 That would just be ridiculous. 551 00:38:16,150 --> 00:38:17,510 Everyone would rail about it. 552 00:38:17,510 --> 00:38:19,510 But mobile devices allow you to do that. 553 00:38:19,550 --> 00:38:23,510 Now granted, the user does have to type in their password. 554 00:38:23,510 --> 00:38:25,590 So on an iOS device you'll type in your password. 555 00:38:25,710 --> 00:38:29,370 On Android, you just have to give it a name and then click save. 556 00:38:29,430 --> 00:38:33,350 So there's some stuff but that's not a huge thing to get over. 557 00:38:33,350 --> 00:38:36,370 And if you get that right, then you've got a root CA in there. 558 00:38:36,370 --> 00:38:38,950 So now you can start man-in-the-middling all sorts of things. 559 00:38:39,330 --> 00:38:47,510 But you don't get to man-in-the-middle everything because HSTS is a real pain in the ass. 560 00:38:47,590 --> 00:38:49,150 So once again not our research. 561 00:38:49,150 --> 00:38:53,070 A guy named Leonardo presented Black Hat Asia this year 2014. 562 00:38:53,070 --> 00:38:57,410 And he came up with a nifty little bypass for HSTS. 563 00:38:57,510 --> 00:39:02,390 So HSTS is HTTP strict transport security. 564 00:39:02,490 --> 00:39:08,790 And what that means is a site can put a header which says, when you speak to me, speak to me via SSL. 565 00:39:08,790 --> 00:39:10,170 Your browser will remember that. 566 00:39:10,170 --> 00:39:15,170 So when you type something like gmail.com, it'll go directly to HTTPS gmail.com. 567 00:39:15,170 --> 00:39:23,650 Even if you type in HTTP gmail.com, it'll still go directly to HTTPS because it's remembered that this is an HSTS site and it should go to it. 568 00:39:23,650 --> 00:39:27,290 Now what that screws is Moxie's SSL strip. 569 00:39:27,290 --> 00:39:34,990 So SSL strip relies on people hitting HTTP sites first and then preventing it from ever upgrading to SSL. 570 00:39:34,990 --> 00:39:37,450 And HSTS is a direct response to that. 571 00:39:37,650 --> 00:39:44,110 So what Leonardo worked out is that some places still have to have HTTP jumps. 572 00:39:44,130 --> 00:39:46,150 So if you look at google.com. 573 00:39:46,150 --> 00:39:51,390 If you typed google.com, it serves it over HTTP and then redirects to HTTPS. 574 00:39:51,390 --> 00:39:55,190 The standard thing that SSL strip can deal with. 575 00:39:55,190 --> 00:39:57,410 Sorry, I always get SSL strip and split confused. 576 00:39:58,070 --> 00:40:07,590 But then within that page, if you click accounts.google and SSL strip will try and rewrite that to HTTP. 577 00:40:07,590 --> 00:40:09,570 When you actually make the request, that gets denied. 578 00:40:09,570 --> 00:40:13,970 It's only going to serve that stuff over HTTPS because it's got HSTS. 579 00:40:14,210 --> 00:40:25,670 So what Leonardo did is he made some mods to SSL strip to... when you go to google.com it actually redirects you to quadw.google.com which is a whole different domain. 580 00:40:25,670 --> 00:40:29,110 So there's no pre-saved HSTS stuff for it. 581 00:40:29,110 --> 00:40:39,850 And there he can do the normal SSL strip rewrites on it and instead of... so when you click sign in, instead of redirecting to accounts.google.com he'll redirect you to like webaccounts.google.com. 582 00:40:39,850 --> 00:40:42,690 Once again another domain, HSTS doesn't apply. 583 00:40:42,770 --> 00:40:47,370 Google seems to have pushed something down or at least came into effect last night, the first time I spotted it. 584 00:40:47,370 --> 00:40:49,390 They've actually now got it going over the domain. 585 00:40:49,450 --> 00:40:52,630 So we've made some mods that it actually appends the stuff on the end. 586 00:40:52,630 --> 00:40:58,930 So it won't take you to accounts.google.com, it'll take you to accounts.google.com.x Hold other domain, the HSTS doesn't apply. 587 00:40:59,130 --> 00:41:01,150 But it's really nifty for certain places. 588 00:41:01,150 --> 00:41:03,430 So it works for Facebook if you go to touch.facebook. 589 00:41:03,430 --> 00:41:06,350 It works for Twitter if you go to m.twitter.com. 590 00:41:06,350 --> 00:41:13,750 The reason you have to go to those is those are sites for which it doesn't have HSTS necessarily saved for that particular site. 591 00:41:13,870 --> 00:41:17,170 So then we start getting cookies and things that we can use there. 592 00:41:18,670 --> 00:41:21,370 Cookies, so creds are really useful. 593 00:41:21,370 --> 00:41:24,190 Cookies are also really useful because it gives us auth to sites. 594 00:41:24,370 --> 00:41:25,790 FireSheep was fantastic for this. 595 00:41:25,790 --> 00:41:27,750 A little Firefox browser extension. 596 00:41:27,750 --> 00:41:31,430 It would sniff stuff and you could then just click and log in on the site. 597 00:41:31,970 --> 00:41:34,570 It doesn't work anymore so we wrote FireLamb. 598 00:41:35,930 --> 00:41:37,890 So that's a lamb rye. 599 00:41:37,970 --> 00:41:48,950 So FireLamb, all it does is it's a Python script that will use a scapy, goes into monitor mode, looks for cookies, sticks into database, and then will generate Firefox profiles. 600 00:41:48,950 --> 00:41:51,210 So you can just say, okay, show me that guy there. 601 00:41:51,210 --> 00:41:54,830 It'll load up Firefox with all that guy's cookies and all the links that he visited. 602 00:41:54,830 --> 00:41:55,910 So you can just click on it. 603 00:41:55,910 --> 00:41:59,810 Much the same as FireSheep and go there. 604 00:42:00,310 --> 00:42:08,090 Okay, so we basically implemented all of this stuff in the Mana toolkit to deal with all of those things. 605 00:42:08,090 --> 00:42:13,150 I think we're pretty short of time so I'm not sure how many demos we can go through. 606 00:42:13,150 --> 00:42:14,190 How much time do we have? 607 00:42:14,990 --> 00:42:17,250 Okay, so we're going to try and go through some of them. 608 00:42:17,250 --> 00:42:19,890 These are a lot more manually demos. 609 00:42:20,730 --> 00:42:22,910 So they might not work as well. 610 00:42:32,910 --> 00:42:34,010 Thank you. 611 00:42:34,010 --> 00:42:36,590 Sorry, I just can't get the hang of this Apple. 612 00:42:36,970 --> 00:42:38,470 Apologies about that. 613 00:42:38,470 --> 00:42:41,930 Right, so if we have a look at a bunch of things. 614 00:42:43,710 --> 00:42:47,310 So this is using a malicious cert. 615 00:42:48,490 --> 00:43:03,790 Basically what we're doing is we're running it with no upstream, just to sort of try and get to a captive portal, which will then allow us to either socially engineer the user or alternatively provide him a link to sort of say automatically configure your stuff. 616 00:43:03,790 --> 00:43:04,950 Please pick here. 617 00:43:05,030 --> 00:43:19,790 You'll see we're connected to internet now and what we'll do is we'll go to foo.com or wherever and we'll end up with a... well, moo.com We'll end up with a captive portal page. 618 00:43:21,950 --> 00:43:23,310 There we go. 619 00:43:23,510 --> 00:43:30,330 If you scroll down right at the back we give him the option of logging in via Google or... 620 00:43:34,150 --> 00:43:42,830 Well, we give him the option of using some overall thing or signing in via Google creds or mail or Twitter or etc etc. 621 00:43:42,830 --> 00:43:49,190 But we also provide this nice little link sort of saying please auto-configure and it'll connect automatically. 622 00:43:49,350 --> 00:43:59,430 And if we auto-configure that then basically what happens we get prompted to install a specific root CA which has now been installed. 623 00:44:00,010 --> 00:44:04,570 There is an icon that comes up which you'll see right at the top left there. 624 00:44:05,470 --> 00:44:15,990 You drag down the bar it'll sort of say your communication may be subject interception which is fine, probably good practice. 625 00:44:19,450 --> 00:44:22,330 So I'm just waiting for the network to come up again. 626 00:44:22,690 --> 00:44:25,570 So yeah, here it says network may be monitored. 627 00:44:25,930 --> 00:44:30,130 But in any case now if I go to accounts.google.com 628 00:44:38,180 --> 00:44:39,680 Let's enter. 629 00:44:42,480 --> 00:44:46,660 We're actually going to get to... but it works one time, sorry. 630 00:44:46,660 --> 00:44:48,880 It's almost as slow as South African internet. 631 00:44:48,880 --> 00:44:52,920 But we're actually getting to Dominic's personal information over there. 632 00:44:52,920 --> 00:44:58,200 So we've actually had access to his Gmail account. 633 00:44:58,200 --> 00:45:05,400 And we're man in the middling so you're getting the full... Got the full clear text from SSL strip, etc, etc, etc. 634 00:45:07,240 --> 00:45:11,360 Right, other one which is... I'm going to skip FireLAM. 635 00:45:12,300 --> 00:45:16,240 So FireLAM is not working so well just yet. 636 00:45:16,800 --> 00:45:25,500 But basically FireLAM will extract the stuff from SCAPI and also from the files that we collect as the program is run. 637 00:45:25,500 --> 00:45:28,000 And you can literally go along and fire it up. 638 00:45:28,000 --> 00:45:32,980 And these are all the sites selected for a specific user. 639 00:45:39,060 --> 00:45:46,840 So this is literally just pulled out of the log files and pulled out of the network captures. 640 00:45:46,840 --> 00:45:59,700 And everyone of... every different device you can sort it by MAC address or IP address will literally build a different Firefox profile which includes the cookies for the specific thing. 641 00:45:59,700 --> 00:46:03,900 Now this was captured live, so I don't want to show the information that I'm doing here. 642 00:46:03,900 --> 00:46:08,380 I'm just changing it to the directory of someone who I've captured. 643 00:46:08,380 --> 00:46:13,440 Now I'm just going to do a count of the cookies SQLite database. 644 00:46:13,560 --> 00:46:16,900 You'll see there's just one cookie in that database. 645 00:46:16,920 --> 00:46:25,240 So that's the schema, that's the actual database schema, and that's the select count star from most cookies. 646 00:46:25,280 --> 00:46:29,560 And you'll see we'll get a result of one, which is just very poorly described over there. 647 00:46:29,560 --> 00:46:31,700 But in any case that's FireLamb. 648 00:46:31,700 --> 00:46:36,360 It's not working perfectly, but it does potentially work. 649 00:46:36,380 --> 00:46:39,100 I did some nasty stuff to Dominic this morning. 650 00:46:40,160 --> 00:46:47,920 Yeah, Ian announced to me that this stuff was working by posting as me on my Facebook wall saying Hey Dominic, this is Ian. 651 00:46:47,920 --> 00:46:50,240 The first person who liked it was his wife. 652 00:46:51,260 --> 00:46:52,440 Right, okay. 653 00:46:52,440 --> 00:47:00,660 So what's happening over here, because one thing we also see quite a bit is that the interception is, believe it or not, mail creds. 654 00:47:00,820 --> 00:47:01,500 Cleartext. 655 00:47:01,500 --> 00:47:04,160 There's so many people running the stuff over cleartext. 656 00:47:04,160 --> 00:47:08,380 Either this is man in the middle using SSL split. 657 00:47:08,380 --> 00:47:09,040 Right. 658 00:47:09,240 --> 00:47:22,400 And basically it's just a demo account of ours thrown away in the meantime, but literally we've got cleartext creds in the log files, etc, etc, etc. 659 00:47:22,400 --> 00:47:24,580 So it's very poor. 660 00:47:27,900 --> 00:47:28,700 Okay. 661 00:47:32,200 --> 00:47:38,320 I'll be around for a bit, so if anybody wants to see a live demo, I can just fire up my Linux machine and you can bother me there. 662 00:47:38,320 --> 00:47:39,400 It'll be a lot easier. 663 00:47:39,960 --> 00:47:47,960 So yeah, you couldn't see that particularly well, but one of the advantages of SSL split is you can get non-HTTP protocols, so you get lots of mail creds. 664 00:47:49,860 --> 00:47:56,980 So the big difference with fire lamb over something like fire sheep is it goes through the SSL interception stuff too. 665 00:47:56,980 --> 00:48:04,720 So the things that you SSL man in the middling, you get those cookies as well, not just cookies that you could passively monitor from stuff in monitor mode. 666 00:48:04,720 --> 00:48:06,120 But you also get that. 667 00:48:06,140 --> 00:48:10,640 And the other nice thing is that all of this man in the middle stuff can be run not in Wi-Fi. 668 00:48:10,640 --> 00:48:16,100 Like if you're trying to man in the middle on physical networks, all of these tools are reusable for there. 669 00:48:16,100 --> 00:48:22,380 So you could point fire lamb at x0 if you happen to be ARP spoofing on a LAN or something like that. 670 00:48:22,380 --> 00:48:27,920 So it's kind of assembling these things into something that's a little more usable. 671 00:48:28,680 --> 00:48:32,640 Alright, so that takes us to, like back to the promise. 672 00:48:32,640 --> 00:48:35,220 We were stuck in the desert. 673 00:48:35,940 --> 00:48:38,320 Karma stuff wasn't working so well. 674 00:48:38,320 --> 00:48:41,400 We didn't have support for secure networks and those credentials. 675 00:48:41,640 --> 00:48:46,720 You had to assemble your own man in the middle assemblage which didn't necessarily work so well. 676 00:48:46,720 --> 00:48:51,320 There's these new changes coming in from mobile devices which lead to things being a bit more complicated. 677 00:48:52,120 --> 00:48:59,980 We've taken all the research that others have done to try and deal with a lot of these problems we've assembled it into a package where you can just run a script and it'll work. 678 00:48:59,980 --> 00:49:04,800 We've done some of our own research to build some tools which deal with some of these problems. 679 00:49:04,800 --> 00:49:07,920 And we've put it together into this thing called the Mana Toolkit. 680 00:49:08,800 --> 00:49:10,940 It's on a GitHub repository at the moment. 681 00:49:10,940 --> 00:49:15,280 We're going to be releasing it tomorrow when we do this talk at DEF CON May. 682 00:49:15,280 --> 00:49:18,920 I'll have the demos working properly from Windows. 683 00:49:19,200 --> 00:49:24,080 But if you're looking for them, it'll be at github.com forward slash sensepost. 684 00:49:24,440 --> 00:49:27,000 We split it up so there's a bunch of repositories. 685 00:49:27,000 --> 00:49:29,440 If you just wanted FileM or something like that. 686 00:49:29,440 --> 00:49:31,440 But there's also a global repository. 687 00:49:31,440 --> 00:49:34,340 We'll put a blog entry up on sensepost.com. 688 00:49:34,340 --> 00:49:46,000 And then if you want a lot more technical detail about this stuff, on the DEF CON CD, the slides we've included there have much more detailed diagrams and technical information that works better if you're reading it. 689 00:49:46,300 --> 00:49:46,960 So that's us. 690 00:49:46,960 --> 00:49:48,620 Thank you very much for your time and patience.