1 00:00:00,000 --> 00:00:03,240 For those of you who don't know, you guys are sitting in the Getting Slizzard talk. 2 00:00:05,200 --> 00:00:09,180 So just brief agenda here, what we're going to take you through during this talk. 3 00:00:09,880 --> 00:00:11,980 Go through some introductions, you know, about who we are. 4 00:00:12,500 --> 00:00:15,100 Go through a little bit of a primer on SSL. 5 00:00:15,620 --> 00:00:18,780 Talk about some mobile SSL user experiences. 6 00:00:19,580 --> 00:00:21,920 Research motivations, research implications. 7 00:00:23,020 --> 00:00:25,020 Talk a little bit about Test Lab that we built. 8 00:00:25,600 --> 00:00:28,200 I'm going to introduce a tool for you guys, so the Slizzard tool. 9 00:00:29,140 --> 00:00:32,640 I'm going to show you some of the results of us testing some of the mobile apps and the mobile devices. 10 00:00:32,820 --> 00:00:34,380 And then there's going to be an audience participation. 11 00:00:37,340 --> 00:00:38,940 So real quick, who we are. 12 00:00:39,280 --> 00:00:40,460 I'm Nicholas Prococo. 13 00:00:40,800 --> 00:00:43,120 I'm the head of the Spider Labs team at Trustwave. 14 00:00:43,500 --> 00:00:46,760 I started my InfoSec career in the 90s doing penetration testing. 15 00:00:47,220 --> 00:00:48,840 This is my sixth DEF CON talk. 16 00:00:49,000 --> 00:00:50,320 I actually had two others this weekend. 17 00:00:50,720 --> 00:00:54,760 One was Mailer Freak Show on Friday and then the Droid talk yesterday. 18 00:00:55,540 --> 00:00:58,180 I'm also the primary author of Trustwave's Global Service. 19 00:00:59,680 --> 00:01:18,900 I'm the lead SSL developer and the CA architect for Trustwave and since I don't have a whole lot of other bio information I can put up here so we decided I'd say also a mobile game developer in my spare time and also sometimes at work if you're going to Hosting Con in the next few days we're releasing a game there so if we figure we'd hype it now it went in the app store this morning. 20 00:01:19,080 --> 00:01:20,400 I promise it's not malicious. 21 00:01:24,440 --> 00:01:28,180 So before we start we have some audience participation at the end of the day. 22 00:01:28,200 --> 00:01:57,960 So we're going to go into this presentation and so you're going to be able to help us find a mobile SSL flaw so what you'll need, so if you have a mobile device, actually you could have any type of device that has internet connectivity, 3G, 4G, if you're on the DEF CON network you can help us out, you have to have the ability to enter a URL in your mobile browser and then you also have to trust that we're not going to be doing anything malicious to you and then willingness to stand up if your test is successful so just to gauge the audience, how many people here are willing to help out? 23 00:01:58,920 --> 00:01:59,920 Okay, great. 24 00:02:00,100 --> 00:02:00,460 Cool. 25 00:02:00,580 --> 00:02:01,060 This is going to be fun. 26 00:02:02,960 --> 00:02:05,020 So let's jump into the introductions here. 27 00:02:05,180 --> 00:02:06,040 So what does this talk about? 28 00:02:06,200 --> 00:02:09,380 So basically when we were talking about, you know, Paul and I were discussing sort of, 29 00:02:09,380 --> 00:02:13,140 you know, planning for this talk and planning for the research, really, we're discussing 30 00:02:13,140 --> 00:02:16,200 sort of the evolution of the security experience in mobile platforms. 31 00:02:16,360 --> 00:02:20,680 You know, obviously when you have a large giant screen, 27 inch screen, in front of you 32 00:02:20,680 --> 00:02:23,940 there's a lot of things you can do from a security standpoint or even security warnings 33 00:02:23,940 --> 00:02:26,420 messages and other things that you could present to users. 34 00:02:26,740 --> 00:02:27,100 2. 35 00:02:27,100 --> 00:02:31,120 But when you cram it down into a small little device, the space is limited. 36 00:02:31,520 --> 00:02:40,480 And also the developers of the platforms tend to try to abstract some of the busy information that you may see on your desktop platforms 37 00:02:40,480 --> 00:02:43,940 or you want to see on your desktop platforms from your device itself. 38 00:02:44,900 --> 00:02:47,860 We're also going to talk a little bit about some different types of SSL attacks. 39 00:02:48,500 --> 00:02:54,500 The lack of testing tools, testing is available for mobile applications, specifically for mobile app developers. 40 00:02:55,260 --> 00:02:59,900 We're also going to talk about how various apps and devices perform under SSL stress. 41 00:03:00,260 --> 00:03:07,140 And so we did take some popular apps, ran them through some tests, and we're going to present how those actually reacted. 42 00:03:08,160 --> 00:03:10,120 And then we're going to release a tool to help solve this problem. 43 00:03:12,140 --> 00:03:17,840 So very briefly, whenever I give talks, I always want to make sure to start with a primer. 44 00:03:18,320 --> 00:03:24,180 Because about 11 years ago, I sat in the audience at DEF CON and saw plenty of talks. 45 00:03:24,500 --> 00:03:28,900 And sometimes when I was staring at the presenter, I was thinking, I have no idea what this guy's talking about. 46 00:03:29,080 --> 00:03:31,420 So I want to just bring everybody up to speed. 47 00:03:31,600 --> 00:03:36,420 And there could be some people in the audience who maybe aren't familiar with SSL. 48 00:03:36,500 --> 00:03:39,400 So basically, SSL stands for Secure Socket Layer. 49 00:03:39,580 --> 00:03:44,760 It uses certificates, digital files, which are certificates defined by the X.509 specification. 50 00:03:45,440 --> 00:03:51,600 It was actually developed by Netscape back in 1994 and was implemented in Netscape Navigator 1.0. 51 00:03:52,700 --> 00:03:54,480 My personal history, I remember when Netscape... 52 00:03:54,500 --> 00:03:57,080 Netscape Navigator 1.0 was released, I was sitting in my dorm room. 53 00:03:57,220 --> 00:04:00,700 And the day it was released, actually, I think it was probably a couple hours after it was released, 54 00:04:00,860 --> 00:04:05,920 I went to a Netscape store and actually bought a T-shirt with a credit card. 55 00:04:06,160 --> 00:04:11,680 It was my first experience with SSL and sending a secure transmission across the Internet using that technology. 56 00:04:12,980 --> 00:04:18,120 It's a protocol typically used to secure client-to-server communication, data specifically. 57 00:04:18,560 --> 00:04:20,840 Most of you in this room interact with it every single day. 58 00:04:20,940 --> 00:04:23,580 If you do anything online, logging into sites. 59 00:04:24,500 --> 00:04:27,960 If you're using mobile devices and you're logging into your online banking account, 60 00:04:28,220 --> 00:04:31,280 wherever you may be doing, most people have interaction with it. 61 00:04:31,380 --> 00:04:33,080 Some people may not be aware they're interacting with it. 62 00:04:33,580 --> 00:04:37,720 And then it uses, from a keying standpoint, a key standpoint, it uses asymmetric keys, 63 00:04:38,580 --> 00:04:45,300 basically public and private keys, to establish a symmetric key to establish the secure transmission. 64 00:04:47,600 --> 00:04:50,580 So where is SSL used, specifically certs? 65 00:04:50,600 --> 00:04:54,480 We talked about to establish secure client-to-server communication. 66 00:04:54,500 --> 00:04:59,480 It also is used to establish identity as well, so when you visit a website, 67 00:05:00,280 --> 00:05:07,220 a popular financial institution, you often will see sometimes even something like an extended validation indication, 68 00:05:07,520 --> 00:05:11,600 like the green bar, that'll establish that you are, in fact, or hopefully are, in fact, 69 00:05:11,680 --> 00:05:16,340 connecting to that website that you think you're going to. 70 00:05:17,360 --> 00:05:21,460 Also used in app signing, so the same technology used to sign applications, 71 00:05:21,800 --> 00:05:23,760 specifically in the mobile world as well. 72 00:05:24,500 --> 00:05:25,520 And then log file integrity. 73 00:05:26,200 --> 00:05:27,680 Lots of times you can actually sign. 74 00:05:27,900 --> 00:05:31,820 There are tools out there that will sign your logs to ensure the integrity of those logs. 75 00:05:31,900 --> 00:05:33,720 They haven't been tampered with after the fact. 76 00:05:34,660 --> 00:05:38,480 And then very similar in the mobile world, used for communication or public networks. 77 00:05:38,700 --> 00:05:41,800 It's actually pretty important for security communication or public networks, 78 00:05:41,980 --> 00:05:45,660 because we're all roaming around, walking around at conferences, walking down the street, 79 00:05:45,880 --> 00:05:49,560 using our phones from untrusted networks, such as coffee shops and places like that. 80 00:05:49,700 --> 00:05:51,900 And when you submit data that you don't want anybody else to see, 81 00:05:52,520 --> 00:05:54,480 you want to submit it. 82 00:05:54,500 --> 00:05:59,360 You want to send it over the public Internet or even public local networks in an encrypted format. 83 00:06:00,620 --> 00:06:02,460 So it establishes app-to-server communication. 84 00:06:02,980 --> 00:06:05,720 It's also used in app code signing, like we already talked about. 85 00:06:05,960 --> 00:06:08,340 And then it's also used in mobile device profiles. 86 00:06:08,740 --> 00:06:12,500 So if you work for a corporate, you work for a company, 87 00:06:12,540 --> 00:06:19,280 and they push down profiles to your iOS device, they'll actually sign those using SSL. 88 00:06:21,660 --> 00:06:24,480 So a little bit of a sort of cartoon drawing about what men and women do. 89 00:06:24,500 --> 00:06:28,160 So where the middle is, and this is where we're going to dive a little deeper into our talk, 90 00:06:28,620 --> 00:06:30,800 basically I want to describe what is a man-in-the-middle attack. 91 00:06:31,080 --> 00:06:34,160 And so you can see that diagram at the bottom, very cartoon-like. 92 00:06:34,240 --> 00:06:36,960 But the bad guy sitting in the middle there, the diagram, 93 00:06:37,740 --> 00:06:42,020 you or the end user is sitting over on the left-hand side of the screen, 94 00:06:42,080 --> 00:06:43,000 and that's your mobile device. 95 00:06:43,300 --> 00:06:48,080 You're actually, you know, he's injected into your network somewhere. 96 00:06:48,440 --> 00:06:50,120 So it may be on your local WAN. 97 00:06:50,240 --> 00:06:54,260 It could be somewhere in the path between you and the place you want to visit. 98 00:06:54,500 --> 00:06:55,580 It could be the legitimate place you want to go. 99 00:06:55,920 --> 00:06:58,760 And so basically you establish your connection with the attacker, 100 00:06:58,880 --> 00:07:03,700 and the attacker then establishes a legitimate connection to the backend server. 101 00:07:04,480 --> 00:07:09,340 So then when that happens, the attacker is able to then intercept the data that you're sending, 102 00:07:09,480 --> 00:07:11,840 but also possibly modify that as well. 103 00:07:13,920 --> 00:07:16,960 So what tools actually exist to help with man-in-the-middle attacks? 104 00:07:17,700 --> 00:07:18,680 There are quite a few. 105 00:07:18,860 --> 00:07:22,300 We've got ThickNet, which is a man-in-the-middle framework developed by Steve Acepic, 106 00:07:22,500 --> 00:07:24,480 who is a member of the Trustwave Spider Labs team. 107 00:07:24,500 --> 00:07:31,160 It's written in Perl and is a modular system that allows you to add extra functionality to it 108 00:07:31,160 --> 00:07:32,760 after you've set up your initial man-in-the-middle. 109 00:07:33,380 --> 00:07:37,760 There's Ettercap, which is kind of the gold standard tool that everybody's familiar with, 110 00:07:37,840 --> 00:07:39,480 although it hasn't been developed in quite some time. 111 00:07:39,580 --> 00:07:43,260 It's still a very solid and very useful tool for doing this sort of thing. 112 00:07:44,060 --> 00:07:49,300 You can also use more basic tools like ARP spoof that will just spoof ARP, 113 00:07:49,380 --> 00:07:52,740 exactly what it sounds like, to cause packets to be redirected to you, 114 00:07:52,740 --> 00:07:58,840 and then you can use other tools to intercept and modify those packets, 115 00:08:00,320 --> 00:08:03,220 specifically things such as SSL strip or SSL sniff. 116 00:08:03,780 --> 00:08:05,820 And then there's also things like man-in-the-middle proxy, 117 00:08:05,960 --> 00:08:09,940 which is just an SSL-capable and intercepting HTTP proxy. 118 00:08:12,180 --> 00:08:15,120 So why is true SSL man-in-the-middle difficult? 119 00:08:16,080 --> 00:08:18,600 Well, SSL certificates have what's called a chain of trust. 120 00:08:19,140 --> 00:08:22,240 The X.509 spec was based around the concept 121 00:08:22,240 --> 00:08:24,760 that you have roots, or sometimes they're called trust anchors. 122 00:08:25,080 --> 00:08:29,400 Those roots are present in the certificate store of the device 123 00:08:29,400 --> 00:08:31,580 or application that you're attempting to use. 124 00:08:32,000 --> 00:08:37,600 So, for example, you connect to Facebook.com using your web browser. 125 00:08:37,760 --> 00:08:39,280 Your web browser is now chaining. 126 00:08:39,460 --> 00:08:43,360 It obtains the SSL certificate and any intermediate certificates 127 00:08:43,360 --> 00:08:48,820 in the initial handshake, and then it uses its own internal methods 128 00:08:48,820 --> 00:08:51,100 to try and find a chain of trust 129 00:08:51,100 --> 00:08:53,480 up to a root CA that it's already familiar with. 130 00:08:53,960 --> 00:08:56,100 So you can't just go and sign your own certificate 131 00:08:56,100 --> 00:08:57,980 because it's not in there. 132 00:08:58,220 --> 00:09:00,980 And if you add it to your own, it's not in anybody else's. 133 00:09:01,760 --> 00:09:03,880 And the reason for that is, of course, that, well, 134 00:09:03,960 --> 00:09:06,900 we don't want you to be able to create www.facebook.com 135 00:09:06,900 --> 00:09:09,440 or api.facebook.com or any of those other certificates 136 00:09:09,440 --> 00:09:13,160 because why should you be the authoritative source for that? 137 00:09:13,500 --> 00:09:15,920 Now, there are certain other ways of trying to develop 138 00:09:17,600 --> 00:09:19,440 more distributed networks of trust, 139 00:09:19,440 --> 00:09:22,240 but for the moment, x509 is based upon the concept 140 00:09:22,240 --> 00:09:23,460 that there are trust anchors. 141 00:09:24,700 --> 00:09:27,520 So now that we've established that you need a public CA for that, 142 00:09:28,420 --> 00:09:31,100 you now need to find some way to attack a public CA. 143 00:09:31,200 --> 00:09:33,800 Now, as proven in the past by Moxie and others, 144 00:09:33,960 --> 00:09:35,560 you can attack public CAs. 145 00:09:35,960 --> 00:09:38,820 However, it's typically not particularly practical. 146 00:09:39,500 --> 00:09:42,500 You need to focus on one specific one. 147 00:09:42,620 --> 00:09:43,760 You may need to spend quite a bit of time, 148 00:09:43,820 --> 00:09:45,340 and you may not be successful in the first place. 149 00:09:45,720 --> 00:09:48,280 Social engineering usually plays a fairly large component in it 150 00:09:48,280 --> 00:09:49,240 rather than technical flaw. 151 00:09:51,920 --> 00:09:54,600 So then you may want to generate malformed certs. 152 00:09:54,600 --> 00:09:56,500 Well, the tooling around generating certificates 153 00:09:56,500 --> 00:09:59,140 is pretty streamlined these days, 154 00:09:59,280 --> 00:10:02,900 and because the ASN1 spec, which is what x509 utilizes, 155 00:10:02,920 --> 00:10:06,240 is so complex, they actually lock it down pretty heavily 156 00:10:06,240 --> 00:10:07,060 in almost all the tooling. 157 00:10:07,240 --> 00:10:08,520 It's so easy to go wrong. 158 00:10:08,800 --> 00:10:11,900 So you actually have to go down and play down in the libSSL, 159 00:10:11,900 --> 00:10:15,240 openSSL layers or use something like the Ruby openSSL bindings 160 00:10:15,240 --> 00:10:17,560 to be able to generate malformed ASN1 structures. 161 00:10:18,280 --> 00:10:21,300 So that's usually an obstacle for people who aren't familiar 162 00:10:21,300 --> 00:10:22,840 with that type of code. 163 00:10:23,300 --> 00:10:26,560 And then SSL parsing zero days are difficult to come by. 164 00:10:27,420 --> 00:10:30,620 As Moxie's demonstration of null character attacks worked, 165 00:10:30,800 --> 00:10:35,560 he managed to find both a flaw in the way CAs were validating certificates 166 00:10:35,560 --> 00:10:42,700 and a parsing error in the actual multiple different parsing engines 167 00:10:42,700 --> 00:10:44,740 because that flaw actually affected Firefox 168 00:10:45,280 --> 00:10:48,260 and the IES channel validating certificates. 169 00:10:50,200 --> 00:10:53,080 So we'll talk a little bit about mobile SSL experience 170 00:10:53,080 --> 00:10:54,460 from a user perspective. 171 00:10:54,760 --> 00:10:56,220 So obviously there's no standard UI. 172 00:10:56,560 --> 00:10:59,680 If you have an Android device, you have an iOS device, 173 00:10:59,760 --> 00:11:02,800 or WebOS, whatever you have, there's no real standard 174 00:11:02,800 --> 00:11:05,480 for letting the end user know that they've established 175 00:11:05,480 --> 00:11:06,980 a secure connection. 176 00:11:07,260 --> 00:11:09,140 So you've established an SSL connection. 177 00:11:09,760 --> 00:11:11,980 Most applications show nothing at all. 178 00:11:12,400 --> 00:11:17,420 Fire up your online banking app, and you just have to assume 179 00:11:17,420 --> 00:11:21,380 that maybe it's being sent over SSL, but it could be being sent in the clear. 180 00:11:21,900 --> 00:11:25,600 There's no indication from an end user's experience of the difference. 181 00:11:26,480 --> 00:11:29,800 In most cases, like I said, there's no UI at all. 182 00:11:29,940 --> 00:11:32,980 There's no lock that you see in a browser experience. 183 00:11:33,420 --> 00:11:36,400 It's just basically nonexistent. 184 00:11:37,180 --> 00:11:40,380 There are things like that in some of the mobile browsers themselves, 185 00:11:41,180 --> 00:11:43,140 but just because you see a lock there, 186 00:11:43,280 --> 00:11:47,400 you have no ability to drill down deeper to actually check out this lock 187 00:11:47,420 --> 00:11:49,060 or the certificates that are being presented to you. 188 00:11:49,600 --> 00:11:51,120 And then, of course, there's cryptic warnings. 189 00:11:51,840 --> 00:11:54,880 Part of our research, we were doing some of the testing. 190 00:11:55,140 --> 00:11:56,880 We noticed a lot of cryptic warnings. 191 00:11:57,060 --> 00:11:58,860 Some warnings just didn't even make sense 192 00:11:59,420 --> 00:12:01,320 for what was going on in the testing. 193 00:12:01,880 --> 00:12:03,240 And then users don't know the difference. 194 00:12:03,520 --> 00:12:06,600 So everybody in this room being security aware 195 00:12:07,200 --> 00:12:11,460 would know the difference, but most end users wouldn't, 196 00:12:11,460 --> 00:12:14,400 and they wouldn't know if they established a connection 197 00:12:14,400 --> 00:12:15,160 or if they didn't. 198 00:12:15,180 --> 00:12:16,060 They wouldn't even know to look. 199 00:12:16,060 --> 00:12:17,600 And then the pop-up could be lying. 200 00:12:17,840 --> 00:12:21,160 So the screenshot you see there was from an app 201 00:12:21,160 --> 00:12:23,560 that I actually went and downloaded. 202 00:12:23,780 --> 00:12:27,060 It's an app to find sort of boutique hotels 203 00:12:27,060 --> 00:12:29,100 when you travel around that are cheaper 204 00:12:29,100 --> 00:12:30,940 but maybe a little nicer than chains. 205 00:12:31,260 --> 00:12:33,340 And so when I was using that app, 206 00:12:33,420 --> 00:12:34,760 I noticed there was a lock in the corner, 207 00:12:34,880 --> 00:12:38,360 and it says secured by, and it has trust click on it. 208 00:12:38,480 --> 00:12:40,220 You put your finger on that lock, 209 00:12:40,320 --> 00:12:43,760 and a pop-up box comes up that says secure booking powered by travel click 210 00:12:43,760 --> 00:12:44,880 and protected by 256. 211 00:12:46,380 --> 00:12:47,620 Bit SSL encryption. 212 00:12:47,960 --> 00:12:50,180 So that could be just complete bullshit. 213 00:12:50,400 --> 00:12:53,220 You have no idea if that pop-up is lying. 214 00:12:55,920 --> 00:12:58,900 So the browser community has now spent almost two decades 215 00:12:58,900 --> 00:13:01,080 tweaking their UI behavior when it comes to SSL. 216 00:13:01,280 --> 00:13:03,880 I mean, originally you had padlocks in the corners, 217 00:13:03,940 --> 00:13:06,880 and you've had padlocks move up next to the URL bar. 218 00:13:07,080 --> 00:13:08,120 You've had yellow. 219 00:13:08,260 --> 00:13:09,100 You've had green. 220 00:13:09,200 --> 00:13:10,620 You've had just white. 221 00:13:11,260 --> 00:13:14,380 You've had green locks that actually don't represent EV security. 222 00:13:14,380 --> 00:13:17,000 The point is that there is always presentation, 223 00:13:17,740 --> 00:13:20,080 even if that presentation has been changing. 224 00:13:20,260 --> 00:13:23,600 So there's ways for you to both look at and validate what you're seeing. 225 00:13:24,300 --> 00:13:30,060 However, the mobile device market in essence destroyed that in less than five years. 226 00:13:30,240 --> 00:13:33,100 It went from at least something to see 227 00:13:33,100 --> 00:13:36,000 to you need to trust that something good is happening. 228 00:13:36,240 --> 00:13:40,320 When you open up your mobile app to connect to Google Plus or Facebook 229 00:13:40,320 --> 00:13:41,960 or whatever your social network is, 230 00:13:41,960 --> 00:13:44,820 you just assume that it's using SSL. 231 00:13:44,880 --> 00:13:46,060 You have no way to tell. 232 00:13:46,740 --> 00:13:49,100 So that's obviously something of a problem, 233 00:13:49,220 --> 00:13:51,220 and you can't expect to see you. 234 00:13:51,920 --> 00:13:52,600 Excuse me. 235 00:13:52,900 --> 00:13:55,680 So if SSL fails silently on that front, 236 00:13:55,920 --> 00:13:58,240 well, the world probably doesn't end, 237 00:13:58,340 --> 00:14:00,040 but maybe your personal world does. 238 00:14:03,060 --> 00:14:05,860 So some of the research motivations as well, 239 00:14:06,040 --> 00:14:09,100 most apps completely ignore the UI aspect of security. 240 00:14:09,360 --> 00:14:11,540 So that's something we wanted to look into. 241 00:14:11,960 --> 00:14:13,660 Like Paul already mentioned, 242 00:14:13,800 --> 00:14:16,980 from an end user standpoint or even from a developer standpoint, 243 00:14:17,380 --> 00:14:18,560 you're a mobile app developer. 244 00:14:18,980 --> 00:14:21,220 There is a zero functionality difference 245 00:14:21,220 --> 00:14:23,920 between sending data in the clear and sending data encrypted. 246 00:14:24,380 --> 00:14:25,820 So there's no real no motivation 247 00:14:25,820 --> 00:14:28,620 other than the protection of the data that's being sent 248 00:14:28,620 --> 00:14:29,800 for them to implement it. 249 00:14:30,160 --> 00:14:31,860 And so as an end user, you just have to trust that 250 00:14:31,860 --> 00:14:33,400 when you're sending some things like credentials 251 00:14:33,750 --> 00:14:37,020 or bank account information or credit card information via an app, 252 00:14:37,100 --> 00:14:39,380 that the developer cares enough about you 253 00:14:39,830 --> 00:14:41,840 to actually establish that SSL session. 254 00:14:41,960 --> 00:14:42,940 And encrypt your data. 255 00:14:44,000 --> 00:14:46,500 And we also thought there wasn't really any tools, 256 00:14:46,760 --> 00:14:50,420 an easy set of tools for people to run their apps 257 00:14:50,420 --> 00:14:51,220 through these types of tests. 258 00:14:51,640 --> 00:14:54,400 And then also, when you find OS level problems, 259 00:14:55,020 --> 00:14:56,640 they cascade to all apps, 260 00:14:56,800 --> 00:14:58,660 or they can cascade to all apps. 261 00:14:58,800 --> 00:15:02,100 So if there's an OS level SSL parsing problem, 262 00:15:02,660 --> 00:15:04,960 it could affect every single app on a device, 263 00:15:05,180 --> 00:15:07,680 not just the ones that are used, 264 00:15:07,840 --> 00:15:10,040 not just one single app. 265 00:15:10,280 --> 00:15:11,780 And to be fair, that is true, 266 00:15:11,960 --> 00:15:12,600 on the desktop as well. 267 00:15:12,760 --> 00:15:14,040 But on the mobile side, 268 00:15:14,200 --> 00:15:15,740 much more so than the desktop side, 269 00:15:15,860 --> 00:15:17,480 people tend to use consistent APIs 270 00:15:17,480 --> 00:15:19,000 that go down to the OS hooks. 271 00:15:19,260 --> 00:15:20,800 So for example, on the desktop, 272 00:15:21,040 --> 00:15:23,660 you could have several different libraries 273 00:15:23,660 --> 00:15:25,780 that are actually handling your SSL validation routines. 274 00:15:26,260 --> 00:15:28,900 If you're using Firefox, it uses its own, 275 00:15:28,960 --> 00:15:30,240 and SS specifically. 276 00:15:30,540 --> 00:15:32,120 And if you're using Safari or Chrome 277 00:15:32,120 --> 00:15:34,300 or Internet Explorer or whatever, 278 00:15:34,460 --> 00:15:35,560 then you're using S Channel 279 00:15:35,560 --> 00:15:37,460 or the OS level libraries for OS X. 280 00:15:37,960 --> 00:15:40,660 However, on the mobile side, 281 00:15:40,660 --> 00:15:41,780 you're emphatically, 282 00:15:41,940 --> 00:15:44,680 unless you've chosen to go a route that very few do, 283 00:15:44,820 --> 00:15:47,960 you're using the OS level libraries for handling that. 284 00:15:50,160 --> 00:15:52,160 So whenever you're doing security research, 285 00:15:52,320 --> 00:15:54,400 there's always the implications of your research. 286 00:15:54,600 --> 00:15:57,180 And obviously, something that we talk about today 287 00:15:57,180 --> 00:15:59,340 could be used by someone to do something, 288 00:15:59,460 --> 00:16:01,460 used to do bad things tomorrow. 289 00:16:02,100 --> 00:16:04,860 And basically, due to attackers really focusing 290 00:16:04,860 --> 00:16:08,580 on the mobile app world and the mobile device world, 291 00:16:08,760 --> 00:16:10,280 obviously the results of our research 292 00:16:10,280 --> 00:16:12,960 can be used for, like I said, to do bad things. 293 00:16:13,300 --> 00:16:15,680 Specifically, if there's problems with SSL, 294 00:16:15,760 --> 00:16:17,500 they can be used for credential stealing, 295 00:16:17,740 --> 00:16:20,160 data interception, even response manipulation 296 00:16:20,740 --> 00:16:22,600 back to the client application. 297 00:16:23,620 --> 00:16:25,540 But the other thing to think about is 298 00:16:25,540 --> 00:16:29,280 these types of attacks will go unnoticed, 299 00:16:29,840 --> 00:16:32,880 specifically if there's a lack of user awareness. 300 00:16:33,580 --> 00:16:36,280 Users aren't aware, even when they see error messages, 301 00:16:36,400 --> 00:16:37,680 if they just click through them, 302 00:16:38,800 --> 00:16:40,060 that's a problem as well. 303 00:16:40,280 --> 00:16:42,660 And then, of course, the lack of UI cues within the apps 304 00:16:43,200 --> 00:16:43,740 compound that. 305 00:16:44,160 --> 00:16:45,780 So like we talked about earlier, 306 00:16:45,860 --> 00:16:47,660 if the SSL fails and it fails silently, 307 00:16:48,260 --> 00:16:51,920 the users are just basically blindly submitting their data 308 00:16:51,920 --> 00:16:55,280 through the networks and being intercepted by attackers. 309 00:16:57,380 --> 00:16:59,680 So how do you actually build a test lab then? 310 00:17:00,780 --> 00:17:02,220 Well, there's a lot of ways, obviously, 311 00:17:02,320 --> 00:17:03,680 but one of the simplest and cheapest ways 312 00:17:03,680 --> 00:17:06,740 is just go ahead and get yourself a cheap Soho switch 313 00:17:06,740 --> 00:17:09,840 or switch and router like a WRT54GL or something. 314 00:17:10,280 --> 00:17:11,960 But typically, you'd like it to be able to run 315 00:17:11,960 --> 00:17:14,400 a third-party firmware like Tomato or DDWRT. 316 00:17:15,400 --> 00:17:16,740 You want to want an attacker system. 317 00:17:17,260 --> 00:17:19,440 In our case, we went ahead and used Linux 318 00:17:19,440 --> 00:17:20,540 because it's much easier to compile 319 00:17:20,540 --> 00:17:21,880 there than anywhere else. 320 00:17:22,460 --> 00:17:24,900 And we went ahead and also added a patch to it 321 00:17:24,900 --> 00:17:26,060 that we'll be discussing in a little bit. 322 00:17:26,360 --> 00:17:27,680 And then you need some victim clients. 323 00:17:28,000 --> 00:17:31,300 In our case, we have a Nexus S that was running at the time 324 00:17:31,300 --> 00:17:32,820 the latest version of Gingerbread 325 00:17:32,820 --> 00:17:35,060 and an iPod Touch fourth generation 326 00:17:35,060 --> 00:17:37,040 which was running iOS 4.3.3. 327 00:17:41,760 --> 00:17:43,520 So what types of search do you need then 328 00:17:43,520 --> 00:17:44,460 once you've got that all set up? 329 00:17:45,120 --> 00:17:46,400 You're going to want ones that are valid 330 00:17:46,400 --> 00:17:47,940 for the target domain, of course, 331 00:17:48,020 --> 00:17:50,820 so you can validate that it works in the primary use case. 332 00:17:51,480 --> 00:17:54,700 You're also going to want as many malformed SSL certificate types 333 00:17:54,700 --> 00:17:55,440 as you can come up with. 334 00:17:56,080 --> 00:17:58,460 Self sign, which is a common one that many people deal with. 335 00:17:59,300 --> 00:18:01,560 CRLF, which is a carriage return line feed. 336 00:18:01,960 --> 00:18:03,600 That's actually something that in the past 337 00:18:03,600 --> 00:18:05,160 various libraries have had trouble with. 338 00:18:05,600 --> 00:18:08,940 You feed a carriage return line feed inside the domain 339 00:18:08,940 --> 00:18:10,400 or wrapping domains 340 00:18:10,400 --> 00:18:13,400 and sometimes it will parse before or after the CRLF. 341 00:18:13,580 --> 00:18:15,720 Sometimes it will just break and return true. 342 00:18:16,540 --> 00:18:17,980 Now that hasn't always been... 343 00:18:17,980 --> 00:18:20,840 It shouldn't be true now, but that doesn't mean it isn't. 344 00:18:21,720 --> 00:18:23,420 Then the null prefix, which of course 345 00:18:23,420 --> 00:18:25,520 was one of Moxie's big ones recently, 346 00:18:25,700 --> 00:18:27,020 which we discussed earlier. 347 00:18:27,820 --> 00:18:30,380 Invalid ASN1 structures, where you can write fuzzers 348 00:18:30,380 --> 00:18:32,920 where you can say, I want to have various 349 00:18:32,920 --> 00:18:37,260 broken loops and misnested forms 350 00:18:37,260 --> 00:18:38,660 inside my ASN1 structures. 351 00:18:38,940 --> 00:18:41,740 And then broken encodings in general 352 00:18:41,740 --> 00:18:45,820 where you can push UTF-8 into BMP strings 353 00:18:45,820 --> 00:18:49,460 and things like that, because ASN1 has type identifiers 354 00:18:49,460 --> 00:18:51,500 so you can play around with that. 355 00:18:51,780 --> 00:18:53,940 And then things like the basic constraints 356 00:18:53,940 --> 00:18:56,220 and key usage and extended key usage extensions. 357 00:18:56,840 --> 00:18:59,080 Every certificate has things encoded in it 358 00:18:59,080 --> 00:19:01,400 that tell the browser or the OS 359 00:19:01,980 --> 00:19:03,940 what it should allow that cert to do. 360 00:19:04,120 --> 00:19:07,780 For instance, when you are using a regular service certificate 361 00:19:07,780 --> 00:19:10,380 it has an extended key usage called ServerAuth. 362 00:19:10,580 --> 00:19:12,080 And when you are using it for client authentication 363 00:19:12,080 --> 00:19:13,440 it has one called ClientAuth. 364 00:19:13,600 --> 00:19:15,900 And ServerAuth certs can't be used for ClientAuth 365 00:19:15,900 --> 00:19:16,420 and vice versa. 366 00:19:16,940 --> 00:19:18,820 And in the basic constraints extension 367 00:19:18,820 --> 00:19:20,600 there's typically a field that says 368 00:19:21,120 --> 00:19:24,480 CA colon false, which means it's not a CA. 369 00:19:24,640 --> 00:19:25,860 Don't let anybody sign things. 370 00:19:28,100 --> 00:19:29,620 So then you need a method, of course, 371 00:19:29,640 --> 00:19:30,680 to generate the above easily. 372 00:19:32,540 --> 00:19:34,440 So what we went ahead and did 373 00:19:34,440 --> 00:19:36,160 was wrote a Ruby script called Slizzard. 374 00:19:36,160 --> 00:19:38,420 It's an open source toolkit to easily generate 375 00:19:38,420 --> 00:19:40,700 multiple types of invalid certs for any given domain. 376 00:19:41,240 --> 00:19:43,340 The output can then be used with Ettercap 377 00:19:43,340 --> 00:19:47,080 to run these attacks against your apps or others 378 00:19:47,080 --> 00:19:49,100 to see if these things are vulnerable. 379 00:19:50,380 --> 00:19:52,920 We've successfully tested with Ettercap 380 00:19:52,920 --> 00:19:55,740 and we have a patch on the DEFCON 19 DVD 381 00:19:55,740 --> 00:19:57,900 that you can apply against any standard 382 00:19:57,900 --> 00:20:00,660 Ettercap 073 NG tree 383 00:20:00,660 --> 00:20:03,100 which will allow you to add a new flag 384 00:20:03,940 --> 00:20:05,520 again, documented in the patch. 385 00:20:06,160 --> 00:20:08,100 But you pass dash X that allows you 386 00:20:08,100 --> 00:20:09,320 to pass any certificate in. 387 00:20:09,880 --> 00:20:12,280 Normally Ettercap generates standard 388 00:20:14,060 --> 00:20:15,760 self-signed certificates on the fly. 389 00:20:16,300 --> 00:20:18,440 And since we want to be able to provide 390 00:20:18,440 --> 00:20:19,900 different forms of broken certificates 391 00:20:19,900 --> 00:20:22,460 we use the flag to supply them. 392 00:20:23,140 --> 00:20:25,040 There's also a ThickNet module being developed 393 00:20:25,040 --> 00:20:25,980 by Steve Osepik. 394 00:20:26,300 --> 00:20:28,540 I believe that will be delayed a little bit. 395 00:20:28,800 --> 00:20:31,160 Yeah, Steve's doing a talk I think the next hour 396 00:20:31,160 --> 00:20:32,460 called Blinky Lights. 397 00:20:32,600 --> 00:20:33,980 And so when that talk got accepted 398 00:20:33,980 --> 00:20:36,520 it delayed his man-in-the-middle 399 00:20:36,520 --> 00:20:38,040 or his ThickNet module a little bit. 400 00:20:38,120 --> 00:20:40,020 But he's going to put that out shortly after our talk. 401 00:20:41,240 --> 00:20:43,720 And this setup can be used against any OS application, 402 00:20:44,080 --> 00:20:45,420 browser, anything. 403 00:20:45,700 --> 00:20:47,060 As long as it's connected to the network 404 00:20:47,060 --> 00:20:49,220 that you've developed, you can man-in-the-middle it. 405 00:20:52,660 --> 00:20:55,860 So to use it, all you have to do is run it. 406 00:20:56,160 --> 00:20:57,780 You can either specify it on the command line 407 00:20:57,780 --> 00:21:00,960 or it will have an interactive shell 408 00:21:00,960 --> 00:21:02,400 for specifying as well. 409 00:21:03,980 --> 00:21:04,940 And I guess we can do the demo. 410 00:21:05,160 --> 00:21:05,240 Yeah. 411 00:21:07,260 --> 00:21:11,340 And the real motivation here was to develop this toolkit 412 00:21:11,340 --> 00:21:12,820 so that app developers, 413 00:21:13,140 --> 00:21:15,620 specifically app developers that may be using their own libraries 414 00:21:15,620 --> 00:21:18,620 or their own routines to validate SSL 415 00:21:18,620 --> 00:21:19,720 in their applications. 416 00:21:20,480 --> 00:21:22,500 And this will be a surprisingly short demo 417 00:21:22,500 --> 00:21:24,000 since it does exactly what you'd expect. 418 00:21:24,380 --> 00:21:27,300 You specify the domain you want it to generate certificates for 419 00:21:27,300 --> 00:21:29,180 and they are generated. 420 00:21:29,420 --> 00:21:32,520 So now we can say, let's take a look at one. 421 00:21:35,320 --> 00:21:37,460 Let's go ahead and look at the null character attack one. 422 00:21:39,920 --> 00:21:43,020 So as you can see, it generated for domain.com 423 00:21:43,020 --> 00:21:44,080 with a null character. 424 00:21:44,640 --> 00:21:46,740 OpenSSL is actually capable of detecting 425 00:21:46,740 --> 00:21:49,320 and reparsing null characters such that you can see it. 426 00:21:49,360 --> 00:21:51,700 But in certain other tools, 427 00:21:51,900 --> 00:21:53,180 you may not see the null character 428 00:21:53,180 --> 00:21:55,440 because it's a null character and unprintable. 429 00:21:56,940 --> 00:21:59,540 But that's the kind of thing we're going ahead and generating. 430 00:21:59,660 --> 00:22:01,960 And then you have a single key 431 00:22:01,960 --> 00:22:03,780 that corresponds to all these certificates. 432 00:22:04,440 --> 00:22:06,600 And in the Ettercap, 433 00:22:06,780 --> 00:22:08,040 once you apply the patch, 434 00:22:08,460 --> 00:22:11,880 you actually can specify the certs to use 435 00:22:11,880 --> 00:22:13,020 for your test. 436 00:22:13,860 --> 00:22:14,740 As you can see there. 437 00:22:15,240 --> 00:22:17,620 So you go ahead and execute it, generate your certs, 438 00:22:18,040 --> 00:22:19,940 set up Ettercap using the dash dash flag 439 00:22:19,940 --> 00:22:21,620 to specify the cert type you want to test. 440 00:22:22,260 --> 00:22:23,580 And then you'll use your app as normal 441 00:22:23,580 --> 00:22:24,560 and see if you get error messages. 442 00:22:24,900 --> 00:22:27,880 If you don't get errors, then you should check Ettercap 443 00:22:27,880 --> 00:22:29,600 which you can tell it, you can either have it 444 00:22:29,600 --> 00:22:31,500 outputting data to the screen 445 00:22:31,500 --> 00:22:33,180 or you can have it writing to a PCAP file 446 00:22:33,980 --> 00:22:35,300 using something like Wireshark. 447 00:22:36,400 --> 00:22:38,180 That'll let you see if the data was intercepted 448 00:22:38,180 --> 00:22:38,660 as you expected. 449 00:22:39,220 --> 00:22:41,340 You'll have to execute Ettercap once per cert type 450 00:22:41,340 --> 00:22:44,060 generated by Sllizard to comprehensively test it. 451 00:22:44,200 --> 00:22:45,980 We don't allow dynamic switching at the moment 452 00:22:45,980 --> 00:22:48,100 although we've been looking into improving the patch. 453 00:22:52,500 --> 00:22:53,880 So now we're going to talk a little bit about 454 00:22:53,880 --> 00:22:56,480 the mobile app test results. 455 00:22:56,780 --> 00:22:58,020 So like we mentioned earlier 456 00:22:58,020 --> 00:22:59,920 about setting up the test lab, 457 00:23:00,200 --> 00:23:01,860 we actually set up the test lab, 458 00:23:01,920 --> 00:23:02,780 we had the various devices, 459 00:23:03,980 --> 00:23:05,720 proceeded to basically men in the middle, 460 00:23:05,820 --> 00:23:07,080 each of those devices, 461 00:23:07,220 --> 00:23:08,100 and some popular apps. 462 00:23:10,500 --> 00:23:11,020 Sure. 463 00:23:11,440 --> 00:23:13,340 So on Android, as you can see, 464 00:23:13,980 --> 00:23:15,880 in a lot of ways we didn't find a whole lot. 465 00:23:16,920 --> 00:23:17,860 We ran through 466 00:23:19,160 --> 00:23:20,460 several hundred tests 467 00:23:20,460 --> 00:23:21,600 actually across the 468 00:23:21,600 --> 00:23:24,080 ASN1 fuzzers and various other ones 469 00:23:24,080 --> 00:23:26,100 and you can see that 470 00:23:26,100 --> 00:23:26,940 the self sign 471 00:23:28,040 --> 00:23:30,000 CRLF null character and ASN1s 472 00:23:30,000 --> 00:23:31,240 all fail closed. 473 00:23:32,340 --> 00:23:33,500 In the browser you get 474 00:23:33,980 --> 00:23:34,200 what you'd expect, 475 00:23:34,380 --> 00:23:36,020 which is the invalid certificate notification 476 00:23:36,020 --> 00:23:37,980 which in Android you can also actually 477 00:23:37,980 --> 00:23:38,980 click the view certificate 478 00:23:38,980 --> 00:23:40,400 and see a little bit of the details. 479 00:23:40,600 --> 00:23:42,800 You can't see why the chain might not be working 480 00:23:42,800 --> 00:23:44,800 but you can see the end entity certificate itself. 481 00:23:46,220 --> 00:23:47,920 Some of the more interesting things around it 482 00:23:47,920 --> 00:23:49,920 were that when you do these types of attacks 483 00:23:49,920 --> 00:23:51,420 some of the underlying OS libraries 484 00:23:51,420 --> 00:23:53,120 are getting upset because the Facebook app 485 00:23:53,120 --> 00:23:54,940 will for example completely stop responding. 486 00:23:56,000 --> 00:23:58,020 Quitting it, reopening it doesn't seem to help. 487 00:23:58,120 --> 00:23:59,780 You actually have to reboot the entire phone sometimes. 488 00:24:01,800 --> 00:24:03,680 However, and there's the other thing 489 00:24:03,980 --> 00:24:05,680 that was confusing, error messages. 490 00:24:06,080 --> 00:24:08,400 None of them said bad SSL certificate. 491 00:24:08,780 --> 00:24:09,820 They would say things like 492 00:24:09,820 --> 00:24:11,800 no network connection or 493 00:24:13,280 --> 00:24:14,220 server busy 494 00:24:14,220 --> 00:24:14,780 basically 495 00:24:15,840 --> 00:24:17,980 fallback error messages that just assumed 496 00:24:17,980 --> 00:24:19,940 that there couldn't be a problem 497 00:24:19,940 --> 00:24:21,900 with the SSL cert, it was something else. 498 00:24:22,640 --> 00:24:23,940 So that was always 499 00:24:23,940 --> 00:24:25,840 a little bit of an interesting revelation 500 00:24:25,840 --> 00:24:26,400 for us. 501 00:24:28,900 --> 00:24:30,100 So we also tested 502 00:24:30,100 --> 00:24:31,960 IOS based on the same exact 503 00:24:31,960 --> 00:24:32,740 fashion. 504 00:24:34,860 --> 00:24:35,840 And so I mean 505 00:24:35,840 --> 00:24:36,960 I guess the big takeaway here 506 00:24:36,960 --> 00:24:38,340 you can see the same keys. 507 00:24:38,600 --> 00:24:40,220 If you can't really see it from the back of the room 508 00:24:40,220 --> 00:24:42,680 the key basically FC, the green FC means 509 00:24:42,680 --> 00:24:43,860 it failed to close, it did what it should. 510 00:24:45,180 --> 00:24:46,720 UR means user request 511 00:24:46,720 --> 00:24:48,840 so basically something popped up and asked the user 512 00:24:48,840 --> 00:24:50,300 to do something and it failed to open. 513 00:24:50,760 --> 00:24:53,180 So obviously this was a little bit disappointing 514 00:24:53,180 --> 00:24:54,680 at this stage in the research 515 00:24:54,680 --> 00:24:56,220 that we didn't find anything 516 00:24:56,220 --> 00:24:58,700 but there was also some confusing error messages 517 00:24:58,700 --> 00:24:59,540 as well that we noted. 518 00:24:59,900 --> 00:25:02,820 And then one thing to note, Twitter, the Twitter client 519 00:25:03,980 --> 00:25:05,840 actually had very nice accurate error messages. 520 00:25:06,140 --> 00:25:08,020 I think of all those apps that we tested 521 00:25:08,020 --> 00:25:09,960 it was the only one that actually 522 00:25:09,960 --> 00:25:11,680 accurately displayed what the issue was 523 00:25:11,680 --> 00:25:13,560 that was being presented to the end user. 524 00:25:15,660 --> 00:25:16,840 So now we're going to crowd 525 00:25:16,840 --> 00:25:17,560 question. 526 00:25:23,780 --> 00:25:24,940 Oh yeah sorry. 527 00:25:25,140 --> 00:25:26,420 So that's interesting. 528 00:25:26,900 --> 00:25:27,980 Thanks for pointing that out. 529 00:25:28,980 --> 00:25:30,200 Yeah so basically 530 00:25:30,200 --> 00:25:33,120 when you went to the sign up screen 531 00:25:33,980 --> 00:25:35,840 Facebook app, we noticed that 532 00:25:35,840 --> 00:25:37,480 all data was being transmitted 533 00:25:37,480 --> 00:25:38,520 over HTTP. 534 00:25:39,020 --> 00:25:40,760 Yeah it takes you to a custom web view 535 00:25:41,320 --> 00:25:43,880 which just loads the m.facebook.com page 536 00:25:43,880 --> 00:25:45,300 which is not over SSL 537 00:25:45,300 --> 00:25:47,180 and everything including the sign up 538 00:25:47,180 --> 00:25:49,720 form posts over HTTP 539 00:25:49,720 --> 00:25:51,100 for some reason. 540 00:25:53,780 --> 00:25:55,700 Yeah the app does that 541 00:25:55,700 --> 00:25:56,680 whether or not you're man in the middle. 542 00:25:56,780 --> 00:25:58,900 That was just a little side thing we found. 543 00:26:02,500 --> 00:26:03,520 So now we're going to do the 544 00:26:03,980 --> 00:26:04,420 audience participation. 545 00:26:05,000 --> 00:26:06,420 So what are we going to do? 546 00:26:06,520 --> 00:26:08,440 We're going to test for a specific SSL flaw 547 00:26:09,280 --> 00:26:10,220 by audience members. 548 00:26:10,520 --> 00:26:12,820 So we need as many people as possible to test this. 549 00:26:12,960 --> 00:26:15,180 So hopefully we'll find some vulnerable devices out there. 550 00:26:15,640 --> 00:26:18,000 You're going to be shown a URL on the next slide. 551 00:26:18,540 --> 00:26:19,920 If you see a certificate error 552 00:26:20,400 --> 00:26:21,540 when you visit that 553 00:26:21,540 --> 00:26:22,580 don't do anything. 554 00:26:22,720 --> 00:26:24,780 We don't need to know that you got that error. 555 00:26:25,060 --> 00:26:27,200 But if you see a Spider Labs logo 556 00:26:27,200 --> 00:26:28,480 and we'll show you what that looks like 557 00:26:28,480 --> 00:26:29,860 we'd like you to stand up. 558 00:26:32,260 --> 00:26:33,560 So what we're not going to do, 559 00:26:33,980 --> 00:26:35,680 we're not pushing anything malicious to your device. 560 00:26:35,920 --> 00:26:37,220 So I guess you have to trust us with that. 561 00:26:38,140 --> 00:26:39,780 And we're not exploiting any known 562 00:26:40,260 --> 00:26:41,960 or unknown browser flaws. 563 00:26:42,300 --> 00:26:44,300 So this is an SSL negotiation test. 564 00:26:44,460 --> 00:26:45,400 That's specifically what it is. 565 00:26:46,300 --> 00:26:47,640 And in fact we don't actually 566 00:26:47,640 --> 00:26:49,000 have any JavaScript on that page. 567 00:26:49,080 --> 00:26:50,320 It's pure CSS and HTML. 568 00:26:52,760 --> 00:26:54,160 So a little bit 569 00:26:54,160 --> 00:26:55,600 about what we're going to test. 570 00:26:56,340 --> 00:26:57,780 So basically if you take the 571 00:26:57,780 --> 00:26:59,020 Wayback machine, 572 00:26:59,200 --> 00:27:00,760 go back to 2002, 573 00:27:01,440 --> 00:27:03,600 Moxie actually published a serious Microsoft 574 00:27:03,980 --> 00:27:04,800 Internet Explorer vulnerability 575 00:27:04,800 --> 00:27:07,640 that was basically related to SSL validation checking. 576 00:27:08,780 --> 00:27:10,040 This flaw happens 577 00:27:10,040 --> 00:27:12,020 when a client fails to validate the signer 578 00:27:12,020 --> 00:27:12,640 as a valid CA. 579 00:27:13,440 --> 00:27:15,660 It allows a SSL negotiation to occur 580 00:27:15,660 --> 00:27:17,580 and complete because from its perspective 581 00:27:17,580 --> 00:27:18,960 it found a chain. 582 00:27:19,820 --> 00:27:21,360 So chains are actually 583 00:27:21,360 --> 00:27:23,200 again, unrelated to 584 00:27:23,840 --> 00:27:25,780 whether or not the cert is allowed to be 585 00:27:25,780 --> 00:27:26,920 a signing CA. 586 00:27:27,620 --> 00:27:29,420 That's all in the basic constraints parameter. 587 00:27:29,700 --> 00:27:31,960 So if something fails to check that it should 588 00:27:31,960 --> 00:27:33,520 or should not be capable of signing 589 00:27:33,980 --> 00:27:35,560 and it's just assumed to be capable of signing 590 00:27:35,560 --> 00:27:37,760 you could sign a certificate underneath 591 00:27:37,760 --> 00:27:39,980 your own personal website for some other 592 00:27:39,980 --> 00:27:41,900 website and then just pass that as an 593 00:27:41,900 --> 00:27:43,180 intermediate and it will validate. 594 00:27:43,880 --> 00:27:45,660 So that was what Moxie found at the time. 595 00:27:46,000 --> 00:27:47,520 So we take this to the present day. 596 00:27:47,800 --> 00:27:49,860 If we have a device or we found a device 597 00:27:49,860 --> 00:27:51,880 during our research that this was 598 00:27:51,880 --> 00:27:53,580 successful, it's basically complete 599 00:27:53,580 --> 00:27:55,940 SSL failure. So basically SSL 600 00:27:55,940 --> 00:27:57,040 man in the mill, completely possible 601 00:27:57,040 --> 00:27:59,780 whether a device or an app is 602 00:27:59,780 --> 00:28:02,060 operating on a public network. 603 00:28:02,620 --> 00:28:03,720 So today at DEF CON 604 00:28:03,980 --> 00:28:05,760 2019 we're going to go through and actually see 605 00:28:05,760 --> 00:28:07,640 if this exists on any mobile platforms in the audience. 606 00:28:10,300 --> 00:28:12,020 So do you want to explain what we did to set this up? 607 00:28:12,200 --> 00:28:14,040 So what we did is we requested a cert from a public 608 00:28:14,040 --> 00:28:15,520 CA for a meaningless domain and 609 00:28:15,520 --> 00:28:17,840 specifically in this case we used a cert 610 00:28:17,840 --> 00:28:19,540 that I personally have for my own blog. 611 00:28:20,120 --> 00:28:21,900 Then we used that certificate in Slizzard 612 00:28:21,900 --> 00:28:23,980 to generate and sign a new certificate in private key 613 00:28:23,980 --> 00:28:25,860 just underneath it. So basically we treated 614 00:28:25,860 --> 00:28:27,800 that end entity certificate 615 00:28:27,800 --> 00:28:29,280 as a sub CA. 616 00:28:30,800 --> 00:28:32,100 And then we installed the resulting 617 00:28:32,100 --> 00:28:33,860 certificate and key on test server and 618 00:28:33,980 --> 00:28:34,860 passed the 619 00:28:35,460 --> 00:28:37,960 meaningless domain cert as the intermediate. 620 00:28:39,020 --> 00:28:39,860 So the correct 621 00:28:39,860 --> 00:28:41,420 behavior when visiting this test server 622 00:28:41,420 --> 00:28:43,880 is a certificate error. It just 623 00:28:43,880 --> 00:28:44,420 shouldn't work. 624 00:28:47,420 --> 00:28:49,240 So let's do the test. So 625 00:28:49,780 --> 00:28:51,020 everybody in the room, if you can visit 626 00:28:51,020 --> 00:28:53,420 ssltest.spiderlabs.com 627 00:28:54,140 --> 00:28:55,880 and then if you see 628 00:28:55,880 --> 00:28:57,940 this logo on your screen without having to 629 00:28:57,940 --> 00:28:59,520 click through anything, please stand up. 630 00:28:59,960 --> 00:29:01,540 And you want to do it as well with the audience? 631 00:29:01,700 --> 00:29:03,960 Sure. So I'll go ahead and just take a look. 632 00:29:03,980 --> 00:29:04,960 I'll take a look at it myself here. 633 00:29:09,300 --> 00:29:10,920 Oh, sure. Sorry about that guys. 634 00:29:12,260 --> 00:29:13,540 Sorry. It is 635 00:29:17,260 --> 00:29:18,520 ssltest.spiderlabs.com 636 00:29:18,520 --> 00:29:18,780 ssltest.spiderlabs.com 637 00:29:18,780 --> 00:29:19,540 ssltest.spiderlabs.com 638 00:29:20,000 --> 00:29:22,180 So if you see the logo, please stand up. 639 00:29:28,440 --> 00:29:30,100 Okay. So you want to do it as well 640 00:29:30,100 --> 00:29:31,220 and show the audience what it looks like? 641 00:29:31,220 --> 00:29:32,040 If everybody's got it here. 642 00:29:36,740 --> 00:29:38,320 Please keep standing. 643 00:29:43,040 --> 00:29:45,160 So this is what you should see 644 00:29:45,160 --> 00:29:47,260 if you are vulnerable to this attack. 645 00:29:51,140 --> 00:29:53,420 You should not see a security warning at all. 646 00:29:53,760 --> 00:29:55,140 If you see a security warning, that means 647 00:29:55,140 --> 00:29:56,960 your phone is not vulnerable to this attack. 648 00:30:01,220 --> 00:30:02,140 It's not working at all? 649 00:30:04,840 --> 00:30:06,200 You get the error on the BlackBerry. 650 00:30:06,300 --> 00:30:06,740 That's good. 651 00:30:08,040 --> 00:30:09,260 Let's go back into the... 652 00:30:09,920 --> 00:30:11,400 So we'll explain a little more here. 653 00:30:11,480 --> 00:30:12,740 Sort of the problem here. 654 00:30:14,180 --> 00:30:16,060 So thanks everybody. I guess you can sit back down. 655 00:30:16,220 --> 00:30:17,200 Actually, one question. 656 00:30:17,280 --> 00:30:18,540 While you're standing up. 657 00:30:19,880 --> 00:30:22,580 Is anybody not using an iOS device? 658 00:30:23,380 --> 00:30:25,440 Who did get man in the middle? 659 00:30:25,560 --> 00:30:26,400 We have someone back there. 660 00:30:27,060 --> 00:30:29,200 Okay. If you can see us after the talk... 661 00:30:29,200 --> 00:30:29,920 We'd love to talk to you. 662 00:30:35,360 --> 00:30:36,680 Yeah. So actually, yeah. 663 00:30:36,720 --> 00:30:37,840 So what is your device, sir? 664 00:30:41,460 --> 00:30:42,280 That runs iOS. 665 00:30:44,880 --> 00:30:45,460 Thank you, though. 666 00:30:45,520 --> 00:30:46,260 We have one here. 667 00:30:48,880 --> 00:30:50,320 Oh. Interesting. 668 00:30:50,600 --> 00:30:51,960 Yeah. If you could see us after the talk, 669 00:30:52,040 --> 00:30:52,620 that would be great. 670 00:30:53,940 --> 00:30:55,360 It was a Samsung Rogue, he said. 671 00:30:58,780 --> 00:30:59,100 Yeah. 672 00:30:59,200 --> 00:30:59,900 That is an Android device. 673 00:31:00,380 --> 00:31:01,420 Yeah. So let's... 674 00:31:01,420 --> 00:31:03,240 If you could see us after the talk, 675 00:31:03,340 --> 00:31:04,220 we'd be interested to talk to you. 676 00:31:04,460 --> 00:31:06,640 So basically, anybody using 677 00:31:07,820 --> 00:31:10,700 anything less than iOS 4.3.5. 678 00:31:10,940 --> 00:31:11,900 So if people are aware, 679 00:31:12,180 --> 00:31:14,120 Apple just pushed out a patch 680 00:31:14,120 --> 00:31:14,860 about a week ago, 681 00:31:15,000 --> 00:31:16,960 nine days ago, 682 00:31:17,160 --> 00:31:19,660 that specifically addressed this issue. 683 00:31:20,460 --> 00:31:22,520 Yeah. And it's just for those of you 684 00:31:22,520 --> 00:31:23,280 who might be on Verizon. 685 00:31:23,380 --> 00:31:26,240 It's 4.2.10 is the patch version that fixes it. 686 00:31:26,240 --> 00:31:27,920 And this patch was solely pushed out 687 00:31:27,920 --> 00:31:29,280 to fix only this bug. 688 00:31:29,440 --> 00:31:30,660 There were no other fixes out there 689 00:31:30,660 --> 00:31:32,240 because of the severity of the issue. 690 00:31:32,760 --> 00:31:34,020 Yeah. From the timeframe, 691 00:31:34,160 --> 00:31:35,140 Apple did a great job. 692 00:31:35,320 --> 00:31:38,100 It was ten days after we reported this problem to Apple 693 00:31:38,100 --> 00:31:40,160 that they actually patched and pushed out 694 00:31:40,160 --> 00:31:41,220 the newest release. 695 00:31:41,840 --> 00:31:43,560 So what we show here in the results here, 696 00:31:43,660 --> 00:31:45,180 so the basic constraints test, 697 00:31:45,820 --> 00:31:48,360 browser, Facebook, Mint, Foursquare, and Twitter 698 00:31:48,360 --> 00:31:50,160 all failed open. 699 00:31:50,400 --> 00:31:52,120 And so what that means is that we were able 700 00:31:52,120 --> 00:31:54,960 to establish complete man in the middle via SSL 701 00:31:56,240 --> 00:31:57,540 traffic that was being sent from the 702 00:31:58,060 --> 00:31:59,780 client device to the server. 703 00:32:00,260 --> 00:32:01,600 And a little side note here, 704 00:32:01,640 --> 00:32:03,840 we estimate the iOS user's exposure. 705 00:32:04,080 --> 00:32:06,300 So the people who stood up are still exposed 706 00:32:06,300 --> 00:32:07,680 and are still vulnerable to this attack. 707 00:32:08,420 --> 00:32:09,940 Basically it was about 18 months. 708 00:32:10,640 --> 00:32:12,120 Everything since at least 709 00:32:12,120 --> 00:32:14,000 3.1.3. 710 00:32:14,160 --> 00:32:15,360 Right. And since 711 00:32:16,020 --> 00:32:17,960 Apple tends to end of life after about 712 00:32:17,960 --> 00:32:20,160 two years, each iPhone, 713 00:32:20,920 --> 00:32:22,020 they're no longer eligible 714 00:32:22,020 --> 00:32:23,540 for updates, security otherwise. 715 00:32:23,960 --> 00:32:26,020 3.1.3 was the last version for the 716 00:32:26,240 --> 00:32:26,560 original iPhone. 717 00:32:26,940 --> 00:32:29,900 4.1 something was the last version available 718 00:32:29,900 --> 00:32:31,040 for the iPhone 3G. 719 00:32:31,280 --> 00:32:33,920 So only 3GS and iPhone 4 are actually eligible 720 00:32:33,920 --> 00:32:35,160 to not be vulnerable. 721 00:32:35,760 --> 00:32:37,720 So just a note to the people who are 722 00:32:38,140 --> 00:32:39,660 standing in this room. 723 00:32:40,280 --> 00:32:41,180 All of you, 724 00:32:41,940 --> 00:32:43,420 whether you're on the DEF CON network 725 00:32:43,420 --> 00:32:44,740 or any place else, 726 00:32:44,940 --> 00:32:47,400 could be man in the middle via this method. 727 00:32:47,740 --> 00:32:50,160 And we probably recommend at this point 728 00:32:50,160 --> 00:32:51,500 you put your phone in airplane mode. 729 00:33:01,140 --> 00:33:03,360 The Apple patch fixes the underlying library 730 00:33:03,360 --> 00:33:05,280 so it fixes it for browser and apps 731 00:33:05,280 --> 00:33:05,900 and everything else. 732 00:33:10,100 --> 00:33:11,820 So after our iOS disclosure, 733 00:33:12,420 --> 00:33:14,160 Moxie was pretty tickled 734 00:33:14,160 --> 00:33:15,420 about the fact that one of his bugs 735 00:33:15,420 --> 00:33:16,160 had come back around. 736 00:33:16,540 --> 00:33:18,040 And so he released an updated version 737 00:33:18,040 --> 00:33:19,760 of SSL sniff that will fingerprint 738 00:33:19,760 --> 00:33:22,760 and do this to any device 739 00:33:22,760 --> 00:33:23,680 that you've got on your network. 740 00:33:24,560 --> 00:33:25,880 Eric Monti, one of our 741 00:33:25,880 --> 00:33:26,220 TrustWay partners, 742 00:33:26,240 --> 00:33:28,860 has developed a workaround for iOS developers 743 00:33:28,860 --> 00:33:30,340 who want their app to work on earlier versions 744 00:33:30,340 --> 00:33:32,260 and not rely on iOS to the validation checking. 745 00:33:32,660 --> 00:33:34,220 We're going to be posting a blog post 746 00:33:34,220 --> 00:33:35,320 about that right after the talks 747 00:33:35,320 --> 00:33:37,980 for people who want to incorporate this code snippet. 748 00:33:38,780 --> 00:33:40,300 We'd love more eyeballs on it 749 00:33:40,300 --> 00:33:42,520 because quite frankly we're not sure why it works. 750 00:33:42,660 --> 00:33:43,700 But it does seem to. 751 00:33:44,000 --> 00:33:45,940 The one big implication there is 752 00:33:45,940 --> 00:33:47,660 say you are a financial institution 753 00:33:48,180 --> 00:33:50,280 and you have online banking customers 754 00:33:50,280 --> 00:33:52,020 who are using a banking app 755 00:33:52,020 --> 00:33:53,020 from an iOS device. 756 00:33:53,740 --> 00:33:56,060 If those customers are not patched 757 00:33:56,240 --> 00:33:58,240 that means that all the customers in your ecosystem 758 00:33:58,240 --> 00:33:59,740 that are not using this latest version 759 00:33:59,740 --> 00:34:01,300 are now vulnerable. 760 00:34:01,500 --> 00:34:04,200 So iOS developers may want to implement 761 00:34:04,200 --> 00:34:05,640 this or 762 00:34:06,160 --> 00:34:07,760 specifically that banking application developer 763 00:34:07,760 --> 00:34:08,700 may want to implement this 764 00:34:08,700 --> 00:34:11,680 to fix it retroactively 765 00:34:11,680 --> 00:34:12,520 in older devices. 766 00:34:12,980 --> 00:34:14,560 And then just recently 767 00:34:15,220 --> 00:34:17,840 Hubert or whatever his name might be 768 00:34:17,840 --> 00:34:19,420 he's solely by this alias 769 00:34:19,420 --> 00:34:20,780 released a tool called iSniff 770 00:34:20,780 --> 00:34:22,680 which also is SSL man in the middle 771 00:34:22,680 --> 00:34:25,100 using iOS less than 435. 772 00:34:26,240 --> 00:34:27,800 So you can check that out on GitHub as well. 773 00:34:30,360 --> 00:34:32,840 So just to conclude here 774 00:34:33,620 --> 00:34:34,700 the basic 775 00:34:34,700 --> 00:34:36,700 takeaway is that we need more eyes 776 00:34:36,700 --> 00:34:38,580 on this type of technology 777 00:34:38,580 --> 00:34:39,760 on this testing. 778 00:34:39,920 --> 00:34:41,480 That's why we put together this toolkit 779 00:34:41,480 --> 00:34:42,800 for developers 780 00:34:42,800 --> 00:34:44,800 to be able to test their apps 781 00:34:44,800 --> 00:34:45,500 test their devices 782 00:34:45,500 --> 00:34:47,700 and define these problems and fix them. 783 00:34:48,340 --> 00:34:50,020 But I guess from a user perspective 784 00:34:50,020 --> 00:34:52,300 we all have to insist that 785 00:34:53,260 --> 00:34:54,880 SSL is used for all data transmission. 786 00:34:56,240 --> 00:34:57,360 And we also need to also insist 787 00:34:57,360 --> 00:34:58,780 that the mobile device manufacturers 788 00:34:58,780 --> 00:35:00,300 the mobile platform developers 789 00:35:00,300 --> 00:35:01,420 fix their UI. 790 00:35:01,700 --> 00:35:04,200 So it's more recognizable to us 791 00:35:04,200 --> 00:35:05,260 and other end users 792 00:35:05,260 --> 00:35:08,580 what's going on from a secure data transmission standpoint. 793 00:35:10,740 --> 00:35:11,620 Apps and devices 794 00:35:11,620 --> 00:35:13,060 that should always fail close 795 00:35:13,060 --> 00:35:13,980 when there's an SSL problem. 796 00:35:14,240 --> 00:35:16,040 So in that regard our testing has revealed 797 00:35:16,040 --> 00:35:17,420 that in general they try to do that. 798 00:35:17,500 --> 00:35:19,240 That's a big improvement over the past years. 799 00:35:20,980 --> 00:35:23,220 And that's an encouraging note I guess. 800 00:35:23,340 --> 00:35:25,660 But it results in a 801 00:35:26,240 --> 00:35:27,760 larger dependence 802 00:35:27,760 --> 00:35:29,160 on a single failure point 803 00:35:29,160 --> 00:35:31,400 which hopefully people will continue to 804 00:35:33,180 --> 00:35:34,140 consistently test 805 00:35:34,140 --> 00:35:35,900 to make sure it doesn't have problems 806 00:35:35,900 --> 00:35:36,920 that have occurred in the past. 807 00:35:37,260 --> 00:35:38,700 And I guess the one final piece 808 00:35:38,700 --> 00:35:41,140 the gentleman that actually had that Samsung device 809 00:35:41,140 --> 00:35:42,480 if you can meet us here 810 00:35:42,480 --> 00:35:44,880 when we were doing this talk 811 00:35:44,880 --> 00:35:47,460 we knew that the iOS devices would be vulnerable 812 00:35:47,460 --> 00:35:49,640 because we released that advisory with Apple 813 00:35:50,140 --> 00:35:51,660 and we were hoping that 814 00:35:51,660 --> 00:35:52,660 we might find another device. 815 00:35:52,800 --> 00:35:54,960 Obviously in our test lab we didn't have 816 00:35:56,240 --> 00:35:57,420 the computers of devices to play with 817 00:35:57,420 --> 00:35:59,660 and the gentleman with the Samsung device 818 00:35:59,660 --> 00:36:00,460 if you can meet us 819 00:36:00,460 --> 00:36:03,000 we want to find a little more details about that device 820 00:36:03,000 --> 00:36:04,400 and it may have 821 00:36:04,400 --> 00:36:06,500 you may see an advisory come out very soon 822 00:36:06,500 --> 00:36:07,500 on that platform as well. 823 00:36:08,740 --> 00:36:10,820 So that's our talk. Thanks everybody. 824 00:36:11,040 --> 00:36:11,520 Thank you.