Hello everyone. Hi at the back. Alright, I'm going to do that awkward thing. How quiet does it get in here before I start talking? Yes. Do we have to look at people? Alright, okay. Hello. Today we are talking about rogue access point attacks. Improvements on the Karma toolkit. We built a toolkit called Mana. So just a quick disclaimer, I'm sure you've seen a hundred of these today. It's really difficult to demo this stuff without picking somebody up. So please turn off your Wi-Fi if you don't want to be part of it. We've reduced our transmit power, things like that. We're not trying to be malicious, but we can't demo the research otherwise. 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. But it's not our intent. We're not going to be putting up people's passwords or anything like that. We're going to be targeting our devices. So just a quick disclaimer. If any of you are for law enforcement, please don't arrest us. Okay. Hi, I'm Dominic and this is Ian. We did this work. We work for a company in South Africa called SensePost. We're a pen testing firm and those are our contact details if you want them. Okay. So why are we looking at Wi-Fi in particular and rogue access point attacks? Those things are lame. Every pineapple has got Karma on it. We can run this stuff. Yeah, so what? Nothing new. Karma attacks 2004. This is old school. So Wi-Fi is at a point where it's like your skiddy's first day out. 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. And there's a couple of reasons for that. So the one is we all recognize that Wi-Fi is ubiquitous. We've got it just everywhere. Plus it gives us access to coolness. We've got all the cloud services that people are going to use. Should I? Do I need to like stare up here? Okay. We've got all the cloud services that you can get access to. It gives us lots of goods. It's not like you're just communicating with some local server. You're communicating with stuff that runs your life. And it means we can use 20-year-old Ethernet attacks because we're on the same local network. So we've got toolkits spanning decades that allow us to bring a taxi. I mean, ARP spoofing is still a thing. So Wi-Fi is a pretty exciting thing to go for. Except the attacks, like we haven't really seen anything new coming out from Rogue AP stuff really since Karma in 2009. So we've got these vulnerabilities at every layer of the Wi-Fi protocol. So we can spoof, trick devices into connecting to our malicious networks with Karma attacks. Dino Daizovi, Sean McCauley, 2009-2004, they presented that stuff. Once we get something to connect to it, we can crack the crates. If you can capture a handshake, you can crack WPA. If you capture MS-CHAP things, you can send that through a sleep or cloud cracker, and you can crack that stuff. Cool, so those two layers are handled. Once you're connected to the network, we can sniff everyone's passwords. Doug Song released DSniff back in 2000. Since then, we had Robert Graham release, I think it was at DefCon, Hamster and Ferret, does anyone remember Hamster and Ferret? In 2007, I think it was. Then we had Fire Sheep in 2010, which got everyone excited. It's all the same stuff, it's just new implementations of it. Once you connect to a network, we can capture all these creds. We've got these vulnerabilities at every layer of the network, and we should have creds falling from the sky. 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. But the truth is, that doesn't happen. 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. Because these tools don't work as well as they used to. So in 2004, when Karma was released, that stuff worked really well, but now Karma doesn't work so well. 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. So it means it doesn't automatically connect to them. Your home network is not going to get automatically connected to you. iOS devices have dramatically reduced how much probing they do through a variety of things. I'll go into more detail on this stuff. But we end up in a state where the Karma attacks don't work so well. When it comes to the network-sniffing stuff, the stuff is old. Doug Song released that stuff in 2000. If any of you have run message-snarf recently, it's still looking for MSN messenger messages. You're not going to see that stuff going over your average network anymore. FireSheep was a flash in the pan. That stuff doesn't work anymore. Over the years, these tools have been written. They stopped working. 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. So we put this toolkit together called M.A.N.N.A. Truthfully, we liked the idea of M.A.N.N.A. from heaven for the talk, so we tried to come up with a backronym that would be something cool. We can't come up with anything cool. At the moment, we're sitting with M.A.N.N. in the middle and Network Attack Toolkit. It's still stupid. So if you have a better backronym, please share that with us. We'd be really open to it. So the M.A.N.N.A. 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. So it's a horrible mash that works. We hope to get it into a better state. Alright, I'm going to teach some of you to suck some RF eggs. Just a quick targeted Wi-Fi primer on stuff you need to understand this. So we're talking Wi-Fi. We're not talking 3G, Bluetooth, RFID, anything like that. We're talking 802.11 a, b, g, n, a, c. We're specifically, for the beginning part at least, looking at management packets. So some of you will know, in Wi-Fi, you've got control packets, data packets, and management packets. So control packets are the things that'll say... the device will say, hey AP, I want to send some data and AP will say, everyone shut up! And then it'll send some data. Those are request to sends and clear to sends. And then data packets are the actual data. And management packets have got probe requests, probe responses, and beacons, which are the ones we're most interested in. So every wireless network has beacons that come out constantly. It's how you get the timing on the network, know when to communicate. And they've got a bunch of information in it, like the SSID. If you hide your SSID, then the beacon won't have the SSID in it. And then probe requests and responses are how devices talk, figure out how to associate two networks and which networks are nearby. So this is a really simplistic diagram. 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, but all the nearby access points will respond with a probe response. If the network's hidden, then it won't respond. It'll only respond if you probe directly for that network, so you have to know the name beforehand. Okay, so I'm sorry if some of you know this, but it's necessary. Okay, once you decide to associate to a network, then this step happens. I've actually cut out a bit in the middle because nobody used shared key authentication. 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. 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. Any of you familiar with the AirCrack suite? If you use AirReplay fake auth, this is exactly what fake auth does. When you get that association ID, you've hit this part here. So this is how stuff associates. Now, it's important to note that there's two things. There's finding networks, and there's associating to networks. Because current Karma attacks deal with this part only. Okay, so Karma attacks. Sean McCauley's at IOActive. I'm not sure what Dino is these days. He's either fun-employed or something. 2004, I mentioned that they came up with this really cool stuff that if... I mean... Yeah, they came up with these Karma attacks. So I've got a... Do Americans play Marco Polo when you're kids? Oh, I don't want to be prescriptive. Some of you aren't Americans. So you guys know what Marco Polo is. Okay, so just in case, because I saw some people doing this. Marco Polo is a kid's game you play in the pool. Somebody closes their eyes. They're it. And then they have to shout out, Marco. And everyone around them shouts, Polo. And they have to acoustically figure out where you are and try and catch you. So Wi-Fi networks are a bit like this. My device, when it is looking for a nearby network, shouts out, Marco. And all the access points nearby say, Polo. And it knows where the access points are. And there's no authentication at this level. Because nobody uses shared-key authentication because it's got ROMs. So what happens is, if this is a legitimate access point over here, and I shout, Marco, and it goes, Hey, I'm Polo. Then you can have another access point over here say, Hey, I'm Polo too. And that's not even a vulnerability because this is how your corporate networks run. 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. So calmer attacks take advantage of this. And in particular, what they rely on is the fact that devices have something called a PNL, a preferred network list. 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. Now, I'm not sure why. It was the stupidest design decision ever because it's led to a world of hurt since then. 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. It wouldn't send out a broadcast, wait to see if something called HomeNet exists, and then connect to it. It would just probe. And there's all sorts of different reasons. So like historically, that's just how they built it on computers. 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. So there's all sorts of different reasons as to why it's doing it. But the truth is it does it. If some of you have seen some of our other research, we built something called Snoopy. The guy is actually presenting just after us. All this does is it looks at the probes that your devices are sending out. It geolocates it. And then it can try and track where you've been. 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. So it's really lame, right? The single little probe request was leaking all this stuff out. And so that's how CalmAttacks worked. It responded to these directed probes and then you could get somebody to connect to your network. There was supposed to be an animation there. Okay, well let's... Okay, so recently two guys built newer versions of it. So the pale guy is DigiNinja, or Robin Wood. And he built the version of HostAPD that implements Canva that's on the Pineapple. The guy on the right is Thomas, if anyone can pronounce his surname. Anyone here? Jotrep. The guy who built the Aircrack suite. I'm really sorry for not being able to pronounce his surname. Awesome, they both did great work. And they've built modern versions of Canva. So if you run AirbaseNG, you can have Canva implemented in software. Or if you're running the Pineapple, you're using HostAPD written by Robin. Okay, but Canva doesn't work so well anymore, as I mentioned before. It doesn't... Your PNL list, when you're looking for networks, those networks don't show up. Canva is only going to respond when you send a directed probe. So the most obvious change here is let's get Canva to respond to broadcasts. And that's one of the first things that we implemented in Mana. So we took HostAPD and we ported it to HostAPD 2.2 because the Pineapple is still running version 1. And we've got a hash that we just look at all of the probe requests that we've received. And we build up a view of the PNL of the individual devices. So now when one of your devices sends out a broadcast probe request, we can respond with broadcast probe responses. 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. Now, that implies some interesting stuff. For the longest time I thought, well, and actually there was an implementation thing on iOS. 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. So I was convinced that you needed to change the BSSID, like have a different BSSID for things. It turns out none of that's true. Ian pointed it out to me. He figured it out. We can send multiple probe responses from the same BSSID and all devices respect that. That's fine. It will show up as different networks. So that was the one finding which allowed us to handle Discovery better. It's implemented. It's working really well. I'm going to hand over to Ian now to do a demo. Unfortunately, we didn't sacrifice enough chickens to the demo gods. So his thing is not displaying up there. So we've got an iPhone. The Android thing I don't think is going to work. We've got some video backups just in case. Right, great, everyone. Before I carry on, I just want to make one thing. This is a note I've got stuck on my wall in the office. I've been battling with HostAPD probably for the last couple of months. I've had sleepless nights about it, including last night. And so there's probably a lot of very bad code inside that... Sorry, can you hear me? Is that better? Okay, as I was saying, I've been battling with the code in HostAPD for a couple of months. I've had sleepless nights, including last night. No, that's not an amplifier, is it not? Okay, apologies. I'll speak louder. 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. In any case, we had a couple of demo-god things. As normal, Linux and projectors just don't want to work. I'm going to have to try and present off an Apple laptop. The key bindings are all funny, so apologies about this. We're going to plug in an iPhone now, and I am going to... Okay, so iPhone, it's looking at nearby Wi-Fi networks. Somebody's running Pineapple. Get better offset, whoever you are. 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. Go right to the top, Dominic. I haven't connected to anything. There are a hell of a lot of networks currently being shown all over the place here. There's also a lot of traffic, which is... There's also a lot of traffic which is interfering with things, so I'm going to just switch to a demo here. Okay, you've got to switch that way. We hope for a live demo. It's not working. I'll try again a little later. I think you've just gone on to password. Right, so over here, what we have actually got is actually a... this is my phone. 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. 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. As we sort of see, for every broadcast I send, I'm getting responses here. I'm getting a response for food. I'm getting a response for... one of these. I can't read it. 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. So what's happened over here right now is the phone is actually just connected to internet, an open network I previously connected to. Simply from various probes, my phone was actually making. Sorry, it's connected to Foo. Apologies about that. So it's connected to Foo. No complaints. Android device didn't complain at all. And all of a sudden we're now on the... we've connected to that specific network. 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. Because now we're responding to the broadcast, it shows up as available. And the big thing there is that you'll get stuff automatically connecting to you. So if it's sitting in someone's pocket and it's configured to auto pull mail, you now get that stuff connecting. Whereas before they had to explicitly click on the network. It makes a big difference in a bunch of different scenarios. You get a higher connection rate. So now the problem... the next problem we ran into is that Apple devices have radically reduced the amount of probing they do. So they've gotten savvy and they don't probe for public networks, or open networks, sorry, not public networks, in their PNL. They wait to see a broadcast response from it. But while investigating this stuff we noticed that Apple devices weren't even probing for hidden networks. 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. 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. But with Apple devices they weren't. So like, well this is impossible. How does it connect to a network? We record it connecting to the network, fine, it would send out probes. 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. Then they will disgorge all of their networks on the PNL which are hidden. So if you're not seeing probes from Apple devices bring up a hidden network, it doesn't have to be a real network. It can be on your MiFi device, it can be something here. We've got an example configuration here that you can use. Just at least one nearby. Doesn't matter what it looks like. It'll start probing for those. 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. They were sick of the fact that retailers and ad trackers are using Wi-Fi probes to start tracking people. They want them to use iBeacon to track people. So they started fixing this stuff up, supposedly. There's also claims that iOS 8 is going to use random MAC addresses for their probing. 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. So it was then presented an interesting challenge to us. How do we get iOS devices which aren't probing for open networks to connect to that stuff? So we implemented something called loud mode. So right now, when this stuff's running, you'll see networks for your device. 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. It's individual to your device. Loud mode just takes that away. You start seeing everyone's device. But it lives up to its name. In a busy place like this, you'll start seeing hundreds of networks showing up. And it also leads to interesting undefined behavior in really busy environments. My VM spontaneously rebooted at some point while I was testing this stuff last night, because the list gets bigger over time. And eventually it's just spamming out hundreds of networks, broadcast responses in response to one thing. But the advantage is the ramp-up in getting things connected is really good. And what we're relying on there is the fact that laptops have had none of this stuff. So Windows machines, Apple, OS X devices, Linux devices, all happily probe for their remembered networks. Mobile devices, they're limiting the stuff, but not these. 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. 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. 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. And it works pretty well. We end up getting a higher rate of connections. But once it ramps up, you get a lot more connections. Sorry, Apple, I really... You've gone into a corner. Okay, thank you. Apologies, I used to work on an Apple years ago. I don't really... gone into a corner again. Apologies. It's fine, I think I'll manage. So, okay, comma two. Right, so here what we've got is we've got the same thing happening. You see there's a whole bunch of responses coming in here. And we've only got a couple of networks open on the right. But as soon as this starts building up, you'll see that list is going to get bigger and bigger. Apologies, this is just me connecting. What's nice about this is if you connect to a network that isn't there, it'll connect automatically. Wrong video. Sorry, so I mean that network is a brand new network. It just works perfectly. It's comma three then. Comma loud. Okay, so what we've got over here, we've got the same thing. We've got a couple of networks open. What I've done is I've just edited the config file. I've enabled loud mode. 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. So there's someone TGUNJCDM etc etc. When we scan we're going to see that coming up over there. That's not a network my device is probing for. That's a network that some other device has been looking for. But now because we've enabled loud mode, it's broadcasting it every time it receives any type of request. So that literally just increases the stuff. 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. So here we've got Yankees. Yankees rule was recorded last night. And it's going to carry on growing and growing until it actually ends up with quite a sizable list of devices. So... Ashton Wireless etc etc. The list just grows and grows. But in any case, that's loud mode. It does significantly increase the number of connections you're going to get in. And I'll hand over to Dominic. Thanks. I'm looking at it now and I'm like, oh man, that's really trivial. But I can't underestimate how much work it was to get this implemented in HostAPD. It's like this low level C that interacts with drivers and it doesn't have any comments. There are no comments. There's one comment every now and again. I'm not sure why. You have to put debugging statements everywhere. At some point Ian was in GDB just trying to figure out what the hell was going on. Okay, so the next is secure networks. Karma attacks don't handle secure networks at all. They need to be open networks. Now, we confess we haven't come up with any new ways of pwning secure networks. But we have integrated some stuff in here. So just to be clear WEP, WPA, EAP networks or Ada2 1x this is what we mean by secure networks. Right now your options for going over those are to use Freeradius WPE. I think that was 2008. So it's Joshua Wright and Brad Antonovich. I'm sorry if I've ruined his surname. I think that's the right one. So they wrote Freeradius WPE. It's a radius server that would dump the MSChap hashes. You can then send it to Joshua Wright's asleep or these days hashcat and things. You crack it and you get crates. So what's quite nice about HostAPD let me go... HostAPD has got an EAP server built into it. 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. So Ian took Brad's patches he brought them up to date for HostAPD 2.2, merged them in. So now the EAP stuff is integrated. So this version of HostAPD does all the new comma stuff, plus it gives you an updated version of Freeradius. So we're not using Freeradius, we're using the HostAPD's radius. But it's all integrated. 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? We can do that automatically. If somebody tries to associate to an EAP network then we can record that hash, try and crack it. 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. So we've got a higher potential of now getting people to connect. Particularly in corporate environments, because people are more likely to be running 802.1X in corporate environments. So just to give you an idea of how that works, this was my attempt to draw a simple PEEP diagram. It's actually a little more... I have to remove some things here. But there's two things happening. 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. And you can say, yeah, you guys, you're stupid, you didn't validate the service certificate. But actually certificates, you can't set a common name that matches a network. There is no field in a certificate that is matched on four Wi-Fi networks. So we get some advantage there. And then there's like weird ass prompts. Like OSX, I don't know, it's changing quite a lot. But different things give you just stupid prompts. Like if you try and connect to networks with different things. If you press the wrong thing once, like you're screwed. And then MSChat is weak. Moxie Marlinspike did his talk last year, 2013. They can go through the entire DES space using stuff like Cloudcrack. And what we've implemented, what Ian's implemented for this, you can plug whatever you want. At the moment we're using Asleep, but if you wanted to use Hashcat or Cloudcrack, you can. So essentially we're going to man-in-the-middle it. We send our own certificate. We capture the MSChat challenge response. We crack it. Once we get it, we add it back in the EAP file. And then people can connect. Right, so here's the same thing. I've got a couple of screens open over here. I've got my Android device, the actual device. I've got two. This one I'm actually just going to look at the EAP users file. This defines what users are allowed to connect to the EAP network. And this is just going to be the output from MANA. And I'm going to pause in various locations. So first what I go through, I just have a look at my WiFi networks. I've got that always on secure. If I have a look at the config, it's basically peep MSChat. Username is user. Password is password. It's unchanged, et cetera, et cetera. Just turning off WiFi so it will scan immediately to save some time. And now I am going to just tail the host APD EAP user. So these are just the default ones that come through. So those are the last couple of entries in that specific file. Just so that we can go through the stuff. 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. Sorry, I don't know why it looks like that on the projector. How do I zoom out? So I'm going to let Dominic handle the zooming. I've got no idea. Okay, something started again over there. Let's just go here. Okay, and now I'm going to fire up a new config. I'm going to switch on my network. And it's starting up and I'm going to switch on my WiFi now. And what you should see is... okay, it's not on yet. It's turning on. So it's fairly difficult to read over here. 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. And the reason why I do this is just so that if you want to... I mean, I've got ideas at some point for building other stuff in terms of the thing. But if you want to go along and replace that with some cloud-based cracking service, it'll be ridiculously easy. You just read from the PyFo, you push it out, and you push the user's back. 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. And here we've already got credentials cracked. User is user, and password is password. 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. So once again we've now got a hidden, protected network to actually go along and connect to our access point. Okay, so the promise here is creds from the sky. 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. 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. Alright. 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. Now, truthfully most of our work was in everything coming up to this point. The changes to the Karma stuff and integrating the EAP stuff. But it's kind of pointless if we stop there. It's like, okay, technically we get it, but we want to see some creds falling from the sky. 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. 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. It's really hard to do that here. Naturally we're going to pick up something from someone and then we end up in legal trouble. So I apologize. So first off, we didn't do this. SSLSplit is an awesome tool. It's much... like if you're going to be man-in-the-middling lots of different protocols, use it. It's fantastic. There's a guy, his name also scares me, Daniel Rothlisberger. That's why there's a burger. I was very proud of that. You guys know. But that's, I mean really, we've just got a bunch of scripts which integrate intelligently so you get creds. And this actually leads to tons of creds. 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. But not so muggly Microsoft and Apple, if you use ActiveSync with Apple's mail.app, that thing doesn't validate certs. I have no idea why. So that thing, you get tons of corporate creds. It's basic authorization so you've just got to pay 60 for it. So we haven't actually done anything. We're just using his tool once they're connected to us. We get that stuff. So it's cool. We start getting creds from the sky. This is fun. One of the things I really like doing is running this in places where there shouldn't be Wi-Fi networks. We'll leave it at that. Let's pretend we're down a mine, right? You're not necessarily going to have a network connection back up. But people leave their Wi-Fi on. 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. To do that, we have to trick devices into thinking that they're online. So particularly mobile devices they all do some check. They try and fetch a file on the internet and if they can get it, then they're online. Apple's the one that got a little tricksy with it. So as part of their captive network portal detection thing, they make typically two requests. 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. So we just built some simple Apache V hosts. Generally for this no upstream stuff, it's using Apache V hosts which handle all of that. So you can tell the device that it's up there. Plus, you can do really cool stuff. So I'll get on to the next slide. You can automatically push rogue CA certs or malicious IOS profiles as part of the captive network portal thing. 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. Or at least just add a rogue CA. The nice thing about the... okay wait, I'm jumping ahead. Anyway, so it's a small little thing but it leads to coolness. The other... this is a bit lame but it also leads to some coolness. You can have your own captive network portal up there. 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. Okay, nothing particularly interesting there but you know, you get some stuff. 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. So it's not particularly new research but there's not a lot out there. It's really easy to do that actually. 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. Just like that. 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. That would just be ridiculous. Everyone would rail about it. But mobile devices allow you to do that. Now granted, the user does have to type in their password. So on an iOS device you'll type in your password. On Android, you just have to give it a name and then click save. So there's some stuff but that's not a huge thing to get over. And if you get that right, then you've got a root CA in there. So now you can start man-in-the-middling all sorts of things. But you don't get to man-in-the-middle everything because HSTS is a real pain in the ass. So once again not our research. A guy named Leonardo presented Black Hat Asia this year 2014. And he came up with a nifty little bypass for HSTS. So HSTS is HTTP strict transport security. And what that means is a site can put a header which says, when you speak to me, speak to me via SSL. Your browser will remember that. So when you type something like gmail.com, it'll go directly to HTTPS gmail.com. 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. Now what that screws is Moxie's SSL strip. So SSL strip relies on people hitting HTTP sites first and then preventing it from ever upgrading to SSL. And HSTS is a direct response to that. So what Leonardo worked out is that some places still have to have HTTP jumps. So if you look at google.com. If you typed google.com, it serves it over HTTP and then redirects to HTTPS. The standard thing that SSL strip can deal with. Sorry, I always get SSL strip and split confused. But then within that page, if you click accounts.google and SSL strip will try and rewrite that to HTTP. When you actually make the request, that gets denied. It's only going to serve that stuff over HTTPS because it's got HSTS. 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. So there's no pre-saved HSTS stuff for it. 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. Once again another domain, HSTS doesn't apply. Google seems to have pushed something down or at least came into effect last night, the first time I spotted it. They've actually now got it going over the domain. So we've made some mods that it actually appends the stuff on the end. 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. But it's really nifty for certain places. So it works for Facebook if you go to touch.facebook. It works for Twitter if you go to m.twitter.com. 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. So then we start getting cookies and things that we can use there. Cookies, so creds are really useful. Cookies are also really useful because it gives us auth to sites. FireSheep was fantastic for this. A little Firefox browser extension. It would sniff stuff and you could then just click and log in on the site. It doesn't work anymore so we wrote FireLamb. So that's a lamb rye. 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. So you can just say, okay, show me that guy there. It'll load up Firefox with all that guy's cookies and all the links that he visited. So you can just click on it. Much the same as FireSheep and go there. Okay, so we basically implemented all of this stuff in the Mana toolkit to deal with all of those things. I think we're pretty short of time so I'm not sure how many demos we can go through. How much time do we have? Okay, so we're going to try and go through some of them. These are a lot more manually demos. So they might not work as well. Thank you. Sorry, I just can't get the hang of this Apple. Apologies about that. Right, so if we have a look at a bunch of things. So this is using a malicious cert. 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. Please pick here. 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. There we go. If you scroll down right at the back we give him the option of logging in via Google or... Well, we give him the option of using some overall thing or signing in via Google creds or mail or Twitter or etc etc. But we also provide this nice little link sort of saying please auto-configure and it'll connect automatically. And if we auto-configure that then basically what happens we get prompted to install a specific root CA which has now been installed. There is an icon that comes up which you'll see right at the top left there. You drag down the bar it'll sort of say your communication may be subject interception which is fine, probably good practice. So I'm just waiting for the network to come up again. So yeah, here it says network may be monitored. But in any case now if I go to accounts.google.com Let's enter. We're actually going to get to... but it works one time, sorry. It's almost as slow as South African internet. But we're actually getting to Dominic's personal information over there. So we've actually had access to his Gmail account. And we're man in the middling so you're getting the full... Got the full clear text from SSL strip, etc, etc, etc. Right, other one which is... I'm going to skip FireLAM. So FireLAM is not working so well just yet. But basically FireLAM will extract the stuff from SCAPI and also from the files that we collect as the program is run. And you can literally go along and fire it up. And these are all the sites selected for a specific user. So this is literally just pulled out of the log files and pulled out of the network captures. 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. Now this was captured live, so I don't want to show the information that I'm doing here. I'm just changing it to the directory of someone who I've captured. Now I'm just going to do a count of the cookies SQLite database. You'll see there's just one cookie in that database. So that's the schema, that's the actual database schema, and that's the select count star from most cookies. And you'll see we'll get a result of one, which is just very poorly described over there. But in any case that's FireLamb. It's not working perfectly, but it does potentially work. I did some nasty stuff to Dominic this morning. Yeah, Ian announced to me that this stuff was working by posting as me on my Facebook wall saying Hey Dominic, this is Ian. The first person who liked it was his wife. Right, okay. 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. Cleartext. There's so many people running the stuff over cleartext. Either this is man in the middle using SSL split. Right. 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. So it's very poor. Okay. 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. It'll be a lot easier. 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. So the big difference with fire lamb over something like fire sheep is it goes through the SSL interception stuff too. 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. But you also get that. And the other nice thing is that all of this man in the middle stuff can be run not in Wi-Fi. Like if you're trying to man in the middle on physical networks, all of these tools are reusable for there. So you could point fire lamb at x0 if you happen to be ARP spoofing on a LAN or something like that. So it's kind of assembling these things into something that's a little more usable. Alright, so that takes us to, like back to the promise. We were stuck in the desert. Karma stuff wasn't working so well. We didn't have support for secure networks and those credentials. You had to assemble your own man in the middle assemblage which didn't necessarily work so well. There's these new changes coming in from mobile devices which lead to things being a bit more complicated. 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. We've done some of our own research to build some tools which deal with some of these problems. And we've put it together into this thing called the Mana Toolkit. It's on a GitHub repository at the moment. We're going to be releasing it tomorrow when we do this talk at DEF CON May. I'll have the demos working properly from Windows. But if you're looking for them, it'll be at github.com forward slash sensepost. We split it up so there's a bunch of repositories. If you just wanted FileM or something like that. But there's also a global repository. We'll put a blog entry up on sensepost.com. 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. So that's us. Thank you very much for your time and patience.