1 00:00:00,000 --> 00:00:05,980 All right. My name is Peter. My talk is called exchanging demands. I'm going to be 2 00:00:05,980 --> 00:00:10,800 talking about the relationship that exchange servers tend to have with their mobile device 3 00:00:10,800 --> 00:00:19,420 clients and how poorly implemented those things can be on the client side. Closer? No 4 00:00:19,420 --> 00:00:28,420 problem. Fine. All right. And the relationship that these can have with the clients and how 5 00:00:28,420 --> 00:00:33,500 badly that's really done when it gets to using these things. So for a start, let's go into an 6 00:00:33,500 --> 00:00:39,300 introduction about me. You know, I'm a pretty big fan. So who am I? Like I said, my name is 7 00:00:39,300 --> 00:00:44,200 Peter Hanay. I'm a lecturer at a university called Edith Cowan University in Perth, Western 8 00:00:44,200 --> 00:00:53,840 Australia. Quite far away. About 28 hours to get here. Yeah. Great trip. I teach a few 9 00:00:53,840 --> 00:00:58,400 different subjects. So network security, computer forensics, and I teach a lot of 10 00:00:58,420 --> 00:01:03,160 stuff. And recently I had a unit approved called ethical hacking. I had to put the ethical in 11 00:01:03,160 --> 00:01:08,160 there to get it approved. But I teach my guys how to pop boxes. So I'm pretty happy that that 12 00:01:08,160 --> 00:01:13,240 got through. All right. In terms of my research, small device forensics. So pulling apart 13 00:01:13,240 --> 00:01:18,800 things like phones and routers and video game consoles. Figuring out holes and how I can 14 00:01:18,800 --> 00:01:24,480 acquire data and do data analysis on those. You know, interesting stuff. Not really, I guess a 15 00:01:24,480 --> 00:01:28,400 bit relevant to this but not tons. I'm a hacker. I love just breaking things. I'm a hacker. I'm a 16 00:01:33,960 --> 00:01:40,880 pen tester. I'm also a white hat seller. I like getting paid. It goes well for me. It's a good 17 00:01:40,880 --> 00:01:46,000 thing. And last of all, you know, I'm sure I've got other attributes, but, you know, here we go. 18 00:01:46,260 --> 00:01:50,680 I'm a Ph.D. candidate. Due to complete in the next couple of months. And then I'll be talking 19 00:01:50,680 --> 00:01:58,280 down to you all and it's like that's Dr. Peter. Yeah. So that will happen. All right. So 20 00:01:58,280 --> 00:02:02,160 my interests. I mentioned breaking things. So first and foremost, you know, the hacker 21 00:02:02,160 --> 00:02:06,320 attitude. Let's break some stuff. Let's figure out how it works. Let's make it better. Let's just 22 00:02:06,320 --> 00:02:14,800 make it do something it's not supposed to. Into that, I also love laser tag. Yeah. Now, a lot of 23 00:02:14,800 --> 00:02:20,360 people don't know this. There are international organized laser tag competitions. You know, a 24 00:02:20,360 --> 00:02:24,840 couple of the guys on my team recently went to the international finals in New York and stuff like 25 00:02:24,840 --> 00:02:28,260 that. So there is a thing there. And, you know, the interest in laser tag competition is a thing. 26 00:02:28,260 --> 00:02:31,920 It is competitive laser tag. So you should all be aware of that and go play some laser tag. 27 00:02:32,500 --> 00:02:41,560 Cats. I love my cats. So we've got the pale one is Alice. And the darker one is Ada. Named 28 00:02:41,560 --> 00:02:47,460 after Ada Lovelace. Not the programming language. The woman. So that's okay. All right. So 29 00:02:47,460 --> 00:02:53,700 really into the talk now. You now pretty much know everything there is to know about me. Yeah. 30 00:02:53,800 --> 00:02:58,240 I'm very efficient. Okay. So a quick note first about what this is all about. I'm going to 31 00:02:58,240 --> 00:03:02,400 talk. I looked for a place I could put this info in the talk and nowhere seemed really to fit. 32 00:03:02,540 --> 00:03:09,060 So I'll start at the beginning. I'm not dropping mad O days or anything here. There is no bug. 33 00:03:09,240 --> 00:03:13,700 There is no vulnerability as such. There are some poorly implemented protocols and what I 34 00:03:13,700 --> 00:03:18,880 consider to be very poorly put together UIs. Which lead to a situation where an attacker can do 35 00:03:18,880 --> 00:03:25,540 some incredibly nasty stuff to people who are using exchange clients on their mobile devices. 36 00:03:25,840 --> 00:03:28,220 Okay. That's what this is about. You know, if there's no buffer over the phone, there's no 37 00:03:28,220 --> 00:03:33,080 close. There's nothing like that. And that's probably the strength of the talk. Anyone could 38 00:03:33,080 --> 00:03:37,700 have done this if they know how to operate Wireshark and write about 30 lines of Python. That's 39 00:03:37,700 --> 00:03:45,540 why it's a problem. So that's it. Not late. Not hard to do. No amazing bugs. No O days. But the 40 00:03:45,540 --> 00:03:53,220 stuff happens. And it works. All right. So I like stories. I'm a big fan of narrative. And I'm 41 00:03:53,220 --> 00:03:57,740 going to try and structure this into the form of a story. But I've never been good at writing these 42 00:03:57,740 --> 00:04:02,080 things. So you're going to notice we swap tenses and, you know, pronouns and things are going to be 43 00:04:02,080 --> 00:04:08,060 all wrong. But hopefully it will be interesting. So here's our setting. This is post pen test 44 00:04:08,060 --> 00:04:12,080 drinks with the client. You know, I'm sitting down with this guy Friday afternoon having 45 00:04:12,080 --> 00:04:16,680 drinks. He's read through the technical draft of the report. And, you know, this is a high up 46 00:04:17,120 --> 00:04:20,960 manager. He doesn't really understand it. You know, he's just flicked through it. One of his 47 00:04:20,960 --> 00:04:26,640 minions has advised him on some questions to ask. Anyway, so the question comes up. So if you own 48 00:04:26,640 --> 00:04:32,560 the active directory server, what exactly can you do? All right. And we know this. But, you know, 49 00:04:32,580 --> 00:04:38,000 this is a non-technical guy. So that's okay. And when it comes to this, yeah, it's the normal 50 00:04:38,000 --> 00:04:42,720 thing you'd expect. You control every user on the domain. You have the ability to push policy 51 00:04:42,720 --> 00:04:47,620 updates to every controlled machine. You know, you can do pretty much whatever you want on that 52 00:04:47,620 --> 00:04:54,720 network. But what came up that this guy mentioned was, like, well, I know I can remotely wipe 53 00:04:54,720 --> 00:04:58,600 phones for exchange, like when we've had phones stolen. We've done that. Could you do that if 54 00:04:58,600 --> 00:05:05,000 you compromised AD? Of course. You know, that would be doable. But here's where it got 55 00:05:05,000 --> 00:05:12,300 interesting. The idea was, do we really need exchange in order to be able to wipe all these 56 00:05:12,300 --> 00:05:16,480 devices? I mean, really, it's just, you know, TCP IP. It's just connection states. It's just, 57 00:05:16,480 --> 00:05:20,480 you know, please wipe yourself now being pushed from a server somewhere. Why couldn't we 58 00:05:20,480 --> 00:05:24,700 implement that ourselves? All right. And now here's the time for my first question. You're 59 00:05:25,100 --> 00:05:34,220 actually, first of all, first time DEF CON speaker, so here we go. Thank you. All right. 60 00:05:35,060 --> 00:05:40,820 And now it's your turn. So I just ‑‑ who here runs an exchange server? There's a few. 61 00:05:40,920 --> 00:05:46,340 Black Hat was just, like, you know. All right. So these ‑‑ just keep your hands up for, 62 00:05:46,380 --> 00:05:51,180 like, ten seconds so these guys can spot you. . 63 00:05:54,720 --> 00:05:59,400 All right. So this shot's going out. That's fine. . 64 00:06:02,540 --> 00:06:09,340 All right. Just a few. There will be more going through. . All right. So I'll 65 00:06:09,340 --> 00:06:13,400 just continue while these guys bring around a few shots. Do we really need exchange? 66 00:06:14,400 --> 00:06:20,540 Probably not. Maybe we just send the phone these commands directly. Maybe we just wait for a 67 00:06:20,540 --> 00:06:24,380 connection, do a man in the middle somehow. You know, man in the middle is easy. There's a 68 00:06:24,380 --> 00:06:29,440 different ways to do it. But maybe we just send the phone these commands. Thanks. And see 69 00:06:29,440 --> 00:06:37,000 what happens and see how it goes. But really, thinking about it, if it were just as easy as 70 00:06:37,000 --> 00:06:40,360 capturing a couple of packets and replaying them to a phone to have the phone just wipe 71 00:06:40,360 --> 00:06:48,360 itself, there will be more later. Don't worry. . Okay. But it couldn't possibly work, 72 00:06:48,420 --> 00:06:52,480 surely. There's going to be something to stop it from happening. We can't just replay, like, a 73 00:06:52,480 --> 00:06:57,400 packet and all the phones erase themselves. That would be ridiculous. It couldn't be that 74 00:06:57,400 --> 00:07:04,580 easy. It really couldn't. No. I'm sorry. Okay. Surely we've got SSL. That if nothing else, 75 00:07:04,620 --> 00:07:09,300 SSL is going to stop this from working. Like, you know, it's going to go, that's not, no. 76 00:07:10,820 --> 00:07:16,120 Surely. But in addition to SSL, let's just assume we're going to have something else. And it's 77 00:07:16,120 --> 00:07:19,740 probably a good assumption. In most cases it would be. If you had a server that could push out 78 00:07:19,740 --> 00:07:22,460 all these sort of commands, there's going to be some sort of extra thing that's going to happen. 79 00:07:22,480 --> 00:07:26,000 Extra secure exchange, some sort of stored secrets, you know, just something. You sort of 80 00:07:26,000 --> 00:07:31,200 logically think about it and think there's got to be something in there. All right. So I'm not a 81 00:07:31,200 --> 00:07:36,840 Windows guy. I'm not a, you know, exchange server admin. I'm not a, yeah, that's not me. But I 82 00:07:36,840 --> 00:07:40,880 know people who are. Remember, I work in a university. So I just walk down the hall to the 83 00:07:40,880 --> 00:07:47,240 guy who teaches the Microsoft certification stuff. Which is this guy. Brett Turner. So I have a 84 00:07:47,240 --> 00:07:52,180 chat with him. He's always good. He doesn't drink at all. But, you know, people give 85 00:07:52,180 --> 00:07:57,180 academics bottles of liquor. So it's fun visiting his office. Anyway. So I have a chat with him. 86 00:07:57,880 --> 00:08:03,420 And what he told me was this will work as long as SSL is disabled. If this SSL turned on, you've 87 00:08:03,420 --> 00:08:09,960 got no chance. Okay. Well, I thought let's just try it anyway. I'll implement it without SSL and 88 00:08:09,960 --> 00:08:13,180 then it's fun and I can demo it to my students at least. And then I'll see if it does work with 89 00:08:13,180 --> 00:08:17,920 SSL or where the actual mitigation is. At this point really what I was thinking is on every phone 90 00:08:17,920 --> 00:08:21,360 that I try, I'm probably going to get a pop up box saying the certificate has changed. Do you 91 00:08:21,360 --> 00:08:25,340 want to continue? Yes, no or something like that. And I thought I can probably, you know, 92 00:08:25,740 --> 00:08:30,720 change the name of the CA or something to make it look like please click this button, you know. 93 00:08:31,100 --> 00:08:35,580 That's what I was thinking at that point. But, you know, I'm sure we could do something about 94 00:08:35,580 --> 00:08:42,300 it. So I thought let's get started. Let's try and make these things work. So, first of all, 95 00:08:43,780 --> 00:08:48,380 exchange. Let's get some packet dumps. Let's set up an exchange server, connect some clients to 96 00:08:48,380 --> 00:08:51,340 it. Fire up Wireshark. Grab the packet dumps. Let's set up an exchange server, connect some 97 00:08:51,360 --> 00:08:59,360 packets and see what we can see. See how these things work exactly. Great idea. So I figure, I've 98 00:08:59,360 --> 00:09:08,880 installed post fix. Yeah. I've installed send mail. You know, I'm a Linux kind of guy. And 99 00:09:09,420 --> 00:09:21,340 everyone is like, well, yeah, Windows is easy, right? No. It's really, it's horrible. Yeah, 100 00:09:21,360 --> 00:09:28,300 it's crap. I can't do this. I downloaded the manuals and stuff. No. All right. But thankfully, 101 00:09:28,480 --> 00:09:34,040 like I said, we've got this guy. He teaches students how to do this stuff. He's all busy and 102 00:09:34,040 --> 00:09:40,420 wouldn't do it. But what I had was I had some students hanging around. These were students of 103 00:09:40,420 --> 00:09:50,220 his. They, you know, do Microsofty stuff. Cool. The two on the left and two on the right, 104 00:09:51,360 --> 00:09:56,800 I think, are nationwide capture the flag competition run by government for university 105 00:09:56,800 --> 00:10:00,560 students in Australia. Anyway, so I trained these guys up. You know, they entered the 106 00:10:00,560 --> 00:10:05,220 competition, you know, really were doing very well and then came second. But second in 107 00:10:05,220 --> 00:10:09,960 Australia is still good, right? And I'm breaking into this because the first prize was a 108 00:10:09,960 --> 00:10:15,100 ticket to Black Hat and Def Con. And so, you know, I've had drinks with the team that did win 109 00:10:15,100 --> 00:10:19,100 and I've got photos of me with them that I'm going to send to my students. I think that's 110 00:10:19,100 --> 00:10:21,340 nice. So, yeah. So, yeah. So, yeah. So, yeah. So, yeah. So, yeah. So, yeah. So, yeah. So, yeah. So, 111 00:10:22,060 --> 00:10:22,420 yeah. So, yeah. So, yeah. So, yeah. So, yeah. So, yeah. So, yeah. So, yeah. So, yeah. So, yeah. 112 00:10:22,420 --> 00:10:27,620 But, yeah. The second prize and this was a major telecommunications carrier that decided, you 113 00:10:27,620 --> 00:10:33,260 know what every hacker wants, you know, the second prize? They want an iPad. Yeah. So let's 114 00:10:33,260 --> 00:10:38,480 give them iPads. You know, all I'll say is, again, when I did this at Black Hat, everyone 115 00:10:38,480 --> 00:10:44,920 just was like, yeah, they want iPads, right? Anyway, so those were sold like ten minutes 116 00:10:44,920 --> 00:10:50,120 after they got them. But just they are saleable. That's a really good thing. But anyway, so 117 00:10:50,120 --> 00:10:51,320 these are the students I had laying around. They're selling iPads. They're selling iPads. They're 118 00:10:51,320 --> 00:10:54,560 selling iPads. And a couple of them had the MS certs. I was like, can you please install 119 00:10:54,560 --> 00:11:00,700 Microsoft Exchange for me? And, yeah, they understood and they did that. And that was great. 120 00:11:00,780 --> 00:11:04,260 So in about a day and a half I had an Exchange server with all the security options turned off 121 00:11:04,260 --> 00:11:12,960 so I could gather this data and see how it all works. So this is good. So we did some packet 122 00:11:12,960 --> 00:11:18,380 sniffing, all right? And found the packets responsible for the wipe command. And what we 123 00:11:18,380 --> 00:11:21,300 were looking at was a two-stage process. So the first thing we were looking at was the 124 00:11:21,320 --> 00:11:25,860 first part is any request at all. And you can see I've just, like, dotted out the command, 125 00:11:26,100 --> 00:11:30,980 mainly to save space on the slides. But really it's just because this could be any ActiveSync 126 00:11:30,980 --> 00:11:36,760 request coming from a mobile device. It doesn't matter what it is. All right? In this case, I 127 00:11:36,760 --> 00:11:41,760 don't know, probably checking e-mail or something. Doesn't matter. The next step here is the 128 00:11:41,760 --> 00:11:48,220 response to the I want to do anything at all over ActiveSync request. And the response is HTTP 129 00:11:51,320 --> 00:11:57,260 request. I love inventing extra errors. Please retry after a provision command. I can't really 130 00:11:57,260 --> 00:12:02,600 read it down here so I'm pretty sure that's what it says. And what that does is it's basically 131 00:12:02,600 --> 00:12:08,120 saying I'm not going to talk to you or answer your request until you request a policy update and 132 00:12:08,120 --> 00:12:13,580 adopt a policy update from the server. Okay? So this is the first part of it. And generally the 133 00:12:13,580 --> 00:12:17,560 device will make four or five requests of different types before it goes, okay, I'm giving up. 134 00:12:17,640 --> 00:12:21,300 I'm going to send a provisioning request. And that's when we get this part. So this is the first 135 00:12:21,300 --> 00:12:26,160 part. So this is again just another request saying, hey, I've given up. Please send me the new 136 00:12:26,160 --> 00:12:35,680 policy. Here's the format I want it in. And it wants it in WB XML. And great. So we reply. And we 137 00:12:35,680 --> 00:12:42,020 say, well, here's your new policy update. Here's what you are going to do. Here's what you're 138 00:12:42,020 --> 00:12:45,800 going to adopt. Now this really doesn't mean much. It's a binary protocol. So you can see the 139 00:12:45,800 --> 00:12:49,200 header and after that it's just, you know, the periods which represent any of, you know, 70 140 00:12:50,140 --> 00:12:50,860 possible bytes. 141 00:12:51,380 --> 00:12:56,700 More than 70, you know. So it's a binary protocol. So we want to look at it in some sort of 142 00:12:56,700 --> 00:13:02,080 hexadecimal format and try to figure out what it does. But thankfully Microsoft published a very 143 00:13:02,080 --> 00:13:06,620 nice spec on how to decode these things. So it wasn't really too hard. So we managed to decode 144 00:13:06,620 --> 00:13:10,600 it. And there's a reason it's binary. It's not obfuscation. It's not, you know, trying to hide 145 00:13:10,600 --> 00:13:14,520 anything. It's just these are things you're pushing to mobile devices. So if you can save two, 146 00:13:14,640 --> 00:13:21,280 300 bytes, you're doing a good job. So I'm a big fan of it. You know, it's efficient. It's, you 147 00:13:21,820 --> 00:13:26,500 know, semi well documented. And it's a pretty awesome protocol overall. So the idea is they 148 00:13:26,500 --> 00:13:34,240 just implemented XML in a binary format to save space. So if we decode it, we end up with 149 00:13:34,240 --> 00:13:40,700 something that looks a little bit like this. Now there's a few options here that come into this 150 00:13:40,700 --> 00:13:44,180 policy thing. You can probably read some of them. That's fine. I'm going to read them off and 151 00:13:44,180 --> 00:13:49,200 there's a bigger slide with them later. Essentially you can do a few things. You can set timeouts for 152 00:13:49,200 --> 00:13:51,260 screens going inactive and saying, you know, what's going on. So that's a little bit more of a 153 00:13:51,280 --> 00:13:55,880 thing. There's a maximum of one millisecond of no use before your screen turns black. You know, 154 00:13:55,920 --> 00:14:00,540 you can turn off Wi-Fi remotely. And especially on, like, a Wi-Fi only iPad or something like 155 00:14:00,540 --> 00:14:05,420 that, if you push a policy saying to turn Wi-Fi off, it's very, very difficult to push another 156 00:14:05,420 --> 00:14:11,360 policy to allow it to be turned back on. Yeah. That was a bad decision I made when 157 00:14:11,360 --> 00:14:17,300 playing with it. Okay. Yeah. There's a lot of other things. You can set minimum 158 00:14:17,300 --> 00:14:20,780 password lengths up to, you know, a couple hundred characters. You know, there's a lot of cool 159 00:14:20,780 --> 00:14:26,020 things in there that might be useful. That, of course, are useful in a corporate deployment. But 160 00:14:26,460 --> 00:14:32,100 if someone were to get control of them, they could be troublesome or potentially unhappy making 161 00:14:32,100 --> 00:14:37,240 for a particular user. And the one I chose for this demo, and certainly we can do a lot of 162 00:14:37,240 --> 00:14:44,440 things with this if it works. Let's see. But the one I wanted to give for the talk as a demo was 163 00:14:44,440 --> 00:14:49,980 this remote wipe command that's in there. Because I figure that makes a good demo, you know. It's 164 00:14:49,980 --> 00:14:55,040 better than, hey, look, now the screen timeout is real fast. The device is erasing itself. Okay. 165 00:14:55,080 --> 00:15:02,820 So we'll see that a little later on as long as my demo succeeds. Hopefully. All right. So we're 166 00:15:02,820 --> 00:15:08,640 going to talk a little bit about the background of this now. So here's the structure that we have 167 00:15:08,640 --> 00:15:15,960 when we look at an active sync session, you know, IIS and the exchange server on the back end and 168 00:15:15,960 --> 00:15:19,960 OWA there. And what you can see is that there's a relationship. So, you know, there's an 169 00:15:19,980 --> 00:15:27,280 exchange talks to IIS and IIS essentially has, you know, two subsites. One is active sync and the 170 00:15:27,280 --> 00:15:32,780 other is OWA and that's how your mobile devices and your web clients talk to exchange. And, you 171 00:15:32,780 --> 00:15:36,420 know, there's all this data exchange back and forth. But this is how it all goes together. So 172 00:15:36,420 --> 00:15:41,700 what we're doing is we're targeting that little bit that connects the phone to the active sync 173 00:15:41,700 --> 00:15:45,100 thing. That's where we're inserting ourselves when we're going to man in the middle. That's the 174 00:15:45,100 --> 00:15:49,560 part of the protocol where we're going to try and deal with. So it's that sort of last mile to the 175 00:15:49,560 --> 00:15:49,960 mobile device. So that's where we're going to try and deal with. So it's that sort of last mile to the 176 00:15:49,960 --> 00:15:53,900 mobile device. And that's what we're looking at and that's what we've been looking at so far. The 177 00:15:53,900 --> 00:16:04,460 rest of it is, you know, just neither here nor there. Okay. So. Now this thing that I, you know, 178 00:16:04,460 --> 00:16:11,200 did the manual decode on, it's in a format called, you know, active sync binary XML. And it's 179 00:16:11,200 --> 00:16:17,880 an interesting protocol. There's a lot of extra functionality in there. There's things I'll talk 180 00:16:17,880 --> 00:16:19,940 about those later. But let's get on to the implementation. So the first thing we're going to 181 00:16:19,940 --> 00:16:20,140 look at is the 182 00:16:20,140 --> 00:16:25,380 application implementation. So we can man in the middle devices. Now the easiest way to man in the 183 00:16:25,380 --> 00:16:31,980 middle something, there's a great Wi-Fi network here. Okay. I'm not going to talk on how you might 184 00:16:31,980 --> 00:16:38,280 man in the middle something on open Wi-Fi too much. I mean I'm sure there's like 20 talks you 185 00:16:38,280 --> 00:16:45,520 can go to or you know, just Google it. You're going to be fine. So phones are cool. Wi-Fi is 186 00:16:45,520 --> 00:16:51,060 cool. Phones have got Wi-Fi. We're going to do the Wi-Fi angle. We're going to impersonate a 187 00:16:51,060 --> 00:16:56,320 server and see what we can do to the phone. You can use art poisoning. How many people are 188 00:16:56,320 --> 00:17:03,900 familiar with the Wi-Fi pineapple? Anyone? Yeah, we've got people. Where's my helpers? Drinks. 189 00:17:12,480 --> 00:17:22,520 Good, good. Geez, that's some cheap tequila. All right. Okay. So what the Wi-Fi pineapple 190 00:17:22,520 --> 00:17:28,000 does for those not familiar with it is basically it's an embedded router running Linux open WRT 191 00:17:28,000 --> 00:17:33,880 and it supports a few things. But what I'm using it for is the idea that it listens for 192 00:17:33,900 --> 00:17:37,560 probe requests from, you know, your laptops, your phones, saying I'm looking for my cool home 193 00:17:37,560 --> 00:17:43,400 Wi-Fi or my work Wi-Fi or whatever else. And the pineapple goes, yeah, that's me. Brilliant 194 00:17:43,400 --> 00:17:47,380 device. I'm in no way claiming responsibility for it. Just saying it was a very easy way for me 195 00:17:47,380 --> 00:17:52,700 to implement and demo this. Okay. And I think it's ideal. You know, it's battery powered, too, 196 00:17:52,760 --> 00:17:55,880 and it runs Linux so you can put the whole attack on it and just throw it in a backpack or 197 00:17:55,880 --> 00:18:01,660 something. It's a pretty good device. So that's the platform I use for testing. Now as for 198 00:18:01,660 --> 00:18:03,760 the target selection, I'm going to show you how I use it. I'm going to show you how I use it. 199 00:18:03,760 --> 00:18:09,940 I decided to have a look at these guys. So we've got Android. We have iOS and we have Windows 200 00:18:09,940 --> 00:18:17,360 phone. So the most common mobile platforms are what we're going to look at. And, you know, we've 201 00:18:17,360 --> 00:18:23,140 got different degrees of success. So let's try and do a wipe. All right. And by the way, when I 202 00:18:23,140 --> 00:18:28,420 get to the demo, I'm doing my demo live because last time I, you know, tried to rehearse the demo 203 00:18:28,420 --> 00:18:33,740 and do a recording, I messed my phones up so bad that I couldn't do the live demo. So I'm going to 204 00:18:33,740 --> 00:18:39,100 do a live demo. If it works, awesome. All right. So the dance. We're going to wipe some stuff. 205 00:18:39,400 --> 00:18:43,020 How are we going to do it? Well, first of all, we're going to accept a connection. And if we're 206 00:18:43,020 --> 00:18:48,600 accepting a connection and we're accepting a connection over SSL, we need a shonky, self-signed 207 00:18:48,600 --> 00:18:53,320 SSL certificate. And I thought, you know, I'm not going to try it. Originally I was thinking, 208 00:18:53,420 --> 00:18:57,080 you know, I can accept it, I can look at the header, I can generate, I can go out and retrieve 209 00:18:57,080 --> 00:19:01,180 the real certificate, then generate a new certificate where all the fields match. The only 210 00:19:01,180 --> 00:19:03,720 thing is it's self-signed rather than signed by a CA. You can make it look like a real certificate. 211 00:19:03,740 --> 00:19:08,460 Really good. And then I thought, okay, I'll do that if I really, really have to. But I'm a lazy 212 00:19:08,460 --> 00:19:13,340 guy. So I thought I'll just generate, you know, a really simple one. And, you know, this is 213 00:19:13,340 --> 00:19:19,820 essentially what it was. You know, you see it's lols.lols. You know, that's a Photoshop there 214 00:19:19,820 --> 00:19:25,380 because the actual certificate name was incredibly profane. But, yeah, I just basically 215 00:19:25,380 --> 00:19:29,100 matched buttons, filled out all the fields finally. The domains don't match. You know, this 216 00:19:29,100 --> 00:19:33,720 is a completely invalid certificate. Probably the only valid thing about it is the fact that it's 217 00:19:33,720 --> 00:19:39,540 expired in the future. That's it. Okay? Everything else is wrong with this. It doesn't match 218 00:19:39,540 --> 00:19:44,100 anything at all. So this is pretty much the worst certificate you could have unless you had one 219 00:19:44,100 --> 00:19:51,700 from, like, 1920 or something. Okay. So we accept our connection. And that really shouldn't 220 00:19:51,700 --> 00:19:55,880 work. But let's say it does. If it does work, then the next thing we know is that we need to 221 00:19:55,880 --> 00:20:02,740 send a HTTP error 449. So this is, you know, the Python code to generate that command. It's 222 00:20:02,740 --> 00:20:07,540 just straight from the packet dump aside from the, you know, time, which I had to insert there. 223 00:20:07,600 --> 00:20:11,260 Because when I was playing with it, none of the phones would accept, you know, they'd accept the 224 00:20:11,260 --> 00:20:17,080 dodgy stuff, other things, but they really wanted the time on this provisioning request to be 225 00:20:17,080 --> 00:20:22,780 somewhere near reality. So I did that. So we've got something there. And step three is to send 226 00:20:22,780 --> 00:20:27,160 that wipe command. And I sent exactly the wipe command. You know, the HTTP header for the wipe 227 00:20:27,160 --> 00:20:31,560 command, still I'm using a date that was months and months and months ago. It doesn't care about the 228 00:20:32,740 --> 00:20:40,320 date on the provisioning request. I don't know. It's a little bit odd. All right. So here we go. 229 00:20:41,840 --> 00:20:48,160 Demo time. Please just bear with me for a moment while I turn my phones on and turn Wi-Fi on and 230 00:20:48,160 --> 00:21:01,840 things like that. It's going to be about two minutes. Shots? That sounds good. Hmm. Who has a 231 00:21:01,840 --> 00:21:09,660 telephone on them? Just, just, just forsake the crowd while I set this up. 232 00:21:11,840 --> 00:21:12,820 Ah, here it is. 233 00:21:31,840 --> 00:21:33,180 . 234 00:21:41,200 --> 00:21:42,600 . 235 00:21:47,740 --> 00:21:49,140 . 236 00:21:49,140 --> 00:21:50,160 . 237 00:21:50,160 --> 00:21:50,960 . 238 00:21:50,960 --> 00:21:51,080 . 239 00:21:51,080 --> 00:21:51,280 . 240 00:21:51,280 --> 00:21:53,080 . 241 00:22:02,880 --> 00:22:03,240 . 242 00:22:15,560 --> 00:22:15,920 . 243 00:22:15,920 --> 00:22:16,220 . 244 00:22:17,800 --> 00:22:18,160 . 245 00:22:18,160 --> 00:22:18,180 . 246 00:22:18,180 --> 00:22:18,200 . 247 00:22:18,960 --> 00:22:19,320 . 248 00:22:20,340 --> 00:22:20,700 . 249 00:22:20,700 --> 00:22:20,720 . 250 00:22:20,720 --> 00:22:20,740 . 251 00:22:20,740 --> 00:22:20,760 . 252 00:22:20,760 --> 00:22:20,820 . 253 00:22:26,160 --> 00:22:33,160 I'm a big fan of the fallout series. Anyone play fallout? I was sort of thinking, I'm 254 00:22:33,160 --> 00:22:36,800 coming to Vegas to present this. I just recently enjoyed New Vegas. The name of the proof of 255 00:22:36,800 --> 00:22:43,320 concept is Nuka Cola. So what we'll do, we'll fire the POC code up. There we go. 256 00:23:02,040 --> 00:23:06,660 Yeah. Okay. And back to the phones here. Now, I don't want to wait for them to check 257 00:23:06,660 --> 00:23:10,960 their e-mail. Last time I did that, I ended up, you know, going, why isn't it working? And 258 00:23:10,960 --> 00:23:13,840 they're picking the phone up and the phone erased itself. It was in my hand, not in front of 259 00:23:13,840 --> 00:23:20,800 the... All right. So, first of all, I'm going to show you a couple of things. First of all, 260 00:23:20,820 --> 00:23:25,260 this is what the iPhone does. The iPhone basically comes up with three options, continue, 261 00:23:25,520 --> 00:23:31,760 cancel or details. The continue is highlighted blue and is separate from the others. It's 262 00:23:31,760 --> 00:23:42,920 pretty obvious that if we were a CEO, we'd press continue. Okay. And of course, unlock 263 00:23:42,920 --> 00:23:48,380 the display here. And now we've got the Android phone. Let's go. Where's my corporate e-mail? 264 00:24:03,660 --> 00:24:07,480 There we go. So, the Android is now checking corporate e-mail. Let's hope that works. The 265 00:24:07,480 --> 00:24:17,180 Apple is rebooting, happily. Oh, come on. This is what 266 00:24:17,180 --> 00:24:20,680 happened last time. I'm not going to pick it up. I'm just going to leave it there. Oh, really? An error. 267 00:24:25,940 --> 00:24:29,540 actually attach the antenna to this thing. I didn't want to do that. Don't worry, it's not 268 00:24:29,540 --> 00:24:42,060 spoofing like access stuff at the moment. It's just a... Okay. So the apple is done. 269 00:24:49,480 --> 00:25:01,140 Thank you. So we've got one iPhone there. That's helpful. And you know what? That's 270 00:25:01,140 --> 00:25:12,040 exactly what happened last time. Where are we? That was with? Yes. Okay. Okay. So 271 00:25:17,880 --> 00:25:27,540 let's talk about the results. Who asked that? Do we have any shots left? If we do, there. 272 00:25:49,000 --> 00:26:03,840 Yeah. Actually. Okay. Since I last played with the Android, I hadn't rebooted it. I do some 273 00:26:03,840 --> 00:26:08,340 funky things to them. That's just going to reboot now. When it comes back on, we'll try it 274 00:26:08,340 --> 00:26:12,040 again and you'll see what happens. But I'll just continue for now and talk to you later. 275 00:26:12,060 --> 00:26:17,460 a little bit about, you know, the results that came out of this and sort of which platforms 276 00:26:17,460 --> 00:26:23,820 are vulnerable in which situations. Now when we tested it, I did it in two main ways. First of 277 00:26:23,820 --> 00:26:31,100 all, I tested it with my phones connected to an exchange server which uses SSL with signed 278 00:26:31,640 --> 00:26:36,700 valid, you know, certificates. And then I tested them when they were connected to a legitimate 279 00:26:36,700 --> 00:26:41,420 exchange server with self-signed certificates. And with those self-signed, the ones I used 280 00:26:41,420 --> 00:26:46,320 were the ones that are generated by default when you install an exchange server. Anyway, in our 281 00:26:46,320 --> 00:26:50,980 testing and, you know, surveying and everything else, we found that if you look at small to 282 00:26:50,980 --> 00:26:57,080 medium businesses, we found one in the sample of 100 we looked at that didn't use the default 283 00:26:58,840 --> 00:27:03,620 SSL certificate that exchange generates. So the majority of small to medium businesses are 284 00:27:03,620 --> 00:27:08,420 making use of self-signed certificates. So that was like that case is there. And then we also 285 00:27:08,420 --> 00:27:11,400 tested the other. So I'm going to talk about the other one. So I'm going to talk about the other 286 00:27:31,400 --> 00:27:40,780 one. It's not working. It would help if I left the script running. . 287 00:27:42,080 --> 00:27:45,240 And there we go. . 288 00:27:45,240 --> 00:27:55,980 . Yes. So that was the problem. I wasn't running 289 00:27:55,980 --> 00:28:02,280 the script. . Okay. So I'll just leave that up there. 290 00:28:02,660 --> 00:28:07,740 You know, finish wiping. Oh, there we go. Reset to factory default. So now it's going to spend 291 00:28:07,740 --> 00:28:11,400 about 20 minutes booting for the first time. So that's done there. You know, it keeps coming up. 292 00:28:11,420 --> 00:28:31,320 got really good vision, you can, yeah. So it did work. Yes. It did work. I'm 293 00:28:31,320 --> 00:28:36,940 very happy with that. The last one, the Android wiped itself anyway. It worked. Great. And you 294 00:28:36,940 --> 00:28:40,860 saw both wipes happening. This makes me very, very happy that you saw both of them work, 295 00:28:40,860 --> 00:28:46,700 that it did happen. Great. Okay. So I mentioned that I did testing. So I had mobile phones in 296 00:28:46,700 --> 00:28:53,320 two configurations. The first was connected to self-signed dodgy certs running on an exchange 297 00:28:53,320 --> 00:28:57,360 server, so the exchange server generated ones. And then a server which was using proper CA 298 00:28:57,360 --> 00:29:03,020 signed certs. And the difference, the reason I did this was because there is a difference in the 299 00:29:03,020 --> 00:29:08,920 handling in Android. Basically to use a self-signed certificate in Android without a ton of 300 00:29:08,920 --> 00:29:13,140 messing around, you need to turn on an option which says accept all certificates. Now, a sane 301 00:29:13,140 --> 00:29:17,900 person would think that this meant, you know, accept all certificates when you're connecting to 302 00:29:17,900 --> 00:29:23,760 a new server, but if that certificate changes, you know, during a transaction or just randomly, 303 00:29:23,860 --> 00:29:27,960 that something is probably wrong. No. It really just means all certificates no matter what, 304 00:29:28,100 --> 00:29:33,620 accept. And that's problematic. And I'm sure we can all agree that that is not a good behavior. 305 00:29:35,280 --> 00:29:38,720 Now, if you were using Android with a proper valid certificate, so you 306 00:29:38,920 --> 00:29:42,740 didn't need to turn that option on to use it, so you're, you know, the large enterprise 307 00:29:42,740 --> 00:29:47,160 organization sort of level or you're in a smaller medium with good understanding or you're a home 308 00:29:47,160 --> 00:29:51,160 user who is for some reason running an exchange and knows what they're doing. Whichever. You've 309 00:29:51,160 --> 00:29:54,740 got an admin who knows what they're doing, essentially. Then it doesn't work. It just 310 00:29:54,740 --> 00:29:58,400 displays that communications error, the same one that you saw when I didn't actually have my 311 00:29:58,400 --> 00:30:03,300 script running listening. That's what happens. So if using self-signed in an Android, this will 312 00:30:03,300 --> 00:30:08,280 work. No user interaction required. Nothing else. It just goes to check its e-mail and bam. 313 00:30:09,560 --> 00:30:19,480 Okay. So IOS. In either case, self-signed or legitimate from CA, it will display the same 314 00:30:19,480 --> 00:30:23,800 warning. Cannot verify server identity with the big blue button to continue. And then an 315 00:30:23,800 --> 00:30:31,620 erase works. Now, here's the thing. Windows phone is the only one which did exactly what I 316 00:30:31,620 --> 00:30:37,140 thought it would do. And what it did was if it noticed a self-signed certificate was changing, 317 00:30:37,140 --> 00:30:41,260 and it's actually really hard to use a self-signed certificate on Windows mobile. Windows phone, 318 00:30:41,360 --> 00:30:45,460 rather. You have to go in and manually install that into the phone certificate store and do all 319 00:30:45,460 --> 00:30:50,020 this sort of stuff. And then, of course, when it changes, it's not going to work. Because it's 320 00:30:50,020 --> 00:30:55,380 like, okay, this isn't in my certificate store. And if it uses a valid signed certificate and you 321 00:30:55,380 --> 00:30:58,680 try and swap it for a shonky one, it just goes, no, connection error. It doesn't give you the 322 00:30:58,680 --> 00:31:04,500 option to continue. In that case, what you've got to do is remove the account, you know, install 323 00:31:04,500 --> 00:31:07,840 the certificate into the certificate store, recreate the account and it starts working. And I 324 00:31:07,840 --> 00:31:12,580 think that is good behavior. Because in reality, if you're looking at, you know, a centrally 325 00:31:12,580 --> 00:31:16,800 managed phone, they can push out a new certificate to all the phones two, three months ahead of 326 00:31:16,800 --> 00:31:21,240 time, you know, and then when they make the changeover, everything is okay. To the point, if 327 00:31:21,240 --> 00:31:25,980 you're saying it's a desirable behavior to allow a user to accept a new certificate when it 328 00:31:25,980 --> 00:31:32,140 changes on the fly, it boggles the mind. If you're going to have corporate security features in 329 00:31:32,140 --> 00:31:34,480 there so you can wipe phones remotely, so you can, you know, you can, you know, you can do 330 00:31:34,500 --> 00:31:39,340 that, you know, protect your data, have stuff in there so the user can't just screw it all up by 331 00:31:39,340 --> 00:31:44,880 pressing a button. All right. So in case you couldn't see it on the projector, because I 332 00:31:44,880 --> 00:31:49,820 noticed the iPhone is really, really shiny, you know, this is what the screen looks like. And, 333 00:31:49,820 --> 00:31:55,160 you know, essentially what it's saying, do you really want your e-mail? Yeah? Okay. Well, 334 00:31:57,280 --> 00:32:03,380 continue. Just press the damn button. Okay. And that happens. And, yeah. So we did some testing 335 00:32:03,380 --> 00:32:07,000 just around campus. Handed a phone to people and said check the e-mail and they all pressed the big 336 00:32:07,000 --> 00:32:14,560 button. So we're pretty sure that's what most people are going to do. If you press the 337 00:32:14,560 --> 00:32:24,440 details, it shows the certificate information. If you got a $15 certificate from Go Daddy that 338 00:32:24,440 --> 00:32:30,920 was signed and the domain matched, then sure. That's valid like anything else. The iPhone does 339 00:32:30,920 --> 00:32:33,360 check to make sure the domain matches. That's still a problem. Yeah. So that's what we're 340 00:32:36,520 --> 00:32:42,780 ending up with here. This is how it all happens. Now, I want to talk a little bit about where I 341 00:32:42,780 --> 00:32:47,640 want to take this in the future. Now, certainly it's not just about wiping. If you look back, 342 00:32:48,100 --> 00:32:54,180 back, back, back, back, back. Okay. Any of these requests, you'll notice that the passwords are 343 00:32:54,180 --> 00:33:01,680 base 64 encoded. Okay. So it's just basic auth. So a remote wipe is just a demo of one of the 344 00:33:01,680 --> 00:33:03,360 things you could do. And it's a, you know, it's just a demo of what you could do. And it's a, you 345 00:33:03,380 --> 00:33:06,500 know, it's a pretty good impact. You see the camera. You see it factory resetting. That's great. 346 00:33:06,800 --> 00:33:13,860 By the way, I bricked my demo unit. I just erased my phone to impress you all. So, you know, 347 00:33:13,860 --> 00:33:26,500 thanks. Yeah. So I'll be fixing that up later. All right. So the request has base 64 encoded 348 00:33:26,500 --> 00:33:30,780 passwords using basic auth, which generally wouldn't be a problem because SSL is protecting it. 349 00:33:30,800 --> 00:33:33,160 However, in this case, SSL is not protecting it because of the 350 00:33:33,160 --> 00:33:37,580 shonky implementation. So in essence, we could remote the device. We've got their password. We 351 00:33:37,580 --> 00:33:40,820 can connect to the real exchange server. We can take all their e-mails, all their records, 352 00:33:41,000 --> 00:33:46,420 everything else. You know, this isn't a remote wipe bug. It's just remote wiping is a cool demo 353 00:33:46,840 --> 00:33:50,360 with something you can do with it. You can do anything that involves the active sync protocol, 354 00:33:50,600 --> 00:33:58,040 server or client. So which brings me to this sort of compulsory open source software project 355 00:33:58,040 --> 00:34:03,140 announcement that, you know, you see after most of these talks. I want to, you know, I'm going to 356 00:34:03,140 --> 00:34:07,720 put together a protocol library. I've already started doing a little bit of it to emulate as much of 357 00:34:07,720 --> 00:34:12,900 the active sync protocol as I can. And I'm doing this in Python. There's basically, if you look at 358 00:34:12,900 --> 00:34:17,380 the Android mail client which is open, you can get it all, but it's in Java. I'll probably just 359 00:34:17,380 --> 00:34:24,720 steal that. Someone suggested that to me. And I'll port it to Python and try to implement even the 360 00:34:24,720 --> 00:34:28,240 undocumented stuff. Because I want a really good active sync library because I think there's a lot 361 00:34:28,240 --> 00:34:32,920 of potential for open source projects to integrate well with exchange service. And right now most of 362 00:34:32,920 --> 00:34:41,500 them just don't. Also, you can interact with mobile clients in new ways. Like wiping them. 363 00:34:43,640 --> 00:34:48,360 Okay. And it also could act as a translation layer between exchange clients and other servers. So 364 00:34:48,360 --> 00:34:52,240 you can do some extra validation, implement your own security, you know, implement new features, 365 00:34:52,520 --> 00:34:55,940 that sort of stuff. There's lots of things you can do with something like that. And I'm going to 366 00:34:55,940 --> 00:35:01,820 try and make it happen. Got a couple of people on board, so it's good. All right. Another goal. Data 367 00:35:02,920 --> 00:35:07,800 backup. Active sync as a protocol by its very nature is able to retrieve, you know, data in both 368 00:35:07,800 --> 00:35:11,580 directions. So rather than sending a wipe command or just connecting to the server and taking all 369 00:35:11,580 --> 00:35:16,700 their e-mails, we can also connect to the client and synchronize any of the locally stored 370 00:35:16,700 --> 00:35:20,760 folders in the mail client. So any drafts for e-mails that haven't been sent yet and haven't 371 00:35:20,760 --> 00:35:26,080 been synchronized, any local sent items, if those aren't being synchronized, we can grab a whole 372 00:35:26,080 --> 00:35:30,580 bunch more data back off. However, I've seen some deployments which feature remote backup 373 00:35:32,020 --> 00:35:32,900 functionality. And I'm going to show you how to do that. And I'm going to show you how to do that. And I'm 374 00:35:32,920 --> 00:35:37,780 looking into is how these things really work because there's potential that we could possibly get 375 00:35:37,780 --> 00:35:41,920 more data off the devices than what's in the mail client. Maybe we can get their photos. Maybe we can 376 00:35:41,920 --> 00:35:46,040 get other things. Maybe we can pull much, much more information off these devices. And this is a 377 00:35:46,040 --> 00:35:50,060 goal I haven't, you know, started on it yet, but it's something I really want to do because I feel 378 00:35:50,060 --> 00:36:01,000 this is potentially devastating. Yeah? As in? So once you can backup something, you have the data 379 00:36:02,920 --> 00:36:12,900 simulated. Yes? And you have all of that there. Or you have their unique ID on there even though 380 00:36:12,900 --> 00:36:24,120 it's not unique. Absolutely. No. Yeah. I can see that happening. And I don't feel it would be a huge 381 00:36:24,120 --> 00:36:32,900 issue. Or how has security people been dealing with this? Ah, right. Defensive. Sorry. I'm just 382 00:36:32,920 --> 00:36:37,420 wondering. I see where you're coming from now. No, no. So I was very confused. I was just 383 00:36:37,420 --> 00:36:47,340 thinking, how is this a problem? So I understand completely where you're coming from now. My 384 00:36:47,340 --> 00:36:55,580 strong recommendation would be use science certificates and don't use IOS. And just 385 00:36:55,580 --> 00:36:59,000 standard stuff, you know, monitor where your connections are coming from. If it all comes over, 386 00:36:59,100 --> 00:37:02,900 you know, a single telco provider that your corporation sent users. Do you want to do a 387 00:37:02,920 --> 00:37:06,840 little bit of that? There's a functionality to push out to disabling Wi-Fi to any of these 388 00:37:06,840 --> 00:37:11,160 devices. So it's just pushing out an update to disable Wi-Fi on every single one of these things. 389 00:37:11,320 --> 00:37:17,120 Because it's a weak point. As we've seen, you know, the DEF CON secure Wi-Fi is ownable. There 390 00:37:17,120 --> 00:37:22,160 is no secure Wi-Fi. Do not allow it to exist in your corporate networks. And a lot of the problem 391 00:37:22,160 --> 00:37:32,900 goes away. Absolutely. I'm not a big fan of this stuff. I'm not a big fan of this stuff. 392 00:37:32,920 --> 00:37:37,740 I'm not saying they're not going to be really angry. I'm just saying that's how I deal with it. 393 00:37:37,920 --> 00:37:42,200 And, you know, aside from that, maybe give everyone in marketing a Windows phone. I don't 394 00:37:42,200 --> 00:37:47,400 know. Really, you've just got to look at it and see what fits your organization. You can 395 00:37:47,400 --> 00:38:02,580 probably get hard and stuff to do that. Yeah? I am what do I think about bring your own 396 00:38:02,580 --> 00:38:09,980 device, BYOD. I am a big opponent of it. I feel that if you're allowing untrusted devices into 397 00:38:09,980 --> 00:38:13,960 your network, the whole idea of perimeter security is gone. And perhaps perimeter security 398 00:38:13,960 --> 00:38:17,380 shouldn't be relied upon. And, you know, it certainly should be a line of defense. It 399 00:38:17,380 --> 00:38:22,000 shouldn't be your only line of defense. But I think if you're, you know, if you put it into 400 00:38:22,000 --> 00:38:25,860 military terms, it would be like, yeah, sure, we allow the enemy into our base sometimes. 401 00:38:26,120 --> 00:38:32,460 But, you know, it's mostly we don't do it often. And, you know, if it does, it's only a 402 00:38:32,580 --> 00:38:38,120 you know, because, you know, people want to bring their friends. No. I really don't believe 403 00:38:38,120 --> 00:38:51,940 in BYOD at all. Yep. Yes. Same result. Yep. Okay. I've got one more goal. And then I do 404 00:38:51,940 --> 00:38:57,600 some thanks and a conclusion and there's more shots and, yeah. So my lofty goal is ongoing 405 00:38:57,600 --> 00:39:02,320 access. There are a few configuration options that you can push through with ActiveSync. One of 406 00:39:02,320 --> 00:39:02,560 them is on-going access. There are a few configuration options that you can push through with 407 00:39:02,580 --> 00:39:06,200 ActiveSync. One of them is to change the outgoing mail server. And, you know, this is 408 00:39:06,200 --> 00:39:15,440 necessary in some deployments such as, you know, yeah. So you might want to change your outgoing 409 00:39:15,440 --> 00:39:19,600 mail server because they have to use their ISPs, SMTP server or something weird. But you can 410 00:39:19,600 --> 00:39:22,900 push that as a policy update down there. So essentially we could have persistent access to 411 00:39:22,900 --> 00:39:27,080 all their outgoing mail from that device. What I want to know is, is there anything undocumented 412 00:39:27,080 --> 00:39:31,360 in there? Could we perhaps say, and it would make sense from an administration point of view, 413 00:39:31,420 --> 00:39:32,560 that there might be a feature in there that we can push through with ActiveSync. So we could 414 00:39:32,560 --> 00:39:36,100 have a feature in there somewhere undocumented because it's not in the doco that says from now 415 00:39:36,100 --> 00:39:39,960 on use this server instead for everything. You know, something like that. I want to see if there's 416 00:39:39,960 --> 00:39:43,880 a way to get decent ongoing access and I want to try and implement that so we can have sort of a 417 00:39:43,880 --> 00:39:50,540 persistent man in the middle after they've left our area of influence. And, you know, like I 418 00:39:50,540 --> 00:39:54,900 said, there's nothing hard about this. It's just making use of the protocol. And it's all 419 00:39:54,900 --> 00:40:00,360 possible due to poor implementations of SSL and giving the user too much control over things that, 420 00:40:00,420 --> 00:40:02,540 honestly, and, you know, there's a lot of things that, you know, there's a lot of things that, you 421 00:40:02,540 --> 00:40:07,800 know, honestly, I would prefer I didn't even have access to that. You know, maybe when I'm at the 422 00:40:07,800 --> 00:40:10,820 server console or whatever, but an end user shouldn't be able to just go mash and go 423 00:40:10,820 --> 00:40:22,880 securities lane. It's not a good idea. All right. So in conclusion, this is a problem. And I 424 00:40:22,880 --> 00:40:27,460 just want to reiterate ‑‑ thank you. I just want to reiterate again that this is not a 425 00:40:27,460 --> 00:40:31,640 vulnerability in exchange. It is not server side. This is just a problem with that last mile 426 00:40:31,640 --> 00:40:36,500 active sync connection to the mobile devices. Okay? It's just bad implementation on the client 427 00:40:36,500 --> 00:40:43,260 side. There's, like I said, nothing great about it. It's ‑‑ yeah, pretty much. All right. So 428 00:40:43,260 --> 00:40:48,480 some thoughts. I've been ‑‑ I noticed this code came up when I was sort of Googling to try and 429 00:40:48,480 --> 00:40:52,180 find out if anyone had presented something like this before at a hacker con because I didn't want 430 00:40:52,180 --> 00:40:56,500 to be the guy who's, you know, the first person in the audience says, isn't this the same thing 431 00:40:56,500 --> 00:41:01,620 I did seven years ago? Okay. So I looked around and what I found was this piece of code that was a 432 00:41:01,640 --> 00:41:05,580 piece of code here. A few years ago ‑‑ this is Android code, by the way. Someone threw this 433 00:41:05,580 --> 00:41:09,480 all up on a news site and got all happy and they're, like, Google has access to remotely wipe 434 00:41:09,480 --> 00:41:13,720 your devices if they don't like you anymore. Ah. Okay. That's not what this code is if you look 435 00:41:13,720 --> 00:41:17,620 through the context. What this code is is that they're trying to sell a competing product, the 436 00:41:17,620 --> 00:41:21,780 Google apps for business. So if you're connected to a Google apps for business server, it has a 437 00:41:21,780 --> 00:41:25,840 lot of the exchange‑like functionality in it. And remote wipe is one of those pieces of 438 00:41:25,840 --> 00:41:30,520 functionality. Now, I haven't had time to properly investigate this or implement it, but this is the 439 00:41:30,520 --> 00:41:31,620 code responsible for it. So I'm going to go ahead and show you what this code is. I'm going to go 440 00:41:31,620 --> 00:41:40,140 over it. And if you have a look at that if statement, I really don't like what I see. Yeah. I 441 00:41:40,140 --> 00:41:44,680 can't imagine that works incredibly well. And I think with some basic DNS spoofing, we might be 442 00:41:44,680 --> 00:41:48,620 able to achieve the same result. However, like I said, it's untested. So don't quote me on 443 00:41:48,620 --> 00:41:52,860 saying that it works. I'm saying it might possibly work. I'll look at it later. And I'd 444 00:41:52,860 --> 00:41:57,760 encourage you to look at these sorts of things, too. It's really not that hard. Like, the whole 445 00:41:57,760 --> 00:42:01,600 proof of concept is 40 lines of Python. And most of that is, you know, the code itself. So it's 446 00:42:01,600 --> 00:42:07,540 just, you know, the twisted connection handling stuff. It's very simple. You know, you could grab 447 00:42:07,540 --> 00:42:13,360 out a programming book and a Wireshark book and in a day be able to do this stuff. It's really, 448 00:42:13,460 --> 00:42:21,120 really simple. Okay. So I've got some thanks to these wonderful people here who either helped me 449 00:42:21,120 --> 00:42:27,160 set up an exchange server, loaned me hardware, let me wipe their phones. Really good guys. 450 00:42:27,780 --> 00:42:31,580 You know, shout outs to the guys in the various IRC channels there. I'm going to go ahead and show 451 00:42:31,580 --> 00:42:38,440 them. Yeah. Just want to say thanks to those guys. They helped a lot in my work in terms of, you 452 00:42:38,440 --> 00:42:43,520 know, providing the things that I needed, reviewing my poor writing, that sort of stuff. So if 453 00:42:43,520 --> 00:42:45,660 I could get some cheers for those guys, that would make me happy. 454 00:42:53,540 --> 00:42:59,540 All right. Thank you. Okay. So thank you for listening to me. And I'd like to say thanks to the 455 00:42:59,540 --> 00:43:04,400 DEF CON guys. You know, I've been a fan of DEF CON since I was like 12. And it's been a dream to 456 00:43:04,400 --> 00:43:08,580 speak here. So I'm pretty happy right now. It's really, really good. Thanks.