1 00:00:00,000 --> 00:00:07,480 Okay, so my name is Moxie Marlinspike. I'm here for the Institute for Disruptive Studies. It's like an anarchist think tank. 2 00:00:09,340 --> 00:00:13,320 I'm going to be talking about some new tricks for defeating SSL in practice. 3 00:00:14,980 --> 00:00:19,800 I eventually hope to leave you guys with undetectable man-in-the-middle attacks against SSL connections. 4 00:00:20,940 --> 00:00:26,440 But it's part of a story. So I'm going to start, you know, I hate to repeat myself, 5 00:00:26,440 --> 00:00:30,900 but I'm going to start with the old and eventually come to the new. 6 00:00:32,400 --> 00:00:35,620 So the story starts with this concept of basic constraints. 7 00:00:37,860 --> 00:00:40,680 And that story starts with certificate chaining. 8 00:00:41,940 --> 00:00:46,540 So when people think about certificates, they usually think about certificates coming in pairs. 9 00:00:46,760 --> 00:00:48,140 They think of two types of certificates. 10 00:00:48,720 --> 00:00:53,240 CA certificates, you know, these things that are sort of all powerful, they're embedded in your web browser. 11 00:00:53,960 --> 00:00:55,800 And then site certificates. 12 00:00:56,440 --> 00:01:00,620 These are the things that identify leaf nodes or any given end entity. 13 00:01:02,000 --> 00:01:04,340 But sometimes the picture is a little bit more complicated. 14 00:01:05,500 --> 00:01:08,760 Instead of just two certificates, there could be more. 15 00:01:09,140 --> 00:01:10,580 You could have a certificate chain. 16 00:01:11,840 --> 00:01:14,580 The idea itself kind of makes sense. 17 00:01:15,080 --> 00:01:18,380 Perhaps you'd like to delegate signing authority to a third party, 18 00:01:19,180 --> 00:01:23,480 but that third party doesn't have their certificate embedded in every web browser since 1996. 19 00:01:24,340 --> 00:01:25,180 So what do you do? 20 00:01:25,300 --> 00:01:26,300 You sign the third party. 21 00:01:26,440 --> 00:01:28,680 They sign your certificate, and they, in turn, sign your certificate. 22 00:01:29,380 --> 00:01:37,100 And so, you know, when you get one of these things, you apply, you know, you hand the whole thing to a web browser and the web browser deals with it, okay? 23 00:01:38,840 --> 00:01:40,640 And, you know, it could be more than three. 24 00:01:41,000 --> 00:01:44,380 You can have any number of intermediate certificate authorities in the chain. 25 00:01:44,580 --> 00:01:48,200 I don't think that there's any standard that says how many is the maximum. 26 00:01:48,360 --> 00:01:49,480 I think it's implementation specific. 27 00:01:50,000 --> 00:01:51,940 I know for Firefox, it's like 25. 28 00:01:52,820 --> 00:01:56,400 So you could have a certificate chain with 25 intermediate CA. 29 00:01:56,440 --> 00:02:00,300 So the question is, how do we verify these things? 30 00:02:00,580 --> 00:02:01,660 You know, you get a certificate chain. 31 00:02:01,760 --> 00:02:02,100 What do you do? 32 00:02:04,180 --> 00:02:07,980 And what everyone says is you start with a leaf node, 33 00:02:08,480 --> 00:02:12,560 and you verify that the name on the leaf node is the same as the name of the site you're trying to connect to. 34 00:02:13,120 --> 00:02:17,440 Then you verify that the leaf certificate hasn't expired, and then you check its signature. 35 00:02:18,580 --> 00:02:22,640 And if the signing CA is in your list of trusted root certificate authorities, you stop. 36 00:02:22,980 --> 00:02:25,600 Otherwise, you move one up the chain, and you repeat. 37 00:02:28,480 --> 00:02:36,420 So here's, you know, a picture from IBM's website today, and, you know, it has a little graph about validating these things. 38 00:02:36,540 --> 00:02:42,040 And, you know, they lay it all out in the same way of you start with a leaf node, and you keep going back up. 39 00:02:42,940 --> 00:02:52,560 I've said before that I feel like when looking for security vulnerabilities, a good place to start is places where developers might not understand the full scope of what's going on, 40 00:02:52,640 --> 00:02:55,780 and yet feel really good about the solutions that they implement. 41 00:02:56,780 --> 00:03:02,240 So, for instance, when validating a certificate chain, it's tempting to use a simple recursive function. 42 00:03:03,420 --> 00:03:12,220 And this is a situation where, you know, a developer might implement a solution and think, man, I used recursion today, and it was awesome, you know? 43 00:03:12,940 --> 00:03:16,400 It was like the same function calling itself over, you know? 44 00:03:19,380 --> 00:03:26,420 But the results of sort of a naive recursive attempt at validation is that you will ensure that a certificate chain is completely valid. 45 00:03:26,440 --> 00:03:27,980 It's complete, but nothing more. 46 00:03:29,060 --> 00:03:30,380 And here's what I mean by that. 47 00:03:30,900 --> 00:03:33,320 So let's say you have this picture, a fairly common picture. 48 00:03:34,600 --> 00:03:42,560 Some root certificate authority, a couple of intermediate CAs, and then your leaf node that identifies a website you own, like thoughtcrime.org. 49 00:03:42,640 --> 00:03:43,660 It's a website I have. 50 00:03:44,700 --> 00:03:48,880 So what is to stop me from doing this? 51 00:03:51,180 --> 00:03:54,860 Creating another certificate for some other website, paypal.com. 52 00:03:55,080 --> 00:03:56,420 And then signing it with mine. 53 00:03:56,440 --> 00:03:57,140 And then my leaf certificate. 54 00:03:57,680 --> 00:04:00,220 And then passing that whole chain to any client. 55 00:04:00,740 --> 00:04:05,220 If you go back and you look at what people say about how you validate these things, we haven't really done anything wrong. 56 00:04:06,720 --> 00:04:08,240 You know, all the signatures are valid. 57 00:04:08,940 --> 00:04:09,680 Nothing's expired. 58 00:04:10,380 --> 00:04:11,900 The chain itself is intact. 59 00:04:12,280 --> 00:04:16,540 And the root CA is embedded in the web browser and trusted. 60 00:04:18,480 --> 00:04:22,020 But we just created a certificate for paypal, and we're not paypal. 61 00:04:23,000 --> 00:04:26,420 So the missing piece is this somewhat obscure field called baselink. 62 00:04:26,440 --> 00:04:26,880 Basic constraints. 63 00:04:28,200 --> 00:04:31,740 The idea is that not all certificates should be able to do all things, right? 64 00:04:31,820 --> 00:04:37,280 Like if you have an end entity certificate for a website, that should really only be used to identify your website. 65 00:04:37,540 --> 00:04:42,280 It shouldn't be used to sign other certificates or for key revocation or anything like that. 66 00:04:43,760 --> 00:04:49,640 The problem was that back in the day, when most certificate authorities would issue certificates, they would just leave this field out. 67 00:04:50,860 --> 00:04:55,940 And you would think that, like, if you were writing an SSL implementation and you were sort of checking a certificate, 68 00:04:56,440 --> 00:05:01,820 if this thing was just absent, you would assume the conservative thing, that this is not a certificate authority certificate. 69 00:05:02,740 --> 00:05:08,600 But it turns out that whether the field was there or not, most SSL implementations just didn't bother to check it. 70 00:05:09,620 --> 00:05:18,360 What this meant was that anyone with a valid leaf note certificate for any domain could create and sign a leaf certificate for any other domain. 71 00:05:19,140 --> 00:05:23,760 It essentially meant that anyone who had a valid leaf note certificate had a CA cert. 72 00:05:25,800 --> 00:05:26,420 And what this meant was that anyone who had a valid leaf note certificate had a CA cert. 73 00:05:26,440 --> 00:05:29,940 And what this meant was that anyone who had a valid leaf note certificate had a CA cert. 74 00:05:33,520 --> 00:05:35,720 And what this meant was that anyone who had a valid leaf note certificate had a CA cert. 75 00:05:37,180 --> 00:05:39,100 And what this meant was that anyone who had a valid leaf note certificate had a CA cert. 76 00:05:39,100 --> 00:05:41,180 And what this meant was that anyone who had a valid leaf note certificate had a CA cert. 77 00:05:41,180 --> 00:05:42,720 And what this meant was that anyone who had a valid leaf note certificate had a CA cert. 78 00:05:42,720 --> 00:05:43,280 And what this meant was that anyone who had a valid leaf note certificate had a CA cert. 79 00:05:43,280 --> 00:05:45,600 And what this meant was that anyone who had a valid leaf note certificate had a CA cert. 80 00:05:45,600 --> 00:05:46,780 And what this meant was that anyone who had a valid leaf note certificate had a CA cert. 81 00:05:46,780 --> 00:05:48,700 And what this meant was that anyone who had a valid leaf note certificate had a CA cert. 82 00:05:48,700 --> 00:05:53,700 And what this meant was that anyone who had a valid leaf note certificate had a CA cert. 83 00:05:53,700 --> 00:06:00,320 SNF. It works like you'd expect. Let's say you have a client and a server. Client's trying 84 00:06:00,320 --> 00:06:05,340 to connect to the server using SSL. It's trying to connect to PayPal. SSL SNF would perform 85 00:06:05,340 --> 00:06:09,040 a man in the middle attack. So it intercepts the client's connection request to the server 86 00:06:10,380 --> 00:06:13,620 and generates a certificate for the site that the client is trying to connect to. So it 87 00:06:13,620 --> 00:06:18,160 generates a certificate for PayPal.com on the fly. And then it signs it with any random 88 00:06:18,160 --> 00:06:21,620 leaf node certificate that you give it. And then it passes the whole chain back to the 89 00:06:21,620 --> 00:06:27,320 client. Simultaneously on the server side, it makes a normal SSL connection to the server 90 00:06:27,980 --> 00:06:32,560 and then starts passing data back and forth between the client and the server. The important 91 00:06:32,560 --> 00:06:37,600 thing is that in the middle here, the data is in the clear. And you can log it or modify 92 00:06:37,600 --> 00:06:51,580 it or do whatever you want. Okay. So the question is, post disclosure, you 93 00:06:51,620 --> 00:06:59,660 know, 2002 was a while ago. Is this thing still useful? Is this tool still useful? So 94 00:06:59,660 --> 00:07:05,220 first, you'd be surprised who still doesn't check basic constraints. The second thing 95 00:07:05,220 --> 00:07:11,040 was that even after browsers had been patched, this tool was pretty effective because you 96 00:07:11,040 --> 00:07:14,740 would be surprised, you know, most of the time users would just click through the dialogues. 97 00:07:16,100 --> 00:07:21,600 And there's actually some kind of cool stuff you could do where, like, a lot of SSL users 98 00:07:21,620 --> 00:07:26,480 would start to validate a certificate and then as soon as something was wrong with the 99 00:07:26,480 --> 00:07:30,640 certificate, they would pop up a dialogue telling you something was wrong. And, like, 100 00:07:30,660 --> 00:07:34,960 the second thing that they do after checking the name is check the time stamp to see whether 101 00:07:34,960 --> 00:07:39,140 it's expired or not. So you could on the fly create certificates that expired ten minutes 102 00:07:39,140 --> 00:07:43,880 ago. The signatures are totally bogus, like, completely fucked. And it would pop up the 103 00:07:43,880 --> 00:07:48,480 dialogue that's like, something's wrong! This certificate expired ten minutes ago. And, 104 00:07:48,560 --> 00:07:51,600 you know, most users would be, like, well, it only expired ten minutes ago. I mean, one's 105 00:07:51,600 --> 00:07:57,180 you know, it's not that bad, you know. So, you know, but it wouldn't tell you about the 106 00:07:57,180 --> 00:07:59,620 signature problems or whatever, you know, because it would just get right there and stop. 107 00:08:00,240 --> 00:08:06,020 So, yeah, so it was still useful in that sense. And then it's still just useful as a general 108 00:08:06,020 --> 00:08:09,940 tool for man-in-the-middle attacks on SSL. Like the folks that did the MD5 hash collision 109 00:08:09,940 --> 00:08:14,000 stuff, they used this tool to deploy their CA cert, right, because once you get a CA cert, 110 00:08:14,140 --> 00:08:21,420 that's nice, but how do you do, like, on the fly man-in-the-middle attacks, right? Well, 111 00:08:21,420 --> 00:08:24,700 generate a certificate on the fly, sign it with whatever certificate you give it, and 112 00:08:24,700 --> 00:08:27,500 then pass the thing back to the client, right? And that's exactly what this does. 113 00:08:28,560 --> 00:08:38,180 And so then there's other uses yet to be disclosed another day and today. More lately I've been 114 00:08:38,180 --> 00:08:43,300 talking about SSL stripping. I've been talking about it a lot lately, so I'll try and be 115 00:08:43,740 --> 00:08:50,240 kind of brief. But SSL stripping is fundamentally about the concept of bridges, right? So, the 116 00:08:50,240 --> 00:08:51,120 thing is that SSL... 117 00:08:51,120 --> 00:08:51,400 007 007 007 007 007 118 00:08:51,400 --> 00:08:53,580 is useful, but how it's deployed 119 00:08:53,580 --> 00:08:54,640 really matters. 120 00:08:57,580 --> 00:08:59,420 On the web, SSL 121 00:08:59,420 --> 00:09:01,180 is almost never encountered directly. 122 00:09:02,100 --> 00:09:03,300 Very few people type 123 00:09:03,300 --> 00:09:05,440 HTTPS colon forward forward slash 124 00:09:05,440 --> 00:09:07,420 something into their URL bar. 125 00:09:07,640 --> 00:09:09,460 Most people type bankofamerica.com 126 00:09:09,460 --> 00:09:09,740 enter. 127 00:09:11,140 --> 00:09:13,400 And so, my sort of thesis 128 00:09:13,400 --> 00:09:15,440 is that SSL on the web is 129 00:09:15,440 --> 00:09:17,100 really only encountered in one of two ways. 130 00:09:17,360 --> 00:09:19,160 It's either encountered as a 302 131 00:09:19,160 --> 00:09:20,760 redirect from an 132 00:09:20,760 --> 00:09:22,860 HTTP URL, so it's either encountered 133 00:09:22,860 --> 00:09:25,080 by somebody typing bankofamerica.com 134 00:09:25,080 --> 00:09:26,740 enter into their URL bar, 135 00:09:26,900 --> 00:09:28,900 which makes an HTTP request to the server. 136 00:09:29,140 --> 00:09:31,140 The server responds with a 302 redirect 137 00:09:31,140 --> 00:09:32,800 that says, please, instead, 138 00:09:32,960 --> 00:09:34,840 connect to HTTPS colon forward forward slash 139 00:09:34,840 --> 00:09:37,020 bankofamerica.com, and the browser just 140 00:09:37,020 --> 00:09:38,620 sort of gets upgraded to SSL. 141 00:09:39,380 --> 00:09:41,080 And then the second way is through clicking 142 00:09:41,080 --> 00:09:42,660 on links, right? So most users 143 00:09:42,660 --> 00:09:45,000 browse along, and eventually they 144 00:09:45,000 --> 00:09:46,060 encounter a link that says 145 00:09:46,700 --> 00:09:48,800 sign in or shopping cart 146 00:09:48,800 --> 00:09:50,460 or checkout or whatever. 147 00:09:50,700 --> 00:09:52,620 And that's the moment where they encounter 148 00:09:52,620 --> 00:09:53,380 SSL on the web. 149 00:09:54,560 --> 00:09:56,260 Both of those points are bridges 150 00:09:57,020 --> 00:09:58,660 between an insecure and a secure 151 00:09:58,660 --> 00:09:59,020 protocol. 152 00:10:00,260 --> 00:10:01,700 And they're weak points. 153 00:10:03,820 --> 00:10:04,820 So, the idea 154 00:10:04,820 --> 00:10:06,660 is that maybe we can attack SSL 155 00:10:06,660 --> 00:10:07,660 before we even get there. 156 00:10:09,260 --> 00:10:10,760 So in the past, you know, SSL 157 00:10:10,760 --> 00:10:12,560 sniff would go after the SSL 158 00:10:12,560 --> 00:10:14,560 connection itself, right? Its job was to 159 00:10:14,560 --> 00:10:16,440 man in the middle the actual SSL connection. 160 00:10:16,920 --> 00:10:18,540 And so I wrote a different tool, 161 00:10:18,800 --> 00:10:19,540 called SSL strip. 162 00:10:20,460 --> 00:10:22,620 And what it does is perform man in the middle attacks 163 00:10:22,620 --> 00:10:24,760 on the HTTP connections that will inevitably 164 00:10:24,760 --> 00:10:26,440 happen before an SSL connection. 165 00:10:27,280 --> 00:10:28,840 And that's not hard at all, because it's 166 00:10:28,840 --> 00:10:29,500 not a secure protocol. 167 00:10:30,460 --> 00:10:32,300 So SSL strip basically just 168 00:10:32,300 --> 00:10:34,660 does a man in the middle attack on all the HTTP 169 00:10:34,660 --> 00:10:36,760 connections on a network, and it 170 00:10:36,760 --> 00:10:37,760 watches the traffic go by. 171 00:10:38,560 --> 00:10:40,320 And in its most basic form, 172 00:10:40,860 --> 00:10:42,700 it looks for these two points, 173 00:10:42,880 --> 00:10:44,620 links and 302 redirects. 174 00:10:44,960 --> 00:10:46,720 And if it sees an HTTPS link, 175 00:10:46,880 --> 00:10:48,700 it swaps it for an identical, 176 00:10:48,800 --> 00:10:50,540 HTTP link, and it keeps 177 00:10:50,540 --> 00:10:51,800 a map of what has changed. 178 00:10:52,860 --> 00:10:54,620 If it sees a 302 redirect, it 179 00:10:54,620 --> 00:10:56,260 looks for the location header, which is where the 180 00:10:56,260 --> 00:10:58,600 redirect URL will be. And if it sees an 181 00:10:58,600 --> 00:11:00,840 HTTPS link in there, it swaps it for an identical 182 00:11:00,840 --> 00:11:02,800 HTTP lookalike, and it keeps 183 00:11:02,800 --> 00:11:03,700 a map of what has changed. 184 00:11:04,520 --> 00:11:06,720 Then it continues to watch the HTTP traffic go by. 185 00:11:07,400 --> 00:11:08,780 And if it sees a request for 186 00:11:08,780 --> 00:11:10,740 a URL that it's stripped, it 187 00:11:10,740 --> 00:11:12,500 proxies that out as SSL to the server. 188 00:11:12,820 --> 00:11:14,860 Right? So the server never knows 189 00:11:14,860 --> 00:11:16,600 anything's wrong. It's getting SSL connections 190 00:11:16,600 --> 00:11:18,780 on the URLs that it expects to get SSLed to. 191 00:11:18,780 --> 00:11:19,480 SSL connections for. 192 00:11:20,620 --> 00:11:22,260 And, you know, on the client side, 193 00:11:22,460 --> 00:11:24,040 it still just happens to be HTTP. 194 00:11:25,160 --> 00:11:26,580 And then you just keep watching the 195 00:11:26,580 --> 00:11:28,200 HTTPS traffic come back from the server, 196 00:11:29,700 --> 00:11:30,700 and you keep 197 00:11:30,700 --> 00:11:32,560 a map of all the relative CSS links, 198 00:11:32,740 --> 00:11:33,500 JavaScript links, 199 00:11:34,660 --> 00:11:36,700 you know, all that stuff, right? Because that should be, 200 00:11:36,760 --> 00:11:38,260 those should be SSL connections too. 201 00:11:38,960 --> 00:11:40,980 And of course you log everything that you want to log. 202 00:11:42,120 --> 00:11:42,700 So how does 203 00:11:42,700 --> 00:11:43,220 this look, right? 204 00:11:49,880 --> 00:11:50,960 So the idea 205 00:11:51,440 --> 00:11:52,820 behind most of this stuff is that 206 00:11:52,820 --> 00:11:54,820 there's been sort of an evolution in the way 207 00:11:54,820 --> 00:11:56,580 that browsers deal with 208 00:11:56,580 --> 00:11:58,540 what I would call positive or negative feedback. 209 00:11:59,200 --> 00:12:00,600 It used to be in the past that 210 00:12:00,600 --> 00:12:02,720 browsers, I felt, had this strong 211 00:12:02,720 --> 00:12:04,800 emphasis on positive feedback, right? 212 00:12:05,040 --> 00:12:06,880 That little padlock icon was everywhere. 213 00:12:07,140 --> 00:12:08,680 You know? It was in the status 214 00:12:08,680 --> 00:12:10,520 bar, down in the bottom right, you know, 215 00:12:10,520 --> 00:12:13,000 Firefox's entire URL bar would turn gold. 216 00:12:13,220 --> 00:12:14,860 You know, there's all these things telling 217 00:12:14,860 --> 00:12:16,580 you, this is secure, right? 218 00:12:17,400 --> 00:12:18,620 And by contrast, 219 00:12:18,780 --> 00:12:20,280 if there was a problem, it would just pop up a dialogue. 220 00:12:20,640 --> 00:12:22,700 You know? But today I feel like 221 00:12:22,700 --> 00:12:24,820 there's been this evolution of toning 222 00:12:24,820 --> 00:12:26,780 down the positive feedback and ratcheting up 223 00:12:26,780 --> 00:12:28,580 the negative feedback. So all the little 224 00:12:28,580 --> 00:12:30,600 lock icons, there's just sort of less and less of them. 225 00:12:30,780 --> 00:12:32,620 You know, there's less things to tell you that things are 226 00:12:32,620 --> 00:12:34,620 secure, and more things to tell you that 227 00:12:34,620 --> 00:12:36,540 things are really bad, right? 228 00:12:36,600 --> 00:12:38,800 There's not just dialogue boxes anymore. Like on Firefox, 229 00:12:39,480 --> 00:12:40,880 if there's a problem, it actually, 230 00:12:40,980 --> 00:12:42,700 the page renders out to say there's something 231 00:12:42,700 --> 00:12:44,680 really wrong. It takes something like 232 00:12:44,680 --> 00:12:46,340 five clicks or something to get through that. 233 00:12:46,480 --> 00:12:48,560 I mean, it's not the thing that users just click OK anymore. 234 00:12:48,780 --> 00:12:50,240 Right? And so, 235 00:12:50,700 --> 00:12:52,940 the idea is that if you can avoid the negative 236 00:12:52,940 --> 00:12:53,360 feedback, 237 00:12:55,120 --> 00:12:56,560 you're in really good shape, right? 238 00:12:56,760 --> 00:12:58,620 And if you fail to trigger the positive feedback, 239 00:12:58,900 --> 00:13:00,060 maybe it's not so bad. 240 00:13:00,660 --> 00:13:02,420 That most user experiences, 241 00:13:02,640 --> 00:13:04,560 they just browse along until they 242 00:13:04,560 --> 00:13:05,780 encounter something that says, 243 00:13:06,400 --> 00:13:08,020 look out, there's something very wrong. 244 00:13:08,240 --> 00:13:09,520 And until they see that, 245 00:13:09,680 --> 00:13:11,640 they don't think anything's amiss. 246 00:13:12,120 --> 00:13:14,180 So how does this basic attack look? 247 00:13:14,380 --> 00:13:16,580 This SSL stripping attack, right? So this is like 248 00:13:17,760 --> 00:13:18,800 Gmail's login page 249 00:13:18,800 --> 00:13:20,060 on Firefox 3. 250 00:13:21,080 --> 00:13:22,400 You know, this is the secure version. 251 00:13:23,300 --> 00:13:24,260 This is the strip version. 252 00:13:26,780 --> 00:13:28,520 It's pretty subtle, no dialogue boxes, 253 00:13:28,660 --> 00:13:30,460 nothing saying everything is wrong, 254 00:13:30,600 --> 00:13:32,360 you know. This is Safari, 255 00:13:32,600 --> 00:13:33,720 right? This is the secure version. 256 00:13:34,740 --> 00:13:35,680 This is the strip version. 257 00:13:37,400 --> 00:13:38,440 Show it to you again. So there's 258 00:13:38,440 --> 00:13:40,320 the only thing on Safari is if you look at the 259 00:13:40,320 --> 00:13:42,340 top right, there's that little blind 260 00:13:42,340 --> 00:13:43,540 embossed padlock. 261 00:13:44,480 --> 00:13:45,400 That's the thing that disappears. 262 00:13:47,860 --> 00:13:49,040 So not bad, right? 263 00:13:50,640 --> 00:13:52,520 And this evolution of positive 264 00:13:52,520 --> 00:13:54,300 and negative feedback really helps 265 00:13:54,300 --> 00:13:56,400 this technique, right? So this is 266 00:13:56,980 --> 00:13:58,400 I've been talking about this a lot, but this is 267 00:13:58,400 --> 00:14:00,340 just the starting point for this type of attack. 268 00:14:00,480 --> 00:14:02,060 Once you start to attack this bridge between 269 00:14:02,060 --> 00:14:04,400 HTTP and HTTPS, there's a whole ecosystem 270 00:14:04,400 --> 00:14:06,160 of things that you can do. One of the 271 00:14:06,600 --> 00:14:07,340 ways that I 272 00:14:08,000 --> 00:14:10,300 one of the things I suggested of a different 273 00:14:10,300 --> 00:14:12,140 direction you can go from there is adopting 274 00:14:12,140 --> 00:14:13,380 homograph attacks to 275 00:14:14,500 --> 00:14:16,160 work in this situation as well. 276 00:14:16,580 --> 00:14:18,480 There's a whole bunch of stuff that I've already written 277 00:14:18,480 --> 00:14:20,300 about it that if you're interested 278 00:14:20,300 --> 00:14:21,360 you can find elsewhere. 279 00:14:21,980 --> 00:14:24,160 So the question today is 280 00:14:24,160 --> 00:14:25,140 where can we go from here? 281 00:14:27,100 --> 00:14:28,300 The larger question 282 00:14:28,300 --> 00:14:29,940 for me is where do we need to go from here? 283 00:14:30,200 --> 00:14:32,120 I maintain that this stripping attack is 284 00:14:32,120 --> 00:14:34,320 deadly in practice and will be deadly 285 00:14:34,320 --> 00:14:35,140 for a long time. 286 00:14:36,060 --> 00:14:36,540 In 287 00:14:38,680 --> 00:14:39,960 field testing it 288 00:14:40,580 --> 00:14:41,800 has 100% success rate. 289 00:14:44,780 --> 00:14:45,720 Seriously, even 290 00:14:46,860 --> 00:14:48,420 there was some response 291 00:14:48,420 --> 00:14:50,300 to this where people were like, oh, this is a matter of 292 00:14:50,300 --> 00:14:52,500 user education. Users don't know what they're doing. 293 00:14:52,680 --> 00:14:54,560 So I gave the same talk just about 294 00:14:54,560 --> 00:14:56,360 SSL stripping at Black Hat 295 00:14:56,360 --> 00:14:57,820 Europe in Amsterdam. 296 00:14:58,120 --> 00:15:00,560 For like 20 minutes before the talk 297 00:15:00,560 --> 00:15:02,200 I ran SSL strip on the network and I got 298 00:15:02,200 --> 00:15:04,040 100 passwords from 299 00:15:04,560 --> 00:15:05,680 so-called security professionals. 300 00:15:06,960 --> 00:15:08,540 So I put their passwords 301 00:15:08,540 --> 00:15:09,780 up on a slide that was like, see? 302 00:15:10,120 --> 00:15:12,500 If you see your password here, you also 303 00:15:12,500 --> 00:15:13,300 fell victim to this. 304 00:15:15,340 --> 00:15:16,060 Anyway, so 305 00:15:16,580 --> 00:15:17,880 this is deadly in practice, 306 00:15:18,140 --> 00:15:19,900 but what do we need? 307 00:15:20,260 --> 00:15:22,460 So there's some places that this 308 00:15:22,460 --> 00:15:23,460 technique does not reach. 309 00:15:24,220 --> 00:15:26,220 One of them is people that are starting to use 310 00:15:26,220 --> 00:15:28,500 bookmarks now for their secure sites. 311 00:15:28,780 --> 00:15:30,460 So there's people that 312 00:15:30,460 --> 00:15:32,700 have their Gmail login bookmarked 313 00:15:32,700 --> 00:15:33,620 to be HTTPS. 314 00:15:33,900 --> 00:15:35,440 So they don't expose the bridge. 315 00:15:36,300 --> 00:15:37,780 And then the other thing is other protocols. 316 00:15:38,120 --> 00:15:40,100 There's plenty of SSL-based protocols like 317 00:15:40,100 --> 00:15:42,440 IMAP, IMAP-S, 318 00:15:42,540 --> 00:15:44,140 SMTPS, POP3S, 319 00:15:45,600 --> 00:15:46,340 you know, 320 00:15:46,580 --> 00:15:48,660 IRC, SSL over IRC, 321 00:15:48,720 --> 00:15:50,540 stuff like that. And those protocols don't 322 00:15:50,540 --> 00:15:52,680 expose this bridge. SSL VPNs, 323 00:15:52,680 --> 00:15:54,560 stuff like that. So what we 324 00:15:54,560 --> 00:15:56,000 need is a different technique to 325 00:15:56,880 --> 00:15:58,420 attack these points. 326 00:15:59,960 --> 00:16:00,480 Okay. 327 00:16:00,520 --> 00:16:02,500 So let's start thinking 328 00:16:02,500 --> 00:16:04,540 about that. The first thing is what's up 329 00:16:04,540 --> 00:16:05,740 with certificates, right? 330 00:16:05,960 --> 00:16:08,540 Everyone always talks about certificates, but what are they really? 331 00:16:09,080 --> 00:16:10,520 They're actually these pretty simple 332 00:16:10,520 --> 00:16:10,900 structures. 333 00:16:12,140 --> 00:16:14,100 The basic point of a certificate is to 334 00:16:14,100 --> 00:16:15,600 identify some subject 335 00:16:16,580 --> 00:16:18,340 and convey that subject's public key. 336 00:16:19,420 --> 00:16:20,460 The certificate is 337 00:16:20,460 --> 00:16:22,440 thought to be good because it's issued by 338 00:16:22,440 --> 00:16:24,400 some issuer that people might think 339 00:16:24,400 --> 00:16:25,480 is trustworthy. 340 00:16:25,980 --> 00:16:28,180 And it's known to be authentic 341 00:16:28,180 --> 00:16:29,700 based on that issuer's signature. 342 00:16:31,540 --> 00:16:32,580 This is what a certificate 343 00:16:32,580 --> 00:16:34,460 looks like. This is Google's 344 00:16:34,460 --> 00:16:36,320 certificate. And you can see that 345 00:16:36,320 --> 00:16:38,180 the subject is Google 346 00:16:38,180 --> 00:16:40,300 and it's issued by thought and 347 00:16:40,300 --> 00:16:41,900 there's some public key in there. 348 00:16:43,480 --> 00:16:44,000 Now, 349 00:16:44,860 --> 00:16:45,940 when designing a secure 350 00:16:46,580 --> 00:16:48,580 protocol, the three big things 351 00:16:48,580 --> 00:16:50,120 that you're after are secrecy, 352 00:16:50,260 --> 00:16:51,840 authenticity, and integrity. 353 00:16:52,980 --> 00:16:54,560 Most people talk about secrecy. 354 00:16:54,760 --> 00:16:56,520 They think of encryption and they think 355 00:16:56,520 --> 00:16:58,560 secrecy. But if you don't have authenticity 356 00:16:58,560 --> 00:17:00,140 and integrity, you don't have anything. 357 00:17:00,500 --> 00:17:00,960 They're 358 00:17:02,760 --> 00:17:04,460 critical, and we will see why. 359 00:17:06,680 --> 00:17:08,120 The basic SSL 360 00:17:08,120 --> 00:17:10,300 beginnings of a handshake look like this. 361 00:17:13,760 --> 00:17:14,680 Client sends a message 362 00:17:14,680 --> 00:17:15,420 to the server that says, 363 00:17:16,580 --> 00:17:18,240 hello, I am some client. I use 364 00:17:18,240 --> 00:17:20,100 SSL version whatever. These are the 365 00:17:20,100 --> 00:17:22,140 cipher suites that I support. I also like 366 00:17:22,140 --> 00:17:23,740 these compression methods and here's 367 00:17:23,740 --> 00:17:25,480 a random number and some other information. 368 00:17:26,160 --> 00:17:28,100 The server responds, yes, hello, I am the 369 00:17:28,100 --> 00:17:30,120 server. I also support this version of SSL 370 00:17:30,120 --> 00:17:31,500 whatever. I think we should use this 371 00:17:32,300 --> 00:17:33,980 cipher suite and this compression method. 372 00:17:35,040 --> 00:17:35,920 And, by the way, 373 00:17:36,080 --> 00:17:37,060 here is my certificate. 374 00:17:39,280 --> 00:17:40,400 So, as soon as the 375 00:17:40,400 --> 00:17:42,300 client gets the certificate, the first thing it's going to do 376 00:17:42,300 --> 00:17:44,080 is look at the subject and it's going to make sure 377 00:17:44,080 --> 00:17:46,340 that it's the same thing that's what 378 00:17:46,580 --> 00:17:48,340 we're trying to connect to. So it's going to 379 00:17:48,340 --> 00:17:50,200 compare the subject with whatever you typed into 380 00:17:50,200 --> 00:17:52,280 the URL bar on your web browser 381 00:17:52,280 --> 00:17:54,340 or whatever you typed into the mail server field 382 00:17:54,340 --> 00:17:56,280 for your IMAP client or 383 00:17:56,280 --> 00:17:58,560 whatever you typed into the server 384 00:17:58,560 --> 00:18:00,380 field for your IRC client or 385 00:18:00,380 --> 00:18:02,400 for your VPN software or whatever. 386 00:18:03,200 --> 00:18:04,460 And this is really where 387 00:18:04,460 --> 00:18:06,500 the problems for us begin as attackers. 388 00:18:07,060 --> 00:18:08,540 Because we can perform a man in the middle 389 00:18:08,540 --> 00:18:10,600 attack here. We can intercept the client 390 00:18:10,600 --> 00:18:12,460 hello and we can respond with our own server hello 391 00:18:12,460 --> 00:18:13,660 that says, yes, I am the server whatever. 392 00:18:14,120 --> 00:18:15,540 But we have to send a certificate. 393 00:18:16,700 --> 00:18:17,600 And what do we send? 394 00:18:18,580 --> 00:18:20,140 We can't send the real certificate 395 00:18:20,140 --> 00:18:22,500 from the actual server because it has a public 396 00:18:22,500 --> 00:18:24,540 key in it that we don't have the corresponding private key 397 00:18:24,540 --> 00:18:26,600 for and as soon as they start encrypting 398 00:18:26,600 --> 00:18:27,860 things, we won't be able to decrypt them. 399 00:18:29,020 --> 00:18:29,940 So this is a problem. 400 00:18:31,720 --> 00:18:32,480 So let's start 401 00:18:32,480 --> 00:18:34,280 by looking back into the past. 402 00:18:35,740 --> 00:18:36,500 So like in 403 00:18:37,040 --> 00:18:38,540 2000, the late 90s 404 00:18:38,540 --> 00:18:40,540 or whatever, things were 405 00:18:40,540 --> 00:18:42,360 different. When I was applying 406 00:18:42,360 --> 00:18:44,480 for certificates to 407 00:18:44,480 --> 00:18:46,560 exploit this basic constraints vulnerability that I talked about 408 00:18:46,580 --> 00:18:48,480 I just needed 409 00:18:48,480 --> 00:18:50,200 to get a certificate for a domain that I owned. 410 00:18:50,500 --> 00:18:52,260 And back then it was 411 00:18:52,260 --> 00:18:54,220 crazy. There was notaries. 412 00:18:54,760 --> 00:18:56,580 I had to show actual 413 00:18:56,580 --> 00:18:57,960 state ID to people. 414 00:18:58,800 --> 00:18:59,960 There were phone calls 415 00:18:59,960 --> 00:19:02,000 with actual people involved. 416 00:19:02,540 --> 00:19:04,440 I actually remember talking on the phone 417 00:19:04,440 --> 00:19:06,720 with this guy at VeriSign at one point 418 00:19:06,720 --> 00:19:08,400 and he was like grilling me. 419 00:19:08,900 --> 00:19:10,620 And I was thinking to myself 420 00:19:10,620 --> 00:19:12,560 my god, how am I going to 421 00:19:12,560 --> 00:19:14,500 prove to this guy that I am me? 422 00:19:15,460 --> 00:19:15,980 And 423 00:19:16,580 --> 00:19:18,020 this was totally legit. 424 00:19:18,220 --> 00:19:20,060 I just needed to get a cert for my domain. 425 00:19:21,400 --> 00:19:22,420 That is a 426 00:19:22,420 --> 00:19:22,880 bygone era. 427 00:19:23,760 --> 00:19:26,560 Today it's all about this thing, online domain validation. 428 00:19:28,280 --> 00:19:30,440 this whole process was no reason all this stuff 429 00:19:30,440 --> 00:19:32,180 has been replaced by a website. 430 00:19:33,420 --> 00:19:34,300 You go to the website 431 00:19:34,300 --> 00:19:36,480 and you submit your certificate signing 432 00:19:36,480 --> 00:19:36,840 request. 433 00:19:38,380 --> 00:19:40,060 A certificate signing request is 434 00:19:40,060 --> 00:19:42,100 another basic structure. It's defined by the standard 435 00:19:42,100 --> 00:19:43,140 PKCS number 10. 436 00:19:43,800 --> 00:19:45,740 And it just has a few things in it. It's like 437 00:19:46,580 --> 00:19:47,620 the registration number that the thing supports, 438 00:19:48,420 --> 00:19:50,320 the subject, public key, 439 00:19:50,480 --> 00:19:52,320 and whatever attributes you might want. 440 00:19:52,740 --> 00:19:54,220 So here again is our old friend, 441 00:19:54,400 --> 00:19:56,660 the subject. This is the exact 442 00:19:56,660 --> 00:19:58,480 value that will later be 443 00:19:58,480 --> 00:20:00,460 included in the certificate that is 444 00:20:00,460 --> 00:20:01,640 issued by the certificate authority. 445 00:20:06,400 --> 00:20:08,400 Ideally, we might want it to say something 446 00:20:08,400 --> 00:20:09,980 like bankofamerica.com. 447 00:20:10,740 --> 00:20:12,460 When you submit a certificate to 448 00:20:12,460 --> 00:20:14,700 a certificate authority and it has bankofamerica.com 449 00:20:14,700 --> 00:20:16,260 as the subject, the first thing that the 450 00:20:16,580 --> 00:20:18,500 certificate authority does is look at the root domain. 451 00:20:19,700 --> 00:20:20,560 It does a whois 452 00:20:20,560 --> 00:20:22,600 lookup for that and pulls out 453 00:20:22,600 --> 00:20:24,640 whatever contact information is in the 454 00:20:24,640 --> 00:20:26,580 whois record. And then it sends an email 455 00:20:26,580 --> 00:20:28,340 or makes a phone call or something 456 00:20:28,340 --> 00:20:30,680 to whoever that might be. 457 00:20:31,460 --> 00:20:32,640 The important thing here 458 00:20:32,640 --> 00:20:34,640 is that it only looks at the root domain. 459 00:20:35,060 --> 00:20:36,560 Because this is where that 460 00:20:36,560 --> 00:20:37,960 information is contained. 461 00:20:38,500 --> 00:20:40,840 It doesn't give a shit about subdomains. 462 00:20:41,020 --> 00:20:42,640 It doesn't care if it's 463 00:20:42,640 --> 00:20:44,180 www or it could be 464 00:20:44,180 --> 00:20:46,560 certificate authorities or totalripoff.bankofamerica.com. 465 00:20:46,580 --> 00:20:49,920 If you submit that, it will 466 00:20:49,920 --> 00:20:51,800 dutifully look up bankofamerica.com, 467 00:20:51,980 --> 00:20:52,920 pull out the whois record, 468 00:20:53,120 --> 00:20:54,860 and send whoever 469 00:20:54,860 --> 00:20:55,920 some contact email. 470 00:20:56,100 --> 00:20:57,020 There's no one to be offended. 471 00:20:57,580 --> 00:20:58,540 There's no one looking at this. 472 00:20:58,560 --> 00:20:59,480 This is an automated process. 473 00:21:01,980 --> 00:21:04,060 I am simplifying things a little bit. 474 00:21:06,520 --> 00:21:07,760 Subjects are not just 475 00:21:07,760 --> 00:21:09,580 an ASCII string in this thing. 476 00:21:09,700 --> 00:21:11,060 It's actually this structure 477 00:21:11,060 --> 00:21:12,440 called a distinguished name. 478 00:21:13,840 --> 00:21:14,740 To understand 479 00:21:14,740 --> 00:21:16,300 this structure, you have to understand 480 00:21:16,580 --> 00:21:17,540 that the X.509 standard 481 00:21:17,540 --> 00:21:19,260 is a total nightmare. 482 00:21:19,960 --> 00:21:21,640 There have been three revisions 483 00:21:21,640 --> 00:21:22,740 over the course of 20 years. 484 00:21:23,040 --> 00:21:25,300 Parts of the standard have literally been lost 485 00:21:25,300 --> 00:21:26,300 and then found again. 486 00:21:27,040 --> 00:21:27,800 I'm not kidding. 487 00:21:27,920 --> 00:21:29,940 When the 1988 standard was being updated 488 00:21:29,940 --> 00:21:31,520 to the 1991 standard, 489 00:21:31,660 --> 00:21:33,800 whoever was just cutting and pasting it over 490 00:21:33,800 --> 00:21:36,320 forgot to cut part of it out and paste it in. 491 00:21:36,480 --> 00:21:38,200 That was published as the standard. 492 00:21:38,860 --> 00:21:40,560 People implemented the standard 493 00:21:40,560 --> 00:21:41,520 based on what was published. 494 00:21:42,180 --> 00:21:43,880 After the implementations were out there, 495 00:21:46,580 --> 00:21:47,020 they put it back in. 496 00:21:47,760 --> 00:21:48,860 But then it was like, 497 00:21:48,920 --> 00:21:49,800 there's all these implementations 498 00:21:49,800 --> 00:21:51,040 that already do it the wrong way, 499 00:21:51,100 --> 00:21:52,000 but it's kind of the right way 500 00:21:52,000 --> 00:21:53,980 because for a second it was the right standard. 501 00:21:56,080 --> 00:21:56,800 It's crazy. 502 00:21:57,120 --> 00:21:58,780 The standard says you do this, 503 00:21:58,840 --> 00:22:00,360 but really what you do is this 504 00:22:00,360 --> 00:22:01,880 because there's this time 505 00:22:01,880 --> 00:22:03,160 where they forgot part of the standard. 506 00:22:03,960 --> 00:22:05,220 What you do is you get the thing 507 00:22:05,220 --> 00:22:06,040 and you validate it. 508 00:22:06,180 --> 00:22:06,980 If that doesn't work, 509 00:22:06,980 --> 00:22:07,780 you try this other thing. 510 00:22:08,760 --> 00:22:09,880 It's insane. 511 00:22:10,080 --> 00:22:10,920 It's seriously insane. 512 00:22:12,320 --> 00:22:14,340 The original sort of vision 513 00:22:14,340 --> 00:22:15,980 for these distinguished names 514 00:22:15,980 --> 00:22:17,900 was that each distinguished name 515 00:22:17,900 --> 00:22:19,260 would fit into this global 516 00:22:19,260 --> 00:22:20,580 information directory tree. 517 00:22:22,140 --> 00:22:23,260 For instance, 518 00:22:23,500 --> 00:22:24,700 if I were going to get a certificate 519 00:22:24,700 --> 00:22:25,820 with a distinguished name in it, 520 00:22:25,880 --> 00:22:27,720 it would say country, United States, 521 00:22:27,900 --> 00:22:30,420 state, Pennsylvania, locale, Pittsburgh, 522 00:22:30,900 --> 00:22:33,200 organization, institute for disruptive studies, 523 00:22:33,520 --> 00:22:35,500 organizational unit, research and development, 524 00:22:36,980 --> 00:22:37,520 oxymarlin spike. 525 00:22:38,440 --> 00:22:40,180 In practice, when people are filling these things out, 526 00:22:40,260 --> 00:22:41,160 they get to locale and say, 527 00:22:41,260 --> 00:22:42,100 what the fuck is locale? 528 00:22:42,640 --> 00:22:44,480 And then just type whatever they want in there 529 00:22:44,480 --> 00:22:45,760 and the whole thing falls apart. 530 00:22:46,300 --> 00:22:47,740 My favorite quote is from this one guy 531 00:22:47,740 --> 00:22:50,080 who was trying to implement X509 532 00:22:50,080 --> 00:22:50,540 and he says, 533 00:22:50,700 --> 00:22:52,340 there's nothing in any of these standards 534 00:22:52,340 --> 00:22:53,500 that would prevent me from including 535 00:22:53,500 --> 00:22:55,220 a one gigabit MPEG movie 536 00:22:55,220 --> 00:22:56,420 of me playing with my cat 537 00:22:56,420 --> 00:22:57,720 as one of the RDN components 538 00:22:57,720 --> 00:22:59,280 of the distinguished name in my certificate. 539 00:23:06,980 --> 00:23:08,140 But, you know, whatever. 540 00:23:08,360 --> 00:23:09,140 In practice, 541 00:23:10,140 --> 00:23:12,240 none of this stuff really materialized 542 00:23:12,240 --> 00:23:14,100 and at the end of the day, 543 00:23:14,160 --> 00:23:15,820 especially when we're talking about 544 00:23:16,520 --> 00:23:18,660 certificates that are used with SSL, 545 00:23:18,800 --> 00:23:21,160 basically all implementations just ignore 546 00:23:21,160 --> 00:23:22,420 everything in the distinguished name 547 00:23:22,420 --> 00:23:23,560 except for the common name. 548 00:23:24,160 --> 00:23:26,380 And the convention is that in the common name field 549 00:23:26,380 --> 00:23:27,120 you put your domain, 550 00:23:27,640 --> 00:23:29,240 whatever domain the certificate is valid for. 551 00:23:29,360 --> 00:23:31,600 So this is where bankofamerica.com would go 552 00:23:31,600 --> 00:23:33,140 in this common name of the certificate, 553 00:23:33,320 --> 00:23:34,860 of the distinguished name of the certificate. 554 00:23:36,980 --> 00:23:38,560 So how is the common name represented 555 00:23:38,560 --> 00:23:39,260 in a certificate? 556 00:23:43,660 --> 00:23:44,960 It's this, you know, 557 00:23:44,980 --> 00:23:47,440 X509 is specified by, 558 00:23:47,500 --> 00:23:49,660 it's an ASN.1 formatted deal. 559 00:23:50,420 --> 00:23:51,900 So a common name is basically 560 00:23:51,900 --> 00:23:53,820 the sequence that identifies it 561 00:23:53,820 --> 00:23:54,560 as the common name 562 00:23:54,560 --> 00:23:55,980 and then a string type. 563 00:23:57,880 --> 00:23:59,920 There are many different string types 564 00:23:59,920 --> 00:24:00,460 that are supported, 565 00:24:00,640 --> 00:24:02,760 but you can imagine one of the most common 566 00:24:02,760 --> 00:24:04,220 is just like an ASCII string, 567 00:24:04,420 --> 00:24:06,040 so an IA5 string. 568 00:24:06,380 --> 00:24:08,000 And an IA5 string looks like this. 569 00:24:08,140 --> 00:24:10,980 There's a one byte value that identifies it 570 00:24:10,980 --> 00:24:12,760 as an IA5 string, 0x16. 571 00:24:13,660 --> 00:24:15,220 And then there's a one byte length field 572 00:24:15,920 --> 00:24:17,360 that specifies the length 573 00:24:17,360 --> 00:24:18,140 of the string to follow. 574 00:24:18,620 --> 00:24:20,860 And then there's the actual value of the string, 575 00:24:21,060 --> 00:24:22,260 one byte per character, 576 00:24:22,420 --> 00:24:24,240 the ASCII byte per character. 577 00:24:27,460 --> 00:24:28,420 So essentially, 578 00:24:29,460 --> 00:24:30,540 the common name field 579 00:24:30,540 --> 00:24:32,240 is a Pascal string. 580 00:24:32,960 --> 00:24:34,320 People remember Pascal strings, 581 00:24:34,480 --> 00:24:35,160 the way it worked was 582 00:24:35,800 --> 00:24:37,960 there was a preceding length field 583 00:24:37,960 --> 00:24:39,700 for every string that's X number of bytes 584 00:24:39,700 --> 00:24:42,020 and it would specify the length of the string to follow. 585 00:24:44,000 --> 00:24:46,260 This is different from how C strings 586 00:24:46,260 --> 00:24:46,940 are represented. 587 00:24:48,060 --> 00:24:48,540 In C, 588 00:24:50,840 --> 00:24:52,020 your pointer to the string 589 00:24:52,020 --> 00:24:53,880 is just the pointer to the first character in the string 590 00:24:53,880 --> 00:24:55,240 and you have no idea how long the string is 591 00:24:55,240 --> 00:24:57,020 and then you have to walk through the string 592 00:24:57,020 --> 00:24:58,480 until you encounter a null character 593 00:24:58,480 --> 00:25:01,060 and the null character indicates that you've gotten 594 00:25:03,200 --> 00:25:03,760 a null character. 595 00:25:03,760 --> 00:25:04,300 So really, 596 00:25:04,400 --> 00:25:06,900 I guess one important thing to notice 597 00:25:06,900 --> 00:25:08,540 is that in Pascal strings, 598 00:25:08,840 --> 00:25:11,100 a null character has no special meaning. 599 00:25:11,980 --> 00:25:13,600 It's just another character 600 00:25:13,600 --> 00:25:14,420 in your character string 601 00:25:14,420 --> 00:25:17,580 and it's not imbued with any special meaning. 602 00:25:19,340 --> 00:25:19,900 Anyway, 603 00:25:21,020 --> 00:25:22,820 so we'd like to get some 604 00:25:24,580 --> 00:25:26,100 certificate with a subject 605 00:25:26,100 --> 00:25:27,900 that has a common name of 606 00:25:27,900 --> 00:25:29,160 www.paypal.com 607 00:25:29,160 --> 00:25:31,940 The problem is that we don't own paypal.com, 608 00:25:34,080 --> 00:25:35,660 but I do own 609 00:25:36,040 --> 00:25:36,700 thoughtcrime.org 610 00:25:37,700 --> 00:25:38,860 So I could put 611 00:25:38,860 --> 00:25:40,360 thoughtcrime.org in the common name field 612 00:25:40,360 --> 00:25:41,080 of a certificate 613 00:25:41,080 --> 00:25:43,680 and it would look up who has information for me 614 00:25:43,680 --> 00:25:45,000 and everything would be fine. 615 00:25:45,280 --> 00:25:46,760 And again, I can put whatever I want. 616 00:25:46,840 --> 00:25:48,280 I can get www.thoughtcrime.org 617 00:25:48,280 --> 00:25:51,620 I can get verisigneedschildren.thoughtcrime.org 618 00:25:52,760 --> 00:25:54,500 Even things that are just totally nonsensical 619 00:25:54,500 --> 00:25:55,880 www.thoughtcrime.org 620 00:25:55,880 --> 00:25:56,700 It doesn't have to exist. 621 00:25:57,160 --> 00:25:58,500 They don't care. They don't give a shit about it. 622 00:25:58,560 --> 00:25:59,220 They totally ignore it. 623 00:26:03,060 --> 00:26:04,960 www.paypal.com 624 00:26:06,300 --> 00:26:07,900 nullcharacter.thoughtcrime.org 625 00:26:11,720 --> 00:26:14,420 So if I submit my certificate signing request 626 00:26:14,420 --> 00:26:16,620 for www.paypal.com 627 00:26:16,620 --> 00:26:18,220 nullcharacter.thoughtcrime.org 628 00:26:18,760 --> 00:26:20,400 they will dutifully look up 629 00:26:20,400 --> 00:26:22,500 thoughtcrime.org in the Whois database 630 00:26:22,500 --> 00:26:24,160 pull out my contact information 631 00:26:24,160 --> 00:26:25,460 and contact me. 632 00:26:34,380 --> 00:26:35,820 So then, you know, okay. 633 00:26:35,920 --> 00:26:37,260 Now we're doing our man in the middle attack 634 00:26:37,260 --> 00:26:38,300 we intercept the client hello 635 00:26:38,300 --> 00:26:39,460 we send back server hello 636 00:26:39,460 --> 00:26:40,440 yes I am the server whatever 637 00:26:40,440 --> 00:26:43,360 and my certificate is www.paypal.com 638 00:26:43,360 --> 00:26:44,940 nullcharacter.thoughtcrime.org 639 00:26:46,660 --> 00:26:48,060 First thing the client is going to do 640 00:26:48,060 --> 00:26:48,680 is check the subject. 641 00:26:49,700 --> 00:26:51,220 So they look in the URL bar 642 00:26:51,220 --> 00:26:52,380 we typed in paypal.com 643 00:26:52,380 --> 00:26:53,540 they want to compare it to the subject 644 00:26:53,540 --> 00:26:54,020 and the certificate. 645 00:26:54,500 --> 00:26:55,940 That code might look like this. 646 00:26:55,940 --> 00:26:58,020 You know, char star destination equals 647 00:26:58,020 --> 00:26:59,180 get domain we're connecting to 648 00:26:59,180 --> 00:27:01,680 char star common name is get common name from certificate 649 00:27:01,680 --> 00:27:03,600 and if everything is okay 650 00:27:03,600 --> 00:27:05,300 str comp destination 651 00:27:05,780 --> 00:27:07,360 and common name will be the same. 652 00:27:08,120 --> 00:27:09,780 And str comp is going to 653 00:27:09,780 --> 00:27:11,820 do this, right? You have the pointer 654 00:27:11,820 --> 00:27:13,260 to both of these values 655 00:27:13,260 --> 00:27:15,700 and it's going to check the first character in both strings 656 00:27:15,700 --> 00:27:17,580 and make sure they're the same. And if they are 657 00:27:17,580 --> 00:27:19,660 it's going to continue with the next character 658 00:27:19,660 --> 00:27:21,460 and it's going to keep going until it encounters 659 00:27:21,460 --> 00:27:22,520 a null character 660 00:27:24,160 --> 00:27:25,360 which indicates that 661 00:27:25,940 --> 00:27:26,920 this is the end of the string 662 00:27:26,920 --> 00:27:29,840 and so it's going to return success. 663 00:27:31,180 --> 00:27:32,180 What this means is that 664 00:27:32,180 --> 00:27:33,820 in the eyes of most SSL implementations 665 00:27:33,820 --> 00:27:36,120 this certificate is completely valid 666 00:27:36,120 --> 00:27:38,280 for www.paypal.com 667 00:27:39,500 --> 00:27:41,380 So what are most SSL implementations? 668 00:27:41,780 --> 00:27:44,100 So if you look at the implementations 669 00:27:44,100 --> 00:27:44,400 themselves 670 00:27:46,500 --> 00:27:47,520 NSS is vulnerable 671 00:27:47,520 --> 00:27:49,600 the Microsoft Crypto API is vulnerable 672 00:27:49,600 --> 00:27:50,940 GNU TLS is vulnerable 673 00:27:51,540 --> 00:27:53,720 and what that means is that all of the products 674 00:27:53,720 --> 00:27:54,760 that use those things are vulnerable. 675 00:27:55,960 --> 00:27:58,320 The product that uses the Microsoft Crypto API 676 00:27:58,320 --> 00:27:59,760 is vulnerable to this attack 677 00:27:59,760 --> 00:28:01,860 when validating X.509 certificates. 678 00:28:03,160 --> 00:28:04,380 The popular thing 679 00:28:04,380 --> 00:28:05,340 are web browsers 680 00:28:05,340 --> 00:28:07,440 Firefox is vulnerable because it uses NSS 681 00:28:07,440 --> 00:28:09,300 Internet Explorer is vulnerable 682 00:28:09,300 --> 00:28:11,160 because of course it uses the MS Crypto API 683 00:28:11,820 --> 00:28:13,800 Chrome is vulnerable, also for the same reason 684 00:28:13,800 --> 00:28:15,460 and then Lynx is vulnerable 685 00:28:15,460 --> 00:28:16,440 Curl is vulnerable 686 00:28:17,080 --> 00:28:19,320 Mail Clients, Thunderbird is vulnerable 687 00:28:19,320 --> 00:28:21,160 Outlook is vulnerable, Evolution is vulnerable 688 00:28:22,240 --> 00:28:24,000 Pidgin, AIM, IRSSI 689 00:28:24,000 --> 00:28:24,840 Center ICQ 690 00:28:25,940 --> 00:28:27,080 Even SSL VPNs are vulnerable 691 00:28:27,800 --> 00:28:29,760 AEP, Citrix, a bunch of stuff 692 00:28:29,760 --> 00:28:31,280 I couldn't even test them all 693 00:28:32,460 --> 00:28:33,440 Basically almost everything 694 00:28:36,080 --> 00:28:37,800 Now we've updated SSL SNF 695 00:28:37,800 --> 00:28:39,020 and we have a first cut of this 696 00:28:39,020 --> 00:28:40,800 We perform a man-in-the-middle attack 697 00:28:40,800 --> 00:28:42,880 and if we have a null prefix certificate 698 00:28:42,880 --> 00:28:45,500 for the site the client is going to connect to 699 00:28:45,500 --> 00:28:47,620 we send that back and complete the 700 00:28:47,620 --> 00:28:48,560 man-in-the-middle attack, otherwise 701 00:28:48,560 --> 00:28:49,620 we just let everything go through 702 00:28:49,620 --> 00:28:53,380 So how does that look compared to 703 00:28:53,380 --> 00:28:54,440 what we were talking about earlier 704 00:28:55,940 --> 00:28:57,340 Login page, secure site 705 00:28:57,940 --> 00:28:59,040 This is the secure version 706 00:29:00,020 --> 00:29:01,540 This is the attack version 707 00:29:03,360 --> 00:29:04,540 I'll show that to you again 708 00:29:06,440 --> 00:29:07,180 Secure version 709 00:29:08,480 --> 00:29:09,300 Attack version 710 00:29:10,940 --> 00:29:11,940 Essentially there is 711 00:29:11,940 --> 00:29:12,720 no visible difference 712 00:29:13,300 --> 00:29:15,060 Even if the user were to inspect 713 00:29:15,060 --> 00:29:16,100 the certificate 714 00:29:17,740 --> 00:29:19,360 it tells you that it's 715 00:29:19,760 --> 00:29:21,500 www.google.com still because again 716 00:29:21,500 --> 00:29:22,920 it has to display the C string 717 00:29:22,920 --> 00:29:24,720 and when it displays it, it null terminates it 718 00:29:25,940 --> 00:29:27,320 If you look at the view certificate thing 719 00:29:27,320 --> 00:29:28,880 and actually look at the values of the certificate 720 00:29:28,880 --> 00:29:30,620 again everything looks 721 00:29:32,260 --> 00:29:32,660 indistinguishable 722 00:29:32,660 --> 00:29:34,440 There's nothing that a user can do to know 723 00:29:34,440 --> 00:29:35,080 that they have been attacked 724 00:29:35,780 --> 00:29:37,640 So what are some disadvantages to this attack 725 00:29:37,640 --> 00:29:40,260 To me the biggest disadvantage is that 726 00:29:40,260 --> 00:29:41,800 I think targeted attacks are lame 727 00:29:42,600 --> 00:29:44,600 I think phishing is too much work 728 00:29:44,600 --> 00:29:46,740 I don't want to have to get the certificate 729 00:29:46,740 --> 00:29:48,140 for this one site or whatever 730 00:29:48,140 --> 00:29:50,260 and then try and get everyone to go to that thing 731 00:29:50,260 --> 00:29:52,320 Really what you want to do is 732 00:29:52,320 --> 00:29:55,380 man-in-the-middle an entire network and get everything that everyone is doing 733 00:29:56,060 --> 00:29:57,280 You don't want to have to anticipate 734 00:29:57,280 --> 00:30:00,220 I think they're going to visit these sites 735 00:30:00,220 --> 00:30:00,620 or whatever 736 00:30:01,120 --> 00:30:02,400 Sometimes you don't even know 737 00:30:02,400 --> 00:30:04,320 You don't even know what's going to happen 738 00:30:04,320 --> 00:30:05,160 You want to just get everything 739 00:30:05,160 --> 00:30:08,100 and sometimes things are valuable that you didn't even know about 740 00:30:09,280 --> 00:30:11,580 So maybe there's another trick in here somewhere 741 00:30:11,580 --> 00:30:13,980 that we can use to accomplish our goal 742 00:30:15,640 --> 00:30:16,820 So the first thing we might try 743 00:30:16,820 --> 00:30:18,000 is actually looking at the source 744 00:30:18,000 --> 00:30:20,860 of any SSL implementation 745 00:30:20,860 --> 00:30:22,440 that does this matching 746 00:30:22,440 --> 00:30:24,460 So we can start with NSS 747 00:30:24,460 --> 00:30:25,460 which is the thing that Firefox 748 00:30:25,940 --> 00:30:26,700 and Mozilla products use 749 00:30:26,700 --> 00:30:28,400 So you can start and look at the source 750 00:30:29,400 --> 00:30:30,460 Don't look at it too carefully 751 00:30:30,460 --> 00:30:31,660 Just let your eyes go out of focus 752 00:30:33,520 --> 00:30:34,580 Without actually looking 753 00:30:35,720 --> 00:30:37,340 at any individual line 754 00:30:37,340 --> 00:30:38,660 Just look at the shape of it 755 00:30:40,100 --> 00:30:41,020 It's terrible, right? 756 00:30:41,680 --> 00:30:43,100 All these nested conditions 757 00:30:43,860 --> 00:30:46,420 The like, how it arcs out like that 758 00:30:46,420 --> 00:30:47,420 It's too long 759 00:30:47,420 --> 00:30:49,380 This thing goes on for like four pages or whatever 760 00:30:50,340 --> 00:30:52,140 Just looking at the shape of this code 761 00:30:52,640 --> 00:30:53,220 You know 762 00:30:54,080 --> 00:30:55,180 There's a bug in here somewhere 763 00:30:58,340 --> 00:30:58,980 Right? 764 00:31:04,940 --> 00:31:07,760 So then your eyes start to clear 765 00:31:07,760 --> 00:31:10,680 And you look at the very first line 766 00:31:12,200 --> 00:31:14,300 Register int x y 767 00:31:15,800 --> 00:31:16,440 Register 768 00:31:18,660 --> 00:31:19,880 This must be like 769 00:31:19,880 --> 00:31:21,000 14 year old code 770 00:31:21,000 --> 00:31:23,160 Nobody uses register shadowing anymore 771 00:31:23,160 --> 00:31:24,620 The compilers just ignore it, right? 772 00:31:25,940 --> 00:31:26,220 And then you get another signal 773 00:31:26,220 --> 00:31:27,560 That maybe something is amiss 774 00:31:28,260 --> 00:31:29,940 And then you look a little bit further 775 00:31:29,940 --> 00:31:31,740 And you get to the wildcard matching 776 00:31:36,300 --> 00:31:37,500 And you look at that 777 00:31:37,500 --> 00:31:38,000 And you're like, wow 778 00:31:38,000 --> 00:31:39,280 This is probably the least efficient way 779 00:31:39,280 --> 00:31:39,860 That you can do this 780 00:31:40,320 --> 00:31:42,580 And then you realize, wow 781 00:31:43,280 --> 00:31:44,740 You can get a certificate for 782 00:31:45,660 --> 00:31:48,300 Star null character dot thoughtcrime dot org 783 00:32:00,540 --> 00:32:02,640 And this will match any domain 784 00:32:03,420 --> 00:32:05,920 This is actually better than having a CA cert 785 00:32:05,920 --> 00:32:07,420 Because if you have a CA cert 786 00:32:07,420 --> 00:32:09,740 You actually have to create another certificate 787 00:32:09,740 --> 00:32:11,600 And sign it to present it to someone 788 00:32:11,600 --> 00:32:12,940 If you have this thing 789 00:32:12,940 --> 00:32:14,620 You can just hand them the same thing over and over again 790 00:32:14,620 --> 00:32:15,520 And it matches for everything 791 00:32:16,740 --> 00:32:19,340 There's also other really weird stuff in there 792 00:32:19,340 --> 00:32:20,520 If you don't want to use a null character 793 00:32:20,520 --> 00:32:22,840 You could get star tilde dot thoughtcrime dot org 794 00:32:22,840 --> 00:32:23,640 That would also work 795 00:32:24,700 --> 00:32:25,960 It supports grouping 796 00:32:26,500 --> 00:32:27,300 Which is weird 797 00:32:28,760 --> 00:32:30,840 So like, because wildcard certificates are a little 798 00:32:31,320 --> 00:32:32,760 Extra, or they cost more money 799 00:32:32,760 --> 00:32:34,660 So if you don't want to shell out for a wildcard certificate 800 00:32:34,660 --> 00:32:35,860 You can just get like 801 00:32:36,600 --> 00:32:38,900 Paypal dot com, or mail dot google dot com 802 00:32:38,900 --> 00:32:40,140 Or etrade dot com 803 00:32:40,140 --> 00:32:41,600 Or bank of america dot com 804 00:32:43,180 --> 00:32:44,800 Null character dot thoughtcrime dot org 805 00:32:45,640 --> 00:32:46,820 And then you only have to 806 00:32:46,820 --> 00:32:47,900 Pay for one certificate this way 807 00:32:50,060 --> 00:32:50,460 And 808 00:32:50,460 --> 00:32:52,760 Of course, here's your remote exploit in here 809 00:32:52,840 --> 00:32:54,520 If you look at how it supports the grouping 810 00:32:56,060 --> 00:32:56,980 It allocates 811 00:32:56,980 --> 00:32:58,000 Based on the length of the string 812 00:32:58,000 --> 00:33:00,640 Which is going to be calculated 813 00:33:00,640 --> 00:33:02,760 Based on whatever null character might be in there 814 00:33:03,340 --> 00:33:04,260 And then 815 00:33:04,260 --> 00:33:06,280 It loops through the string again 816 00:33:06,280 --> 00:33:07,500 Looking for close paren 817 00:33:07,500 --> 00:33:10,520 Just ignoring wherever the 818 00:33:10,520 --> 00:33:11,360 Null character might be 819 00:33:11,360 --> 00:33:14,680 And then it just copies until it hits the 820 00:33:14,680 --> 00:33:15,240 Null character 821 00:33:15,240 --> 00:33:17,740 So if you have a string like this 822 00:33:18,400 --> 00:33:20,480 You allocate a buffer that's this big 823 00:33:20,480 --> 00:33:22,600 And then you copy this much data 824 00:33:23,000 --> 00:33:23,860 And this is actually 825 00:33:23,860 --> 00:33:26,340 The star is actually aligned to make this exploitable 826 00:33:26,340 --> 00:33:28,980 There are so many things that should have 827 00:33:28,980 --> 00:33:30,520 Stopped this from being exploitable 828 00:33:30,520 --> 00:33:32,500 The first thing you're like, okay, well there's no way 829 00:33:32,500 --> 00:33:34,300 I can get shellcode past the unicode filters 830 00:33:34,300 --> 00:33:36,180 And then you look at the unicode filters and you're like 831 00:33:36,180 --> 00:33:38,020 No, actually I can't get the shellcode past the unicode 832 00:33:38,740 --> 00:33:40,300 And then it's like, oh but they 833 00:33:40,300 --> 00:33:42,420 Stir dupe on it, so that would terminate the 834 00:33:42,420 --> 00:33:44,240 Null character thing, and then you're like 835 00:33:44,240 --> 00:33:46,480 No, but if you put a tilde in there, it just replaces that 836 00:33:46,480 --> 00:33:47,020 With a null character 837 00:33:47,980 --> 00:33:50,500 So anyway, the star is really aligned to make this exploitable 838 00:33:50,500 --> 00:33:51,880 Which is kind of insane 839 00:33:52,860 --> 00:33:54,460 Oh, the other nice things about this is that 840 00:33:54,460 --> 00:33:56,780 No signature is required, you don't have to get a CA 841 00:33:56,780 --> 00:33:58,200 To sign your shellcode, because 842 00:34:00,660 --> 00:34:02,620 Again, when I was talking before about how 843 00:34:03,760 --> 00:34:04,940 SSL implementations used to just 844 00:34:04,940 --> 00:34:06,880 Stop at the first thing that they found that was wrong 845 00:34:06,880 --> 00:34:08,600 And pop up a dialog box that was like 846 00:34:08,600 --> 00:34:09,760 This expired ten minutes ago, whatever 847 00:34:09,760 --> 00:34:12,760 So they went to fix that, and so now whenever they find anything that's wrong 848 00:34:12,760 --> 00:34:14,920 They continue validating and check everything 849 00:34:15,340 --> 00:34:17,080 So that they can pop up a dialog that's like 850 00:34:17,080 --> 00:34:18,120 X, Y, and Z is wrong 851 00:34:18,120 --> 00:34:20,060 And so, you know 852 00:34:20,060 --> 00:34:22,660 Even if the signature is bad on the certificate 853 00:34:22,840 --> 00:34:24,560 That you hand to the browser, it's like okay, the signature is bad 854 00:34:24,560 --> 00:34:26,620 But I better check the common name to make sure 855 00:34:26,620 --> 00:34:28,980 That I know whether to display an error or not 856 00:34:28,980 --> 00:34:30,200 And of course then you 857 00:34:30,200 --> 00:34:32,840 You know, exploit the client 858 00:34:35,540 --> 00:34:36,360 Anyway, so 859 00:34:36,360 --> 00:34:38,520 Now we have a second cut of SSL sniff 860 00:34:38,520 --> 00:34:40,180 And we perform our man in the middle attack 861 00:34:40,180 --> 00:34:42,480 And if there's a null prefix 862 00:34:43,360 --> 00:34:44,740 Certificate available for whatever 863 00:34:44,740 --> 00:34:45,940 The client is trying to connect to 864 00:34:45,940 --> 00:34:48,860 We use that, otherwise if the client 865 00:34:48,860 --> 00:34:50,440 Is NSS 866 00:34:50,440 --> 00:34:52,280 Then we pass them the universal wildcard certificate 867 00:34:52,840 --> 00:34:53,320 This works for everything 868 00:34:54,500 --> 00:34:56,640 So now basically we're in a situation 869 00:34:56,640 --> 00:34:58,680 Where SSL sniff has to fingerprint the network 870 00:34:58,680 --> 00:35:00,360 To know what clients are what so that it knows 871 00:35:00,360 --> 00:35:01,620 What to attack in which way 872 00:35:01,620 --> 00:35:03,480 So it fingerprints the network 873 00:35:03,480 --> 00:35:06,740 And every NSS client's communication is intercepted 874 00:35:06,740 --> 00:35:08,140 And then for the non-NSS clients 875 00:35:08,140 --> 00:35:10,740 All the certs that you have are used 876 00:35:11,640 --> 00:35:12,520 And whatever 877 00:35:12,520 --> 00:35:14,220 Non-vulnerable clients exist are left alone 878 00:35:14,700 --> 00:35:16,360 So that you don't get detected 879 00:35:17,380 --> 00:35:18,520 So what do we have to worry about 880 00:35:18,520 --> 00:35:19,420 As attackers, right 881 00:35:19,420 --> 00:35:21,980 The two things that come to mind for me are 882 00:35:22,840 --> 00:35:24,280 Certification and updates 883 00:35:25,360 --> 00:35:26,700 So the first thing 884 00:35:26,700 --> 00:35:28,600 Is that it would be unfortunate if some 885 00:35:28,600 --> 00:35:30,820 Bitter certificate authority audited their 886 00:35:31,440 --> 00:35:32,840 System, discovered that 887 00:35:32,840 --> 00:35:34,920 A bunch of certificates had been issued with null characters in them 888 00:35:34,920 --> 00:35:36,080 And then went to revoke those certificates 889 00:35:36,900 --> 00:35:38,440 And then updates is that 890 00:35:38,440 --> 00:35:39,620 It would be unfortunate if 891 00:35:40,500 --> 00:35:42,560 Some bitter SSL implementation actually 892 00:35:42,560 --> 00:35:44,280 Fixed their thing and then our tricks 893 00:35:44,280 --> 00:35:45,080 Stopped working 894 00:35:45,080 --> 00:35:47,500 So let's start with certificate revocation 895 00:35:48,400 --> 00:35:49,960 These days it's all about this thing called 896 00:35:49,960 --> 00:35:51,600 Online certificate status protocol 897 00:35:52,840 --> 00:35:54,520 And the deal is that whenever an SSL stack 898 00:35:54,520 --> 00:35:56,660 Sees a new certificate, like something that it hasn't seen 899 00:35:56,660 --> 00:35:58,340 Since it's been running in this session 900 00:35:58,340 --> 00:36:00,280 It makes a quick request to 901 00:36:00,280 --> 00:36:02,680 The OCSP URL that's embedded 902 00:36:02,680 --> 00:36:04,840 In the certificate to check with the signing CA 903 00:36:04,840 --> 00:36:06,720 Right, so basically what happens is 904 00:36:06,720 --> 00:36:08,500 Every time an SSL stack sees a 905 00:36:08,500 --> 00:36:10,560 Certificate, it makes a quick lightweight 906 00:36:10,560 --> 00:36:12,260 Request to the certificate authority that says 907 00:36:12,260 --> 00:36:14,580 Hey, is this thing still valid, have you revoked this yet 908 00:36:14,580 --> 00:36:15,120 Right 909 00:36:15,120 --> 00:36:18,440 And the stack gets a signed response 910 00:36:18,440 --> 00:36:19,580 Back from the OCSP provider 911 00:36:19,580 --> 00:36:22,440 So as attackers this is really deadly for us 912 00:36:22,840 --> 00:36:24,940 Because if a certificate gets revoked 913 00:36:24,940 --> 00:36:26,300 It's gone 914 00:36:26,840 --> 00:36:27,440 Instantly, right 915 00:36:27,440 --> 00:36:30,540 The old world of the certificate revocation lists 916 00:36:30,540 --> 00:36:31,640 Where there was like, you know 917 00:36:31,640 --> 00:36:33,440 One per certificate authority 918 00:36:33,440 --> 00:36:35,520 And each one is like 700 megabytes long 919 00:36:35,520 --> 00:36:38,220 Because it's just a list of every certificate that's ever been revoked ever 920 00:36:38,860 --> 00:36:39,960 You know, that wasn't working 921 00:36:39,960 --> 00:36:42,540 So they went to this model and it's a deadly model 922 00:36:42,540 --> 00:36:44,800 For attackers who are forging certificates 923 00:36:44,800 --> 00:36:45,220 Right 924 00:36:46,280 --> 00:36:48,500 So, you know, here again is Google's certificate 925 00:36:48,500 --> 00:36:50,520 And you can see that there's this OCSP URL 926 00:36:50,520 --> 00:36:52,480 Embedded in the certificate and every time 927 00:36:52,840 --> 00:36:54,720 A browser sees this it'll make a quick 928 00:36:54,720 --> 00:36:56,820 Request out to ocsp.thought.com 929 00:36:56,820 --> 00:36:57,940 And see what's up 930 00:36:59,020 --> 00:36:59,560 So 931 00:37:00,300 --> 00:37:02,260 Let's look at OCSP, how does this thing work 932 00:37:02,790 --> 00:37:03,060 Right 933 00:37:03,060 --> 00:37:06,580 The basic OCSP response that comes back from the 934 00:37:06,580 --> 00:37:08,520 Certificate authority looks like this 935 00:37:08,520 --> 00:37:10,460 It's basically a one byte response status 936 00:37:10,460 --> 00:37:12,180 And then some response bytes 937 00:37:12,180 --> 00:37:13,360 The actual data that 938 00:37:14,920 --> 00:37:16,480 Tells you what's going on with the status 939 00:37:16,480 --> 00:37:16,800 Right 940 00:37:16,800 --> 00:37:19,860 And the response bytes look like this 941 00:37:20,620 --> 00:37:22,500 There's basically some data that says 942 00:37:22,840 --> 00:37:24,360 This is the deal, this is what's going on 943 00:37:24,360 --> 00:37:25,780 And there's a signature in there 944 00:37:26,900 --> 00:37:28,640 And, you know, as an attacker 945 00:37:28,640 --> 00:37:29,480 This could be a problem 946 00:37:29,480 --> 00:37:31,400 It might be difficult to forge this signature 947 00:37:32,880 --> 00:37:34,320 Which is, you know, kind of a drag 948 00:37:35,200 --> 00:37:36,640 But if you look at this signature 949 00:37:36,640 --> 00:37:37,920 The interesting thing about it 950 00:37:38,620 --> 00:37:40,340 Is that it only covers 951 00:37:40,340 --> 00:37:42,180 Some of the response data 952 00:37:44,740 --> 00:37:46,920 Notably what it doesn't cover is all this other stuff 953 00:37:47,420 --> 00:37:49,060 Including the response status 954 00:37:50,580 --> 00:37:52,660 And the response bytes themselves are actually 955 00:37:52,840 --> 00:37:54,140 Optional, depending on the status 956 00:37:55,040 --> 00:37:56,600 Right, so if we look at 957 00:37:56,600 --> 00:37:58,900 You know, what the status options are 958 00:37:58,900 --> 00:38:00,780 The status structure looks like this 959 00:38:00,780 --> 00:38:03,000 Right, so you can either send 960 00:38:03,000 --> 00:38:04,340 You know, one of these things 961 00:38:04,960 --> 00:38:06,800 And so ideally we'd like to send 962 00:38:06,800 --> 00:38:08,540 If we were like spoofing the 963 00:38:09,080 --> 00:38:09,740 OCSP provider 964 00:38:09,740 --> 00:38:11,680 What we'd like to do is send back successful 965 00:38:12,500 --> 00:38:14,820 But we can't, or it might be difficult to send back successful 966 00:38:14,820 --> 00:38:16,580 Because if we did we'd have to include 967 00:38:16,580 --> 00:38:17,760 The optional response bytes 968 00:38:17,760 --> 00:38:20,940 And that has a signature in it that might be difficult for us to forge 969 00:38:21,420 --> 00:38:22,780 So we can't send back successful 970 00:38:22,840 --> 00:38:25,080 Right, so maybe we could send back something else 971 00:38:27,620 --> 00:38:29,280 So if we start to look through these things 972 00:38:29,840 --> 00:38:30,780 Alright, what else do we got 973 00:38:32,040 --> 00:38:32,720 Malformed request 974 00:38:33,880 --> 00:38:35,280 Eh, that doesn't sound that good 975 00:38:36,500 --> 00:38:37,100 Or we could 976 00:38:37,100 --> 00:38:37,980 You know, we could send 977 00:38:37,980 --> 00:38:39,180 Internal error 978 00:38:39,980 --> 00:38:41,340 Eh, that also doesn't sound good 979 00:38:41,340 --> 00:38:43,680 Because it has the word error in it 980 00:38:43,680 --> 00:38:46,400 And then you get 981 00:38:46,400 --> 00:38:47,420 Try later 982 00:38:49,720 --> 00:38:51,120 Well that doesn't sound bad at all 983 00:38:52,360 --> 00:38:52,820 You know 984 00:38:52,840 --> 00:38:55,080 It's not really implying that there's a problem 985 00:38:55,080 --> 00:38:56,060 You know 986 00:38:56,060 --> 00:38:57,720 Definitely not a problem with our certificate 987 00:38:57,720 --> 00:38:58,840 It's just saying try back later 988 00:38:59,320 --> 00:39:02,840 It's even sort of suggesting that it might be successful at a later date 989 00:39:02,840 --> 00:39:03,520 You know 990 00:39:03,520 --> 00:39:05,400 Try back later and it could work good 991 00:39:06,340 --> 00:39:08,700 So the interesting thing about try later 992 00:39:08,700 --> 00:39:09,860 Is that 993 00:39:09,860 --> 00:39:12,400 You don't have to include the optional response bytes 994 00:39:12,400 --> 00:39:13,280 When you send try later 995 00:39:13,280 --> 00:39:15,040 So all you have to send back is 996 00:39:15,640 --> 00:39:16,720 The response itself 997 00:39:17,260 --> 00:39:19,460 Which is a single byte value that's literally 998 00:39:19,980 --> 00:39:20,460 Three 999 00:39:22,840 --> 00:39:23,720 The ASCII character three 1000 00:39:23,720 --> 00:39:25,760 So all you have to send back is 0x33 1001 00:39:25,760 --> 00:39:28,560 And it turns out that when you 1002 00:39:28,560 --> 00:39:29,640 Send that back for 1003 00:39:29,640 --> 00:39:32,120 Every SSL implementation that I've tried 1004 00:39:32,630 --> 00:39:34,880 They all agree that it also doesn't sound too bad 1005 00:39:37,560 --> 00:39:39,160 So what this essentially means 1006 00:39:39,160 --> 00:39:40,380 Is this entire standard 1007 00:39:40,380 --> 00:39:41,500 This whole OCSP thing 1008 00:39:41,500 --> 00:39:44,220 Can be defeated by the number three 1009 00:39:52,840 --> 00:39:53,640 So now okay 1010 00:39:54,100 --> 00:39:56,080 Third cut we have an OCSP or SSL 1011 00:39:56,080 --> 00:39:57,320 We do everything that we do before 1012 00:39:57,320 --> 00:40:00,080 And now if we see an OCSP request 1013 00:40:00,080 --> 00:40:02,800 For any of the URLs that are embedded 1014 00:40:02,800 --> 00:40:04,480 In the forged certificates that we're using 1015 00:40:04,480 --> 00:40:06,080 We man in the middle of that 1016 00:40:06,080 --> 00:40:07,140 And send back three 1017 00:40:09,140 --> 00:40:09,940 And yeah 1018 00:40:09,940 --> 00:40:11,660 So even if the certificates get revoked 1019 00:40:12,200 --> 00:40:13,120 No one will ever know 1020 00:40:14,620 --> 00:40:16,360 Okay the other thing we've got to worry about is updates 1021 00:40:17,720 --> 00:40:18,400 You know 1022 00:40:18,400 --> 00:40:20,400 Just by talking to you today 1023 00:40:20,960 --> 00:40:22,300 People are probably going to try and fix this 1024 00:40:23,420 --> 00:40:24,580 So it used to be that people 1025 00:40:24,580 --> 00:40:25,700 Like downloaded software 1026 00:40:25,700 --> 00:40:29,480 And of course it's a rapidly changing world 1027 00:40:29,480 --> 00:40:30,080 There's 1028 00:40:30,720 --> 00:40:32,080 You know more and more bugs 1029 00:40:32,080 --> 00:40:33,080 There's more and more at stake 1030 00:40:34,240 --> 00:40:36,180 And you want to try and get the 1031 00:40:36,180 --> 00:40:38,340 The patches into people's hands 1032 00:40:38,340 --> 00:40:38,960 Faster and faster 1033 00:40:40,840 --> 00:40:42,820 So a lot of people have felt the need 1034 00:40:42,820 --> 00:40:44,380 To deploy this self updating software 1035 00:40:45,580 --> 00:40:46,960 So this is bad news for us 1036 00:40:46,960 --> 00:40:48,720 Right because that means that 1037 00:40:48,720 --> 00:40:49,560 Things get patched quicker 1038 00:40:49,560 --> 00:40:52,240 There's a lower window for attacking software 1039 00:40:52,940 --> 00:40:54,520 But it also seems like 1040 00:40:54,520 --> 00:40:55,240 Their update mechanisms 1041 00:40:56,020 --> 00:40:57,660 Might be kind of a dangerous idea right 1042 00:40:57,660 --> 00:40:59,280 You have software out there that's just like 1043 00:40:59,280 --> 00:41:01,580 Connecting somewhere and downloading other stuff 1044 00:41:01,580 --> 00:41:02,640 And just running it right 1045 00:41:03,100 --> 00:41:05,600 So maybe there's something we can do about our problem 1046 00:41:07,140 --> 00:41:07,540 So 1047 00:41:08,180 --> 00:41:09,360 Let's look at the Mozilla system 1048 00:41:10,000 --> 00:41:11,920 When you install Firefox or Thunderbird 1049 00:41:11,920 --> 00:41:12,880 Or any of the Mozilla products 1050 00:41:12,880 --> 00:41:14,960 It comes with this feature called automatic update service 1051 00:41:15,880 --> 00:41:17,260 And that's enabled by default 1052 00:41:19,560 --> 00:41:20,720 The way this works is 1053 00:41:20,720 --> 00:41:21,740 You make an SSL connection 1054 00:41:23,680 --> 00:41:24,200 Periodically 1055 00:41:24,200 --> 00:41:25,400 I think once a day 1056 00:41:25,400 --> 00:41:28,500 The browser makes an SSL connection to the update server 1057 00:41:28,500 --> 00:41:30,520 And it says hello I am 1058 00:41:30,520 --> 00:41:32,060 You know whatever 1059 00:41:32,060 --> 00:41:33,880 Firefox version whatever 1060 00:41:33,880 --> 00:41:36,760 Here's my build ID for my operating system 1061 00:41:36,760 --> 00:41:37,580 Linux Windows whatever 1062 00:41:37,580 --> 00:41:39,680 My locale NUS whatever 1063 00:41:39,680 --> 00:41:41,300 Channel stable nightly 1064 00:41:41,840 --> 00:41:43,120 Do you have any updates for me 1065 00:41:43,720 --> 00:41:45,100 And the update server responds 1066 00:41:45,100 --> 00:41:47,000 As a matter of fact I do 1067 00:41:47,920 --> 00:41:50,060 Here's a totally unsigned blob of data 1068 00:41:50,680 --> 00:41:52,680 That I would recommend that you 1069 00:41:52,840 --> 00:41:53,240 Just run 1070 00:41:56,860 --> 00:41:58,480 The deal is that they depend 1071 00:41:58,480 --> 00:42:00,400 On their SSL connection for 1072 00:42:01,420 --> 00:42:02,760 All the security of the system 1073 00:42:02,760 --> 00:42:03,300 Right 1074 00:42:03,300 --> 00:42:06,800 The idea is that since all of this is transmitted over SSL 1075 00:42:06,800 --> 00:42:08,300 No one could ever possibly 1076 00:42:08,940 --> 00:42:10,740 You know intercept these requests 1077 00:42:11,540 --> 00:42:12,020 So 1078 00:42:12,560 --> 00:42:14,680 You know we just send this data 1079 00:42:14,680 --> 00:42:16,080 Back through there and everything should be fine 1080 00:42:16,900 --> 00:42:18,880 And by default the minor updates 1081 00:42:18,880 --> 00:42:20,600 Are downloaded and installed silently 1082 00:42:20,600 --> 00:42:22,620 And they only prompt the user 1083 00:42:22,840 --> 00:42:24,200 Once everything is done 1084 00:42:24,200 --> 00:42:25,800 Once everything has been downloaded and installed 1085 00:42:25,800 --> 00:42:27,980 It says hey we updated your system 1086 00:42:28,520 --> 00:42:29,580 Restart now you know 1087 00:42:29,580 --> 00:42:32,200 And the interesting thing is that the update server 1088 00:42:32,200 --> 00:42:34,420 Is the thing that reports the version number 1089 00:42:34,420 --> 00:42:35,000 Of the update 1090 00:42:35,000 --> 00:42:37,820 So the update server is essentially what determines whether 1091 00:42:37,820 --> 00:42:39,520 Software gets installed silently or not 1092 00:42:40,960 --> 00:42:42,620 So the problem is going to be 1093 00:42:42,620 --> 00:42:44,600 That as vendors start to release patches for this vulnerability 1094 00:42:44,600 --> 00:42:46,420 The update mechanisms themselves 1095 00:42:46,420 --> 00:42:47,980 Are vulnerable right 1096 00:42:47,980 --> 00:42:50,080 Because all we need is our universal wildcard cert 1097 00:42:50,080 --> 00:42:52,380 Or a null prefix cert for 1098 00:42:52,840 --> 00:42:53,780 Windows2.mozilla.org 1099 00:42:53,780 --> 00:42:55,920 And we can take control of the update mechanism 1100 00:42:55,920 --> 00:42:57,620 To deliver whatever payloads we want 1101 00:42:58,900 --> 00:43:00,240 So this could be anything 1102 00:43:00,240 --> 00:43:02,300 It could be a rootkit that logs keystrokes 1103 00:43:02,300 --> 00:43:04,780 It could be something that sends all the traffic to you 1104 00:43:04,780 --> 00:43:06,960 It could be a completely legitimate image 1105 00:43:06,960 --> 00:43:08,520 That just happens to include our own 1106 00:43:08,520 --> 00:43:09,820 CA certs for future use 1107 00:43:10,880 --> 00:43:12,620 Or just to be confusing it could be 1108 00:43:12,620 --> 00:43:13,920 A totally different app you know 1109 00:43:13,920 --> 00:43:15,260 You could like get the update and it's like 1110 00:43:15,260 --> 00:43:17,960 Thank you for updating to Galleon 0.0.3 1111 00:43:18,620 --> 00:43:20,420 You know or just like you update 1112 00:43:20,420 --> 00:43:21,540 And then notepad opens 1113 00:43:22,840 --> 00:43:25,600 The other cool thing is that this works not just for the 1114 00:43:26,280 --> 00:43:28,360 Mozilla binaries but for the extensions too 1115 00:43:28,360 --> 00:43:30,600 So all the addons auto update 1116 00:43:30,600 --> 00:43:32,640 Where they connect to addons.mozilla.org 1117 00:43:32,640 --> 00:43:34,580 Over SSL and they say hey do you have anything new for me 1118 00:43:34,580 --> 00:43:36,220 And it says yes here you go run this thing 1119 00:43:36,980 --> 00:43:38,520 So even if you don't want to mess with 1120 00:43:38,520 --> 00:43:39,940 Like rootkitting the binary you can just 1121 00:43:39,940 --> 00:43:41,100 Rootkit whatever addon you want 1122 00:43:41,520 --> 00:43:44,440 Which is actually just as good because you can do anything from an addon 1123 00:43:45,860 --> 00:43:46,520 I taught 1124 00:43:46,520 --> 00:43:48,180 I did a training 1125 00:43:48,180 --> 00:43:50,960 At Blackhat called intercepting secure communication 1126 00:43:50,960 --> 00:43:52,680 And at the end we did an exercise 1127 00:43:52,840 --> 00:43:54,700 Where we had like a little malware competition for this 1128 00:43:54,700 --> 00:43:56,840 Vulnerability and the people that 1129 00:43:56,840 --> 00:43:58,540 Won had an addon that 1130 00:43:59,140 --> 00:44:00,300 Basically anytime that you 1131 00:44:00,840 --> 00:44:02,680 Posted data to a form it also 1132 00:44:02,680 --> 00:44:03,700 Posted a copy to them 1133 00:44:04,440 --> 00:44:06,680 So it's like the man in the middle attack that keeps on 1134 00:44:06,680 --> 00:44:07,620 Giving or whatever you know 1135 00:44:07,620 --> 00:44:12,720 So anything you know the problem is that in order to patch 1136 00:44:12,720 --> 00:44:14,720 Your system for this effectively you're not going to be able 1137 00:44:14,720 --> 00:44:16,420 To trust anything that comes through automatic updates 1138 00:44:16,420 --> 00:44:18,860 Or actually at this point anything that has ever 1139 00:44:18,860 --> 00:44:19,760 Come through automatic updates 1140 00:44:21,680 --> 00:44:22,680 Um so now 1141 00:44:22,840 --> 00:44:24,300 SSL sniff I have a 1142 00:44:24,740 --> 00:44:26,260 The fourth cut is an updated aware 1143 00:44:26,980 --> 00:44:28,720 SSL sniff so it does everything before 1144 00:44:28,720 --> 00:44:30,420 It does all the fingerprinting OCSP denial 1145 00:44:30,420 --> 00:44:32,780 All this stuff and now it also watches for 1146 00:44:32,780 --> 00:44:34,820 Update requests and um if it 1147 00:44:34,820 --> 00:44:36,620 Sees one you can specify 1148 00:44:36,620 --> 00:44:38,660 On the command line uh you know 1149 00:44:38,660 --> 00:44:40,820 You know update these platforms with this 1150 00:44:40,820 --> 00:44:42,820 Binary and you know if you see an addon 1151 00:44:42,820 --> 00:44:44,580 Update it with this thing or whatever 1152 00:44:44,580 --> 00:44:46,660 And so it'll just hijack the updates and 1153 00:44:47,260 --> 00:44:48,580 Install code on your computer 1154 00:44:49,820 --> 00:44:50,700 Um okay 1155 00:44:50,700 --> 00:44:52,440 As a quick postscript to all of this stuff 1156 00:44:53,640 --> 00:44:54,660 Stripping null characters 1157 00:44:54,660 --> 00:44:56,300 From certificates is not a solution 1158 00:44:56,860 --> 00:44:58,520 So there's like a couple of 1159 00:44:58,520 --> 00:45:00,740 Um stacks that aren't vulnerable to the thing 1160 00:45:00,740 --> 00:45:02,120 That I've been talking about so far like 1161 00:45:02,120 --> 00:45:04,260 Safari and opera aren't vulnerable to that 1162 00:45:04,760 --> 00:45:06,480 Um but they appear to just strip the 1163 00:45:06,480 --> 00:45:07,980 Null character from the common name 1164 00:45:07,980 --> 00:45:10,640 Before they compare it right so if you get paypal.com 1165 00:45:10,640 --> 00:45:12,660 Null character thoughtcrime.org they strip 1166 00:45:12,660 --> 00:45:14,580 It and then compare it so it becomes 1167 00:45:14,580 --> 00:45:16,300 Paypal.com.thoughtcrime.org 1168 00:45:16,840 --> 00:45:18,660 And so that stops this attack 1169 00:45:18,660 --> 00:45:20,540 But it actually opens up an attack vector 1170 00:45:20,540 --> 00:45:21,880 For a different attack um 1171 00:45:22,880 --> 00:45:24,780 So the weird thing is 1172 00:45:24,780 --> 00:45:26,840 That like some certificate authorities are vulnerable 1173 00:45:26,840 --> 00:45:28,600 To this internally right 1174 00:45:28,600 --> 00:45:30,720 So if you submit a csr 1175 00:45:30,720 --> 00:45:33,280 For paypal.com null character.thoughtcrime.org 1176 00:45:33,280 --> 00:45:33,940 The 1177 00:45:34,520 --> 00:45:36,840 Certificate authority itself trips over the null character 1178 00:45:36,840 --> 00:45:38,640 And tries to validate the cert against 1179 00:45:38,640 --> 00:45:40,860 Paypal.com so it thinks that 1180 00:45:40,860 --> 00:45:42,320 You're paypal.com um 1181 00:45:42,320 --> 00:45:44,720 But the interesting thing is that when you actually get the 1182 00:45:44,720 --> 00:45:46,680 Cert back it gives you the 1183 00:45:46,680 --> 00:45:48,860 Entire thing that was originally in the subject 1184 00:45:48,860 --> 00:45:50,720 Right um so 1185 00:45:50,720 --> 00:45:52,120 You know the problem is that uh 1186 00:45:52,840 --> 00:45:54,520 You know we're not paypal so we can't 1187 00:45:54,520 --> 00:45:56,780 You know we would not be able to get a cert that way 1188 00:45:56,780 --> 00:45:58,600 But you can do other things right so you could 1189 00:45:58,600 --> 00:46:00,520 Register a domain like sitekey.ba 1190 00:46:01,540 --> 00:46:02,460 And then 1191 00:46:02,460 --> 00:46:04,720 You get a certificate for sitekey.ba 1192 00:46:04,720 --> 00:46:07,220 Null character inc of america.com 1193 00:46:08,180 --> 00:46:08,840 And so 1194 00:46:08,840 --> 00:46:10,540 When the cas are like internally vulnerable 1195 00:46:10,540 --> 00:46:12,740 They'll they'll like 1196 00:46:12,740 --> 00:46:14,780 Do the authentication thing against sitekey.ba 1197 00:46:14,780 --> 00:46:16,540 Which you own right but then what you 1198 00:46:16,540 --> 00:46:18,700 Actually get back is sitekey.ba 1199 00:46:18,700 --> 00:46:21,020 Null character inc of america.com 1200 00:46:21,020 --> 00:46:21,940 Um 1201 00:46:22,840 --> 00:46:24,740 Right and so then when you actually 1202 00:46:24,740 --> 00:46:26,600 Present this to a ssl stack that 1203 00:46:26,600 --> 00:46:28,400 Strips the null character uh 1204 00:46:28,400 --> 00:46:30,860 It becomes sitekey.bankofamerica.com 1205 00:46:30,860 --> 00:46:32,920 And that would validate correctly 1206 00:46:32,920 --> 00:46:34,520 Against bank of america so basically 1207 00:46:35,660 --> 00:46:36,780 Every ssl 1208 00:46:36,780 --> 00:46:38,740 Implementation i think is vulnerable 1209 00:46:38,740 --> 00:46:39,980 To some variation of this 1210 00:46:39,980 --> 00:46:42,760 Um so in conclusion 1211 00:46:42,760 --> 00:46:44,740 Uh we have a man in the middle attack that will 1212 00:46:44,740 --> 00:46:46,920 Intercept communication for i think 1213 00:46:46,920 --> 00:46:48,260 Almost all ssl and 1214 00:46:48,700 --> 00:46:50,700 Tls implementations in the case of 1215 00:46:50,700 --> 00:46:52,820 Nss we only need a single certificate um 1216 00:46:52,840 --> 00:46:54,340 And we get all the traffic we defeated 1217 00:46:54,340 --> 00:46:56,740 Ocsp as implemented uh we can hijack the 1218 00:46:56,740 --> 00:46:58,640 Auto updates for applications and extensions 1219 00:46:58,640 --> 00:47:00,420 We've got an exploitable overflow 1220 00:47:01,040 --> 00:47:02,600 So in short we've got your 1221 00:47:02,600 --> 00:47:04,640 Passwords your communication and control 1222 00:47:04,640 --> 00:47:05,900 Of the software that runs on your computer 1223 00:47:16,600 --> 00:47:18,500 So um ssl 1224 00:47:18,500 --> 00:47:20,840 Ssl strip uh the thing that i was 1225 00:47:20,840 --> 00:47:22,600 Talking about the beginning is available on my website 1226 00:47:22,840 --> 00:47:24,480 It's been available for a while um 1227 00:47:24,480 --> 00:47:26,920 Ssl sniff the old version 1228 00:47:26,920 --> 00:47:28,260 Is available on my website and 1229 00:47:28,640 --> 00:47:30,700 The new version that supports all of these 1230 00:47:30,700 --> 00:47:32,720 New attacks will be available on my website 1231 00:47:32,720 --> 00:47:33,980 Sometime between 1232 00:47:34,620 --> 00:47:36,940 Today and monday 1233 00:47:36,940 --> 00:47:38,840 Um so you 1234 00:47:38,840 --> 00:47:40,680 Can download all that stuff there at thoughtcrime.org 1235 00:47:41,860 --> 00:47:42,380 Thanks 1236 00:47:45,140 --> 00:47:45,660 Um