1 00:00:01,520 --> 00:00:09,380 So hello everyone. Today we will talk about CertMitem, which is my tool and what it does is 2 00:00:09,380 --> 00:00:16,120 automatic exploitation of TLS certificate validation vulnerabilities. And we will first 3 00:00:16,120 --> 00:00:21,060 learn a little bit about all of these words, what they mean separately, and then we will put them 4 00:00:21,060 --> 00:00:29,540 together. But we will start with me. So I'm Aapo. I come from this Nordic cybersecurity company 5 00:00:29,540 --> 00:00:38,060 called Niksu, where I work as a senior security specialist and I focus on IoT. I do quite a lot 6 00:00:38,060 --> 00:00:43,640 of work with cryptography and network protocols and sometimes some people put them together to 7 00:00:43,640 --> 00:00:50,240 make this TLS thing. I also do security research, bug bounty, during the nights and weekends and 8 00:00:50,240 --> 00:00:56,700 kind of before you go to conferences you start the morning with some bug bounty. I go by Aapo, 9 00:00:56,800 --> 00:00:59,440 so please invite me everywhere, shamelessly. 10 00:00:59,540 --> 00:01:04,640 I'm Aapo. This is my first bug plugin. And I also coach this Finnish European cybersecurity 11 00:01:05,820 --> 00:01:13,360 challenge team from Finland, so good luck to us in Norway in couple of months. 12 00:01:15,140 --> 00:01:23,800 But let's dive directly into TLS. So when you use computers there's something that you want. 13 00:01:23,980 --> 00:01:29,340 So you have your computers. There's some kind of server somewhere. It has something that you 14 00:01:29,340 --> 00:01:37,620 you want and to get it you need to go through the internet. So this internet is a big mess of 15 00:01:37,620 --> 00:01:44,180 computers trying to get you what you want and of course it's made up of different computers in 16 00:01:44,180 --> 00:01:51,080 different countries run by different people and of course there are bad guys and these bad guys 17 00:01:51,080 --> 00:01:57,920 might also want what you want so they may be able to intercept your connections and listen in 18 00:01:57,920 --> 00:02:05,900 and for this we have this thing called TLS so transport layer security so it secures the 19 00:02:05,900 --> 00:02:16,120 connection between you and what you want. TLS basically it's encryption and authentication 20 00:02:16,120 --> 00:02:25,760 the encryption part is basically bunch of math kind of cryptography some people call it like 21 00:02:25,760 --> 00:02:27,440 military-grade stuff 22 00:02:27,920 --> 00:02:34,600 that it's kind of bulletproof encryption we're not going to be talking about that so the other 23 00:02:34,600 --> 00:02:42,680 part is authentication so TLS utilizes certificate-based authentication and that's really 24 00:02:42,680 --> 00:02:48,520 important because even if you have the best encryption if you connect to the bad guy it 25 00:02:48,520 --> 00:02:52,700 doesn't matter how well you encrypt the connection between you and the bad guy they will be able to 26 00:02:52,700 --> 00:02:57,400 see kind of the connection so that's why you really need to 27 00:02:57,920 --> 00:03:00,820 certificate the server first before you make the encrypted connection 28 00:03:03,240 --> 00:03:08,960 and these certificates you might have kind of heard about them might have used them 29 00:03:09,860 --> 00:03:16,320 they are these kind of files that have some information and a signature 30 00:03:17,000 --> 00:03:22,900 so this is basically exactly the same as your passport or kind of physical ID so it has some 31 00:03:22,900 --> 00:03:27,320 information about you it has some kind of signature that hey this is a valid 32 00:03:27,920 --> 00:03:29,060 certificate for you 33 00:03:31,500 --> 00:03:37,940 in the computer world the certificates are basically fancy text files that have information 34 00:03:37,940 --> 00:03:45,400 listed inside of them so information like issued by issued to public key some miscellaneous 35 00:03:45,400 --> 00:03:51,680 information and a signature but I think a good take out of this presentation is that this kind of 36 00:03:51,680 --> 00:03:57,360 they are only kind of information inside a text file nothing special. 37 00:03:59,600 --> 00:04:10,360 This information could for example be that you have a certificate that it issued by someone and it is issued to someone. 38 00:04:12,320 --> 00:04:20,120 It may contain like a public key this is for the encryption part also some information hey this is 39 00:04:20,120 --> 00:04:27,040 Aapo and Aapo's certificate and of course there is this kind of signature to kind of validate all this data. 40 00:04:27,920 --> 00:04:41,960 And how do you make these signatures you also have your private key so with your private key you can calculate the signature and kind of have this mathematical proof of ownership of the public key. 41 00:04:44,260 --> 00:04:52,700 So in a sense you have a certificate and you have a key and this key allows you to use your certificate. 42 00:04:54,760 --> 00:04:56,860 And what to use certificates for? 43 00:04:56,860 --> 00:05:08,320 Well you can use these certificates to issue another certificate so I have my Aapo certificate and I want to issue a certificate for a server. 44 00:05:09,100 --> 00:05:24,100 So we I just create this text file server.pem issued by Aapo to a server it has its own key but I need to sign it with my key so that's why it's issued by me because I have signed it. 45 00:05:26,220 --> 00:05:26,840 It has its own key but I need to sign it with my key so that's why it's issued by me because I have signed it. 46 00:05:28,200 --> 00:05:29,040 It has its own key but I need to sign it with my key so that's why it's issued by me because I have signed it. 47 00:05:29,040 --> 00:05:37,920 So this quite brief introduction to certificates but we can use these certificates now to do this TLS authentication. 48 00:05:40,100 --> 00:05:41,720 So this quite brief introduction to certificates but we can use these certificates now to do this TLS authentication. 49 00:05:41,720 --> 00:05:49,680 So server has a certificate that is issued by Aapo so we can use the Aapo certificate to verify the authenticity. 50 00:05:50,120 --> 00:05:56,840 So server has a certificate that is issued by Aapo so we can use the Aapo certificate to verify the authenticity. 51 00:05:56,840 --> 00:06:06,380 needs to have its own key so it can prove that it is allowed to use the server certificate. 52 00:06:19,900 --> 00:06:26,620 The main thing here and the main point of my talk is that you need to authenticate the 53 00:06:26,620 --> 00:06:30,860 server to be sure that you are connecting to the correct thing. 54 00:06:32,660 --> 00:06:35,200 So for that we need certificate validation. 55 00:06:37,140 --> 00:06:44,380 And of course there have been security problems in certificate validation in TLS quite a lot 56 00:06:44,760 --> 00:06:55,340 over the past 15-20 years and I think most notably in 2009-2012 between those that time 57 00:06:55,340 --> 00:06:57,440 there were quite a lot of kind of things. 58 00:06:57,700 --> 00:07:07,140 So Moxi had good talks here at DEF CON and created these tools to kind of attack certificate 59 00:07:07,140 --> 00:07:07,620 validation. 60 00:07:11,180 --> 00:07:16,940 The problems are in the libraries and how you use them and the libraries currently they 61 00:07:16,940 --> 00:07:23,180 kind of they have got some work so you can use the libraries securely nowadays. 62 00:07:25,740 --> 00:07:28,580 The problem is that the implementation part is still hard. 63 00:07:29,100 --> 00:07:32,860 It's super hard to use this and we will talk more about those. 64 00:07:37,320 --> 00:07:43,740 And 2012 there was also this paper titled the most dangerous code in the world validating 65 00:07:43,740 --> 00:07:46,240 SSL certificates in non-browser software. 66 00:07:47,360 --> 00:07:50,080 And kind of not much have changed since then. 67 00:07:50,460 --> 00:07:55,180 Nowadays we call it TLS but still it's the same thing and the problems are the same. 68 00:07:55,340 --> 00:08:08,040 And we will talk a little bit more about this publication in the end but kind of I want 69 00:08:08,040 --> 00:08:12,600 to give you some overview on kind of what these kind of problems have been. 70 00:08:14,400 --> 00:08:24,260 So I think the biggest problem with CLS certificate authentication is kind of you can see it from 71 00:08:24,260 --> 00:08:24,660 this slide. 72 00:08:27,320 --> 00:08:30,580 If you don't spot it we can zoom a little bit and enhance. 73 00:08:31,440 --> 00:08:33,560 So you might be able to see it. 74 00:08:35,660 --> 00:08:40,200 Like what does it mean that you can check the authenticity of the server? 75 00:08:44,340 --> 00:08:50,660 So it turns out certificate validation in CLS is completely optional and you don't have 76 00:08:50,660 --> 00:08:51,100 to do it. 77 00:08:52,640 --> 00:08:55,320 So to ensure that you really are connected. 78 00:08:55,340 --> 00:08:59,880 To the correct server you have to validate the server certificate if you want to. 79 00:09:00,980 --> 00:09:06,840 Like usually it's enabled by default but it can be turned off. 80 00:09:07,860 --> 00:09:12,960 And if something can be turned off like a security feature can be turned off it definitely 81 00:09:12,960 --> 00:09:13,900 will be turned off. 82 00:09:14,620 --> 00:09:21,140 And if you go to Stack Overflow and kind of search for how to fix certificate validation 83 00:09:21,140 --> 00:09:24,020 issues they tell you hey just turn it off. 84 00:09:24,020 --> 00:09:28,000 You won't have any problems validating a certificate ever anymore. 85 00:09:32,350 --> 00:09:36,020 And the certificate validation is really hard to configure. 86 00:09:36,360 --> 00:09:45,120 So many libraries they allow for kind of secure certificate validation but they might not 87 00:09:45,120 --> 00:09:46,440 have secure defaults. 88 00:09:50,460 --> 00:09:53,410 So kind of practical certificate validation. 89 00:09:53,410 --> 00:09:57,010 It boils down to kind of three things. 90 00:09:57,110 --> 00:10:01,770 Like if it's enabled at all then there's three things left to do. 91 00:10:02,530 --> 00:10:04,650 So we need to check the signature. 92 00:10:05,250 --> 00:10:06,890 Like it's just a text file. 93 00:10:07,250 --> 00:10:08,270 You can make it up. 94 00:10:09,170 --> 00:10:14,650 And if you don't check the signature like anyone can create any kind of certificate. 95 00:10:16,950 --> 00:10:19,210 Next thing who has issued the certificate. 96 00:10:20,530 --> 00:10:22,290 So you really need to check this. 97 00:10:22,390 --> 00:10:22,630 Because. 98 00:10:22,630 --> 00:10:24,910 I just created my Aapo.bem. 99 00:10:25,030 --> 00:10:28,230 I can issue certificates with that. 100 00:10:28,650 --> 00:10:30,890 But you kind of shouldn't trust it. 101 00:10:30,970 --> 00:10:31,850 I just created it. 102 00:10:32,970 --> 00:10:36,190 And also who is the certificate issued to. 103 00:10:38,150 --> 00:10:42,110 So if I issue a certificate to my server. 104 00:10:42,510 --> 00:10:43,990 Like it's issued to my server. 105 00:10:44,230 --> 00:10:47,650 It's not issued to Google's or Apple's or whoever's servers. 106 00:10:47,850 --> 00:10:48,850 It's only for mine. 107 00:10:49,350 --> 00:10:51,230 So but of course. 108 00:10:51,230 --> 00:10:52,730 It's just a text file. 109 00:10:52,890 --> 00:10:53,550 I can kind of present. 110 00:10:53,730 --> 00:10:54,590 Hey this is my certificate. 111 00:10:55,090 --> 00:10:56,930 And if you don't check it. 112 00:10:57,690 --> 00:10:58,750 It might go through. 113 00:11:05,950 --> 00:11:09,410 So kind of have that has the certificate been signed. 114 00:11:09,710 --> 00:11:12,890 So has the math part been done. 115 00:11:13,790 --> 00:11:16,310 And this is usually checked by the TLS libraries. 116 00:11:17,690 --> 00:11:21,150 So there should not be kind of problems with this. 117 00:11:27,190 --> 00:11:29,510 And like who has issued the certificate. 118 00:11:29,890 --> 00:11:32,610 So there are these things called global certificate authorities. 119 00:11:33,250 --> 00:11:38,490 So basically a bunch of companies who have their own Aapo certificates. 120 00:11:38,950 --> 00:11:41,850 Just kind of shipped out to all the operating systems. 121 00:11:42,270 --> 00:11:45,470 And they are there kind of by default in the operating systems. 122 00:11:45,750 --> 00:11:48,470 And then they can charge money to issue certificates for you. 123 00:11:48,770 --> 00:11:49,370 There's. 124 00:11:49,410 --> 00:11:49,990 Of course. 125 00:11:49,990 --> 00:11:53,990 There's these kind of nice players like Let's Encrypt who they have done that. 126 00:11:54,050 --> 00:11:55,190 They have kind of paid for it. 127 00:11:55,250 --> 00:11:55,970 They have the infrastructure. 128 00:11:56,290 --> 00:11:58,730 But they will be giving out these certificates for free. 129 00:11:59,590 --> 00:12:03,410 So you should get kind of get your certificates. 130 00:12:04,190 --> 00:12:09,430 And this is something that kind of nowadays kind of everyone every server has a certificate. 131 00:12:09,910 --> 00:12:13,670 And it's kind of there's a big thanks goes to Let's Encrypt for that. 132 00:12:15,310 --> 00:12:17,750 Of course I could just use my Aapo.pem. 133 00:12:17,970 --> 00:12:19,290 That's valid certificate. 134 00:12:19,990 --> 00:12:21,810 It's self-signed because it has issued itself. 135 00:12:23,050 --> 00:12:26,150 So kind of you need to check. 136 00:12:26,410 --> 00:12:32,430 Like you can't just offer a self-signed certificate and kind of it shouldn't be trusted. 137 00:12:35,110 --> 00:12:38,930 Like it could be if you kind of trust only that. 138 00:12:39,130 --> 00:12:44,590 But you kind of shouldn't be able to create a self-signed certificate on the fly and have 139 00:12:44,590 --> 00:12:45,570 someone accept it. 140 00:12:46,710 --> 00:12:47,770 And of course. 141 00:12:47,950 --> 00:12:48,490 Like. 142 00:12:48,490 --> 00:12:50,730 Is the issuer even allowed to issue certificates? 143 00:12:51,770 --> 00:12:55,290 So if I get this certificate from Let's Encrypt. 144 00:12:56,010 --> 00:13:01,990 Like it says that I can't create any more certificates because of course you shouldn't 145 00:13:01,990 --> 00:13:02,610 trust me. 146 00:13:03,790 --> 00:13:05,930 But it's still it's a fancy text file. 147 00:13:06,130 --> 00:13:07,810 I can just kind of create. 148 00:13:07,910 --> 00:13:08,990 I can calculate the signatures. 149 00:13:09,150 --> 00:13:13,650 I have the private key for my Let's Encrypt certificate and I can create more certificates 150 00:13:13,650 --> 00:13:14,410 with it. 151 00:13:14,710 --> 00:13:15,570 It's not allowed. 152 00:13:16,090 --> 00:13:17,530 But if you don't check it. 153 00:13:17,530 --> 00:13:18,470 It goes through. 154 00:13:24,730 --> 00:13:26,590 Like who is the certificate issued to? 155 00:13:26,890 --> 00:13:28,810 I talk about this Let's Encrypt certificate. 156 00:13:29,150 --> 00:13:32,110 So I have a certificate issued to me, to my server. 157 00:13:32,950 --> 00:13:36,170 And if you are connecting to my server, you should trust my certificate. 158 00:13:36,550 --> 00:13:39,290 But if you are connecting to somewhere else, like you shouldn't trust mine. 159 00:13:40,410 --> 00:13:44,810 But this is one of the biggest things I've come up with. 160 00:13:45,050 --> 00:13:45,530 That. 161 00:13:46,070 --> 00:13:46,550 Like. 162 00:13:47,530 --> 00:13:53,170 If you use OpenSSL and WolfSSL, they don't check who the certificate is issued to. 163 00:13:53,550 --> 00:13:57,090 Like you have to go into the settings and kind of enable it. 164 00:13:57,250 --> 00:14:02,790 So the default context of OpenSSL, it doesn't have the hostname validation enabled. 165 00:14:03,670 --> 00:14:08,310 So if you use OpenSSL, like you might want to check that. 166 00:14:08,390 --> 00:14:11,830 Have you remembered to kind of enable the hostname validation? 167 00:14:15,550 --> 00:14:17,010 And don't let get me. 168 00:14:17,010 --> 00:14:19,790 It started with custom certificate validators. 169 00:14:20,250 --> 00:14:23,590 So these are kind of really fun. 170 00:14:23,970 --> 00:14:25,430 Really scary, but really fun. 171 00:14:26,230 --> 00:14:32,410 Because you can see kind of quite a lot of different things when you kind of read the 172 00:14:32,410 --> 00:14:34,790 source code of someone's certificate validator. 173 00:14:37,410 --> 00:14:39,650 So we can take a look at this code. 174 00:14:40,350 --> 00:14:46,230 And like if there's some really kind of dotnet developers who do certificate validation all 175 00:14:46,230 --> 00:14:47,130 day, you might spot them. 176 00:14:48,130 --> 00:14:50,550 But let me highlight some problems here. 177 00:14:51,350 --> 00:14:56,230 So this is like 15 lines of code that actually do the validation. 178 00:14:57,270 --> 00:15:03,070 And on this line, we are checking the elements of the chain. 179 00:15:03,230 --> 00:15:06,730 So we are checking the kind of certificate chain. 180 00:15:07,070 --> 00:15:10,070 So we only take the last element. 181 00:15:10,230 --> 00:15:12,150 So we take the kind of CA. 182 00:15:12,410 --> 00:15:13,670 And we only look at that. 183 00:15:13,750 --> 00:15:15,690 So we don't even look at the certificate. 184 00:15:15,690 --> 00:15:16,210 So we only look at that. 185 00:15:17,310 --> 00:15:18,950 We don't look at the server certificate. 186 00:15:19,130 --> 00:15:21,750 We only look at the CA of the certificate. 187 00:15:22,450 --> 00:15:27,170 So for that, like, it doesn't check who the certificate is issued to. 188 00:15:27,270 --> 00:15:30,690 It only checks that it's issued by this certain thing. 189 00:15:34,030 --> 00:15:35,730 Of course, it doesn't check the signature. 190 00:15:36,130 --> 00:15:40,790 So you don't even need to kind of have a certificate from that CA. 191 00:15:41,030 --> 00:15:43,950 So you can just make it up because it doesn't check the signature. 192 00:15:44,170 --> 00:15:44,390 Okay. 193 00:15:44,390 --> 00:15:51,130 And like, if this is kind of hard for you and might not kind of know how to do this, 194 00:15:51,270 --> 00:15:53,010 they made it even easier. 195 00:15:53,290 --> 00:15:59,090 So in the end, if all the checks fail, there is this return true. 196 00:15:59,510 --> 00:16:05,750 So any certificate file whatsoever doesn't need to be signed, doesn't like any certificate 197 00:16:06,270 --> 00:16:09,150 will be accepted by this certificate validator. 198 00:16:11,670 --> 00:16:14,370 If you scroll up a bit on the code, we will see. 199 00:16:14,390 --> 00:16:15,230 We will see where this is from. 200 00:16:15,870 --> 00:16:21,410 So this is from this product, Microsoft Management Services Intune Windows Agent. 201 00:16:25,630 --> 00:16:33,950 So if you don't know what it does, it runs every hour and it checks the internet, like, 202 00:16:34,030 --> 00:16:40,650 from Microsoft service servers, that is there a script for it to run with system privileges. 203 00:16:41,270 --> 00:16:43,030 And like. 204 00:16:43,210 --> 00:16:43,850 Okay. 205 00:16:43,850 --> 00:16:49,090 So if I intercept the connection, I give my certificate, it trusts me that I'm Microsoft. 206 00:16:49,290 --> 00:16:53,390 So of course I have scripts for you that you should run a system. 207 00:16:54,310 --> 00:16:57,770 And with that, there's this remote code execution vulnerability. 208 00:17:03,430 --> 00:17:03,950 But yeah. 209 00:17:13,850 --> 00:17:20,090 The vulnerabilities, the issues, everything, we've seen this code, we kind of now have 210 00:17:20,090 --> 00:17:22,170 an idea on what to do. 211 00:17:23,390 --> 00:17:25,250 But how to actually do it? 212 00:17:25,350 --> 00:17:27,890 How do we attack against certificate validation? 213 00:17:32,570 --> 00:17:34,610 So we have these problems. 214 00:17:40,170 --> 00:17:43,650 Like the certificate validator needs to check this. 215 00:17:43,850 --> 00:17:44,190 These three things. 216 00:17:44,450 --> 00:17:46,210 So who has issued the certificate? 217 00:17:46,630 --> 00:17:51,970 So if you want to attack that, we can just kind of self-sign some certificates. 218 00:17:52,130 --> 00:17:54,350 If it doesn't check for it, it will go through. 219 00:17:56,370 --> 00:18:02,070 We can also take our kind of let's encrypt certificate and we can sign new certificates. 220 00:18:02,450 --> 00:18:07,910 Like if it doesn't check, like is the certificate actually allowed to create new certificates, 221 00:18:09,410 --> 00:18:10,990 then that might go through. 222 00:18:14,850 --> 00:18:21,110 Also, if it doesn't check who the certificate is issued to, we can get the certificate from 223 00:18:21,110 --> 00:18:28,510 a proper CA, like let's encrypt, for our website and we can try to offer it to the kind of 224 00:18:29,070 --> 00:18:31,590 client application connecting to us. 225 00:18:34,090 --> 00:18:39,930 And the signature, if it doesn't check, has the certificate been signed, we can just change, 226 00:18:40,170 --> 00:18:41,710 kind of get the original certificate. 227 00:18:42,150 --> 00:18:43,830 We can put our password. 228 00:18:43,830 --> 00:18:44,390 We can put a public key there. 229 00:18:44,710 --> 00:18:47,830 And then we will have the key to the certificate. 230 00:18:48,390 --> 00:18:51,210 Like it shouldn't work because the signature is invalid. 231 00:18:51,950 --> 00:18:56,410 But if you don't check the signature, then it will be a valid certificate. 232 00:19:02,210 --> 00:19:03,390 So there's me. 233 00:19:03,970 --> 00:19:04,970 There's what I want. 234 00:19:05,490 --> 00:19:07,910 And the TLS connection right there. 235 00:19:08,430 --> 00:19:13,730 So if someone goes between the connection, generates some self-signed certificates, 236 00:19:13,810 --> 00:19:18,450 gets some let's encrypt certificates, does all of this, and does the man in the middle, 237 00:19:18,530 --> 00:19:21,050 like that's it. 238 00:19:21,170 --> 00:19:21,590 That's easy. 239 00:19:21,930 --> 00:19:27,130 And this thing, like this was talked about like 14 years ago. 240 00:19:27,490 --> 00:19:31,730 So there's nothing new in anything that I've shown you here now. 241 00:19:33,310 --> 00:19:35,890 So why am I talking here to you? 242 00:19:37,130 --> 00:19:41,770 So when I was a kid, I looked at those kind of Moxie's presentations. 243 00:19:41,850 --> 00:19:43,470 And when I... 244 00:19:43,470 --> 00:19:48,410 When I got into penetration testing, of course, I wanted to try these things out. 245 00:19:49,030 --> 00:19:54,530 But when you are attacking kind of a phone or a laptop, it's not this. 246 00:19:54,750 --> 00:19:59,450 Like this is the kind of easy thing, but actually it looks like this. 247 00:20:00,450 --> 00:20:03,410 So nowadays, like you have a bunch of apps and libraries. 248 00:20:03,690 --> 00:20:09,530 Like on a phone, you might have kind of hundreds of different TLS connections. 249 00:20:10,530 --> 00:20:12,410 And when you have hundreds of applications. 250 00:20:13,470 --> 00:20:18,530 With hundreds of TLS connections, you have so many certificate validators to test. 251 00:20:20,910 --> 00:20:26,770 So how do we actually test kind of all these certificate validators? 252 00:20:27,470 --> 00:20:30,970 It might take like 30 minutes to kind of test one connection. 253 00:20:31,110 --> 00:20:38,750 And if we have a hundred connections and you're paid by the hour, like it will take too long. 254 00:20:40,470 --> 00:20:41,030 So... 255 00:20:42,130 --> 00:20:43,190 We need automation. 256 00:20:43,190 --> 00:20:43,450 Automation. 257 00:20:43,470 --> 00:20:43,650 Automation. 258 00:20:49,350 --> 00:20:49,770 Automation. 259 00:20:50,390 --> 00:20:50,650 Automation. 260 00:20:50,650 --> 00:20:50,670 Automation. 261 00:20:50,670 --> 00:20:50,950 Automation. 262 00:20:50,950 --> 00:20:51,010 Automation. 263 00:20:51,390 --> 00:20:51,810 Automation. 264 00:20:52,050 --> 00:20:52,470 Automation. 265 00:20:52,470 --> 00:20:52,490 Automation. 266 00:20:52,490 --> 00:20:52,550 Automation. 267 00:20:52,550 --> 00:20:52,730 Automation. 268 00:20:54,890 --> 00:20:55,310 Automation. 269 00:20:55,310 --> 00:20:55,510 Automation. 270 00:20:55,510 --> 00:20:55,830 Automation. 271 00:20:56,190 --> 00:20:56,370 Automation. 272 00:20:56,370 --> 00:20:56,470 Automation. 273 00:20:56,690 --> 00:20:56,870 Automation. 274 00:20:57,130 --> 00:20:57,550 Automation. 275 00:20:57,550 --> 00:20:57,610 Automation. 276 00:20:57,610 --> 00:20:58,010 Automation. 277 00:21:05,990 --> 00:21:06,410 Automation. 278 00:21:08,050 --> 00:21:13,470 differentiate between the connections so because we need to kind of offer many 279 00:21:13,470 --> 00:21:20,450 certificates we need to know which connection is what and for that there is 280 00:21:20,450 --> 00:21:24,270 some information available like completely black black box you still 281 00:21:24,270 --> 00:21:30,290 have the client IP you have the server IP you have this thing called SNI so 282 00:21:30,290 --> 00:21:34,450 server name identifier so that is something that you can kind of see from 283 00:21:34,450 --> 00:21:38,810 the connection so you see that there is a client connecting to a server and it 284 00:21:38,810 --> 00:21:43,950 asking that hey I want to connect to this host name so from that we kind of 285 00:21:43,950 --> 00:21:48,570 know that hey this is like this is a connection and if we see that connection 286 00:21:48,570 --> 00:21:53,050 that type of connection we can kind of think that hey this is might be done by 287 00:21:53,050 --> 00:21:58,610 a single certificate validator and kind of every time it will be kind of the 288 00:21:58,610 --> 00:22:02,270 same application and maybe the same validator 289 00:22:04,630 --> 00:22:12,210 so we want to kind of attack these so I created this tool called CertMitim 290 00:22:12,210 --> 00:22:20,450 and it does exactly that so we have a client it wants to connect to this auth 291 00:22:20,450 --> 00:22:27,190 example and when it first connects we will kind of intercept the connection 292 00:22:27,190 --> 00:22:32,030 and stop it there kind of freeze the time and start to do some things 293 00:22:34,510 --> 00:22:40,530 so first we will fetch the certificate from the auth example we will generate 294 00:22:40,530 --> 00:22:46,370 all the certificates do all the kind of test cases that we talked about and then 295 00:22:46,370 --> 00:22:50,710 we will start to test these certificates so for this first 296 00:22:50,710 --> 00:22:57,290 connection we will give a self-signed certificate and then it fails the 297 00:22:57,290 --> 00:23:02,630 connection it terminates the connection and then it most likely tries again so 298 00:23:02,630 --> 00:23:03,750 you might need to click 299 00:23:03,750 --> 00:23:09,150 retry or something or wait a bit but at some point it will make a connection to 300 00:23:09,150 --> 00:23:14,810 auth example again and then we will offer the certificate where we have 301 00:23:14,810 --> 00:23:22,130 replaced the key it fails we will offer a real certificate our let's 302 00:23:22,130 --> 00:23:26,990 encrypt certificate for example it fails we will try to use our let's 303 00:23:26,990 --> 00:23:33,550 encrypt certificate as a CA and it fails so we need to just let the 304 00:23:33,550 --> 00:23:40,510 connection go so it connects to the auth example and the auth example kind of 305 00:23:40,510 --> 00:23:46,970 they talked in TLS so we have no idea what's going on of course if that kind 306 00:23:46,970 --> 00:23:51,290 of server is calledществ and it's that first connection from the application it 307 00:23:51,290 --> 00:23:54,930 might be doing some kind of authentication and usually kind of 308 00:23:54,930 --> 00:23:58,950 authentication libraries are secure like they have done this 309 00:23:58,950 --> 00:24:03,350 so, next like if you let it connect to the 310 00:24:03,350 --> 00:24:10,130 auth example and do the authentication, like in a couple of seconds you will see a call to API 311 00:24:10,130 --> 00:24:15,970 example. And we will do the same. So we will fetch the API example certificate, 312 00:24:16,670 --> 00:24:21,690 we will generate the certificate, so we will kind of try to clone it as close as possible 313 00:24:22,190 --> 00:24:27,970 with the kind of different attacks we talked about. And then we will start to test this. 314 00:24:36,190 --> 00:24:42,030 So we give it the self-signed, it fails. We give the replaced key, it fails. We give our 315 00:24:42,030 --> 00:24:52,690 let's encrypt certificate. And what is this? We see a connection kind of go through. So it will 316 00:24:52,690 --> 00:25:00,190 try to connect to us and we of course accept the connection and it will say send to us this payment 317 00:25:00,790 --> 00:25:03,330 post request. And there's the application. And then we will send it to the server. 318 00:25:03,350 --> 00:25:07,870 And we have the authorization token. So even though we didn't kind of intercept the authentication, 319 00:25:08,470 --> 00:25:15,110 we now have the token to authenticate as the client. And of course there's some kind of 320 00:25:15,110 --> 00:25:22,490 business-critical data in the post request. To be really thorough, we close the connection 321 00:25:23,270 --> 00:25:30,870 and for the next connection we give this real Serata CA test. And it fails. But now we know 322 00:25:30,870 --> 00:25:33,330 that there is one test for this particular client. And that is the authorization token. 323 00:25:33,350 --> 00:25:38,790 So we have a particular connection from this particular client that we can use to intercept it. 324 00:25:40,670 --> 00:25:46,190 So now comes the man in the middle part. So we connect to API example from cert.mitim. 325 00:25:47,150 --> 00:25:51,770 And for the next API example connection, we will give the real certificate. 326 00:25:52,590 --> 00:26:01,790 So the let's encrypt certificate. So kind of not there. It's not real. But yeah, so let's decrypt. 327 00:26:04,070 --> 00:26:11,990 So we get the same post request. It tries to resend it. And now we kind of give the kind of 328 00:26:13,110 --> 00:26:19,850 push the connection through. So we send the data to API example. And it kind of it can then 329 00:26:20,930 --> 00:26:26,670 give some something back. And the next connection like it connects to API example. 330 00:26:26,990 --> 00:26:32,550 It wants a software update. And we can see the software update coming from the API example. 331 00:26:33,350 --> 00:26:38,430 And we can see the client. And because we control this flow, we can see everything. So of course, 332 00:26:38,430 --> 00:26:45,830 we can change this. So for Intune, this would be the case where you kind of it tries to get the 333 00:26:45,830 --> 00:26:50,950 script. And then the server is like, hey, there's no scripts for you. But we can modify it that set 334 00:26:50,950 --> 00:26:56,930 to always say that, of course, we have a script for you. cert.mitim doesn't do that. This is only 335 00:26:56,930 --> 00:27:03,330 for figuring out where these vulnerabilities are. And then you can use these certificates generated by the server. 336 00:27:03,330 --> 00:27:05,730 cert.mitim to actually do that attacking. 337 00:27:10,110 --> 00:27:13,410 But yeah, so I have demo of this tool. 338 00:27:15,330 --> 00:27:25,470 So let's see. So let's go here and start. So on the left, there is a terminal. So I have set up 339 00:27:26,020 --> 00:27:33,010 some redirections. So if this and if anyone wants to connect through my computer to the internet, 340 00:27:33,330 --> 00:27:42,010 using these TLS ports, these will be kind of redirected to a port on my computer. So 9900. 341 00:27:42,690 --> 00:27:48,830 And there I will have cert.mitim running. So we have a Windows machine connecting to the internet 342 00:27:48,830 --> 00:27:56,450 through my machine. And we are redirecting the TLS connections to cert.mitim. And here we can see 343 00:27:56,450 --> 00:28:03,310 the connections and see the tests. So there are multiple connections, trying to kind of, kind of, 344 00:28:03,330 --> 00:28:08,310 connect to the internet. We are giving certificates. And then in the end, you can see what happened. 345 00:28:08,510 --> 00:28:14,650 So nothing received. So we didn't receive any data. So that's supposed to happen. Like if we give a 346 00:28:14,650 --> 00:28:18,610 bad certificate, we are not supposed to get anything. So we either get nothing received, 347 00:28:18,710 --> 00:28:28,230 or we get some error. But there is this kind of red error message here. It says that it's 348 00:28:28,230 --> 00:28:33,070 go.microsoft.com connection. And we use the real certificate. So we have 349 00:28:33,330 --> 00:28:39,190 if we give a Let's Encrypt certificate to Windows, it will kind of connect to us. 350 00:28:41,170 --> 00:28:48,350 And there is this two connections related to each other. And we can go see the logs. So here we have 351 00:28:48,350 --> 00:28:56,030 the kind of all the traffic logs, what certificates kind of worked for what host names. And here we 352 00:28:56,030 --> 00:29:01,850 can see the actual data that was downloaded by Windows. So this is a configuration file 353 00:29:02,310 --> 00:29:03,310 to configure the TLS. And then we can see the data that was downloaded by Windows. So this is a configuration file to configure 354 00:29:03,330 --> 00:29:10,410 where Windows sends the login credentials when you log in. So this is nice thing to kind of intercept 355 00:29:10,410 --> 00:29:16,510 because here we can change all of these, like every kind of URL definition we can change to 356 00:29:16,510 --> 00:29:21,710 something where we have the certificate for. And now Windows trusts us. And 357 00:29:22,690 --> 00:29:29,650 that was kind of a vulnerability that I found with this tool. And well, quite critical one. 358 00:29:41,550 --> 00:29:46,030 Next, we have more Windows. So now we've kind of logged into Windows. 359 00:29:47,590 --> 00:29:53,850 We will kind of modify the parameters a little bit of certain with them. So we will run every 360 00:29:53,850 --> 00:30:01,670 test twice. So sometimes these kind of applications are a little picky, and they kind of don't, 361 00:30:01,670 --> 00:30:05,070 the first connection doesn't go through and you need to run the test twice. 362 00:30:06,010 --> 00:30:10,790 But here we are setting up a work or school account. So we are connecting our 363 00:30:10,790 --> 00:30:17,770 Windows laptop to our organization. If we are running these GUI applications, 364 00:30:18,030 --> 00:30:24,330 we might need to kind of retry. It doesn't automatically retry stuff. So we need to just 365 00:30:24,330 --> 00:30:30,950 click on retry. And here we get a connection again for our Let's Encrypt certificate. And it asks us 366 00:30:31,670 --> 00:30:37,350 where should I go if I want to kind of connect to the organization. So I can now intercept 367 00:30:37,950 --> 00:30:46,430 the connection from here, and I can set kind of take control of your machine by kind of forcing 368 00:30:46,430 --> 00:30:52,850 it to connect to my organization. So this was another vulnerability found with SharedMetham. 369 00:31:00,470 --> 00:31:01,230 And now, 370 00:31:01,230 --> 00:31:05,750 after hard days of work I want to play some games so I boot up my PlayStation 371 00:31:05,750 --> 00:31:13,270 and I want to play a game but I don't want to play by myself so I want to go 372 00:31:13,270 --> 00:31:19,410 online and what best way to go online then through shared medium so we can see 373 00:31:19,410 --> 00:31:24,330 here it's making different connections to the internet through shared medium 374 00:31:24,330 --> 00:31:29,310 and we are trying to intercept the connections and well this application is 375 00:31:29,310 --> 00:31:32,930 a little picky it's kind of it has a connection it really wants to get through 376 00:31:32,930 --> 00:31:40,210 and then after that kind of when we have run our all our tests we will let the 377 00:31:40,210 --> 00:31:43,030 connection through and then there's another one it really wants to get 378 00:31:43,030 --> 00:31:49,030 through so we need to kind of do this multiple times but this is only for the 379 00:31:49,030 --> 00:31:52,370 kind of figuring out if there is a vulnerability phase so when you are 380 00:31:52,370 --> 00:31:56,230 actually exploiting this and you know what connections can be intercepted then 381 00:31:56,230 --> 00:31:58,530 you don't need to kind of retry anything you can just 382 00:31:58,530 --> 00:31:59,290 for the 383 00:31:59,310 --> 00:32:04,450 certain connections you can just offer the certain certificate and be done with 384 00:32:04,450 --> 00:32:11,070 it but I think now we are starting to kind of go past these first phases of 385 00:32:11,070 --> 00:32:17,150 them kind of going online and those parts of the application had a 386 00:32:17,150 --> 00:32:22,410 certificate validator that works but when we get kind of through the first 387 00:32:22,410 --> 00:32:25,890 five connections we start to see connections with really bad certificate 388 00:32:25,890 --> 00:32:29,050 validators so all the red are 389 00:32:29,050 --> 00:32:37,190 connections made by this game that are vulnerable for this and when all the 390 00:32:37,190 --> 00:32:44,010 tests cases have been kind of gone true we will start see the actual data go 391 00:32:44,010 --> 00:32:50,290 through our machine to the internet and we will see everything here so here we 392 00:32:50,290 --> 00:32:58,110 are intercepting connections from a ps5 game and again vulnerability found by 393 00:32:58,110 --> 00:32:58,770 cert mitem 394 00:33:10,510 --> 00:33:14,990 so let's see so we are getting these connections here's the log from cert 395 00:33:14,990 --> 00:33:23,950 mitem and I think we're changing up we're booting up an iPhone I have to kind 396 00:33:23,950 --> 00:33:28,670 of take the HDMI's out and plug them in and now 397 00:33:29,470 --> 00:33:35,010 but yeah we have an iPhone here so let's make it a little bit bigger and 398 00:33:35,010 --> 00:33:45,130 connect to the internet with Wi-Fi so soon we should start to see connections 399 00:33:45,130 --> 00:33:50,710 made by an iPhone and of course good part about cert mitem that it's multi 400 00:33:50,710 --> 00:33:54,890 threading so you can do all of these tests kind of at the same time so I have 401 00:33:54,890 --> 00:33:58,590 a ps5 controller in one hand iPhone on another and just go nuts 402 00:33:59,530 --> 00:34:04,390 you of course need to again retry the connections a couple of times until you 403 00:34:04,390 --> 00:34:13,450 get inside the application this is a lot faster it has kind of better error 404 00:34:13,450 --> 00:34:21,690 handling and here we start to download LinkedIn so we again need to just click a 405 00:34:21,690 --> 00:34:29,030 couple of times see what connections are made and just see that no tests are made 406 00:34:29,050 --> 00:34:36,250 and it kind of goes through but again there are so many certificate validators so we 407 00:34:36,250 --> 00:34:43,890 just need to find the insecure ones and here when iPhone downloads apps all the 408 00:34:43,890 --> 00:34:48,730 tests fail or kind of go through and here we can see an iPhone application 409 00:34:48,730 --> 00:34:54,770 being downloaded or we can see the plain text data of that and we can see here 410 00:34:55,750 --> 00:34:58,970 LinkedIn application downloaded from an iPhone 411 00:34:59,050 --> 00:35:03,910 And again, vulnerability found by ShirtMitem. 412 00:35:17,430 --> 00:35:22,750 And yeah, this kind of keeps on going. The list is quite big. Here's Mattermost 413 00:35:22,750 --> 00:35:28,790 giving us the Mattermost authentication token that we can use to take control of 414 00:35:28,790 --> 00:35:36,530 the victims' Mattermost. So here again, vulnerability found with ShirtMitem. 415 00:35:36,730 --> 00:35:42,070 And I just want to highlight, I have quite a lot of these here, just for 416 00:35:42,070 --> 00:35:46,670 you to see that it's quite easy to find this. This is, of 417 00:35:46,670 --> 00:35:49,950 course, it's staged in that way that I know that these applications are 418 00:35:49,950 --> 00:35:56,610 vulnerable, but we've just tested in less than 10 minutes, we have tested like five 419 00:35:56,610 --> 00:35:58,410 or six different applications. 420 00:35:59,510 --> 00:36:05,030 And here we are playing a mobile game and we're getting quite a lot of kind of 421 00:36:05,030 --> 00:36:14,350 certificate validation vulnerabilities. And sometimes these applications kind of, 422 00:36:14,350 --> 00:36:18,790 they don't show the errors, but they still don't go further. So we might need 423 00:36:18,790 --> 00:36:23,070 to kind of kill the application, restart the application. Sometimes the 424 00:36:23,070 --> 00:36:28,330 applications like crash when you do this test because kind of at no point in the 425 00:36:28,830 --> 00:36:33,870 kind of the fourth TLS connection failed like usually like if you are connected 426 00:36:33,870 --> 00:36:39,130 to the Internet you kind of everything goes through or nothing goes through but 427 00:36:39,130 --> 00:36:44,750 here we will speak and see kind of some update files some definitions whatever 428 00:36:44,750 --> 00:36:50,530 downloaded by the game and here we can see kind of the now that all the tests 429 00:36:50,530 --> 00:36:56,710 have been kind of done we can see the kind of man in the middle here and one 430 00:36:56,710 --> 00:36:59,570 good thing about the cert mitum is that you can actually kind of use these 431 00:36:59,570 --> 00:37:05,990 applications quite well like after you have kind of click retry bunch of times 432 00:37:05,990 --> 00:37:11,250 then you can just start using these applications and they kind of go through 433 00:37:11,250 --> 00:37:16,490 quite well and you can kind of download applications you can get just just keep 434 00:37:16,490 --> 00:37:22,990 this on so at my home I just kind of have everything connected to cert mitum 435 00:37:22,990 --> 00:37:26,690 all the time and then at kind of sometimes I just kind of 436 00:37:26,690 --> 00:37:31,790 look at the screen and see some red things there so then I just have to kind 437 00:37:31,790 --> 00:37:42,870 of report the vulnerabilities so yeah so this is basically how you use cert mitum 438 00:37:42,870 --> 00:37:48,410 and after you found these vulnerabilities you can kind of go 439 00:37:48,410 --> 00:37:53,350 check the logs so what this kind of writes we can see the 440 00:37:54,570 --> 00:37:55,090 actual 441 00:37:56,690 --> 00:38:02,990 kind of intercepted connections here we can see the kind of certificates that 442 00:38:02,990 --> 00:38:08,010 were kind of used to intercept these connections so you can just take these 443 00:38:08,010 --> 00:38:14,770 certificates and kind of kind of now is the good part to kind of make your 444 00:38:14,770 --> 00:38:18,450 report to like if you are pen tester then you just say that hey these 445 00:38:18,450 --> 00:38:23,390 connections from this application have these vulnerabilities and this is just a 446 00:38:23,390 --> 00:38:26,550 log that shows kind of when a connection was made by who 447 00:38:26,550 --> 00:38:33,550 and to what and what the test case was and let's take a closer look at the 448 00:38:33,550 --> 00:38:38,630 actual output of cert mitum so here we can see that there are connections that 449 00:38:38,630 --> 00:38:44,850 we couldn't intercept connections that we could intercept and yeah and it shows 450 00:38:44,850 --> 00:38:53,330 here and of what kind of data it can intercept yeah so this was the demo part 451 00:38:56,550 --> 00:39:05,230 and here are some cves kind of all of these were found by cert mitum and there are lots 452 00:39:05,230 --> 00:39:14,690 of lots more coming i found approximately 80 vulnerable applications on different operating 453 00:39:14,690 --> 00:39:21,230 systems like android ios windows mac game consoles iot there are some things that i 454 00:39:21,670 --> 00:39:25,850 do this of course professionally and through bug bounty so there's lots of things that 455 00:39:25,850 --> 00:39:26,370 i can't 456 00:39:26,550 --> 00:39:31,230 show you or talk about but there are some funky things that i've found with 457 00:39:31,230 --> 00:39:38,650 cert mitum there's approximately 40 zero days currently that i know about can 458 00:39:38,650 --> 00:39:43,430 that can be found with this tool so if you go kind of connect your phone cert 459 00:39:43,430 --> 00:39:48,870 mitum i guarantee you kind of from this audience there will be kind of 460 00:39:49,730 --> 00:39:53,930 vulnerabilities found so maybe the airplane mode goes on now 461 00:39:56,050 --> 00:40:01,610 mostly these zero days are from kind of not so big applications some games kind of 462 00:40:01,610 --> 00:40:05,950 not that's kind of important stuff but i think the biggest thing about certain 463 00:40:05,950 --> 00:40:11,750 ¿is this the scale on how many vulnerabilities and of are found with 464 00:40:11,750 --> 00:40:17,390 this and some fixes rolling out in the coming weeks i've had so many emails 465 00:40:17,390 --> 00:40:23,430 yesterday and this kind of today morning from the bigger players that hey we have fixed скорее test 466 00:40:23,430 --> 00:40:23,910 this 467 00:40:23,930 --> 00:40:32,530 So I think kind of telling them that you are going to Defcon to talk about the tool really helps motivate developers to create some fixes. 468 00:40:38,810 --> 00:40:41,510 And yeah, more vulnerabilities found every week. 469 00:40:41,710 --> 00:40:43,230 I found one this morning. 470 00:40:47,790 --> 00:40:50,870 But yeah, so what can you do about this? 471 00:40:53,150 --> 00:41:06,210 So if you are a developer developing applications using TLS, so pretty much any developer of any application, you really should read the documentation of the libraries that you are using. 472 00:41:06,550 --> 00:41:14,870 For example, Python's SSL documentation has this kind of big red box right on the top that says, hey, please don't do these things. 473 00:41:15,550 --> 00:41:17,530 And you might want to check that. 474 00:41:17,570 --> 00:41:19,310 Are you kind of doing those things? 475 00:41:20,270 --> 00:41:20,830 And. 476 00:41:20,870 --> 00:41:22,950 And no custom certificate validators. 477 00:41:23,550 --> 00:41:29,010 If I ever see a customer with custom certificate validators, they will kind of hear from it. 478 00:41:29,750 --> 00:41:33,950 And the reason is that the built-in validators, they support everything you need. 479 00:41:34,170 --> 00:41:42,330 Like I've never seen a real use case that wasn't supported by the actual validators built in to that kind of like languages or whatever. 480 00:41:43,570 --> 00:41:50,790 And there most likely is a reason that if it's not supported, like you, there's kind of. 481 00:41:50,870 --> 00:41:53,270 There's a reason why it's not supported, like you shouldn't do that. 482 00:41:53,530 --> 00:41:55,910 There's most likely a vulnerability in there. 483 00:41:57,500 --> 00:42:00,270 One big thing is checking the hostname of the certificate. 484 00:42:01,020 --> 00:42:05,230 If you use OpenSSL, WolfSSL, you really need to check the hostname. 485 00:42:05,840 --> 00:42:14,330 You kind of, you just need to enable that check and you need to do it every time you initialize and kind of SSL context. 486 00:42:14,770 --> 00:42:20,450 So if you have kind of used OpenSSL, you have done some TLS connections. 487 00:42:21,270 --> 00:42:25,790 Kind of have you enabled hostname validation? 488 00:42:26,850 --> 00:42:27,510 Maybe not. 489 00:42:28,330 --> 00:42:30,490 At least that Windows didn't. 490 00:42:32,750 --> 00:42:35,790 There are some kind of, you can create some unit test for this. 491 00:42:35,950 --> 00:42:42,930 So there's this website called BadSSL that there are these kind of similar certificates hosted online. 492 00:42:43,210 --> 00:42:46,650 So you can just kind of make your application connect to there. 493 00:42:46,950 --> 00:42:48,430 And if it's a. 494 00:42:49,230 --> 00:42:49,710 Uh. 495 00:42:50,450 --> 00:42:57,110 Like if your application accepts a bad as bad SSL certificate, then kind of the test should fail. 496 00:42:57,990 --> 00:43:04,190 And of course, setting up cert mitem in your kind of workplace, run everything through it. 497 00:43:04,290 --> 00:43:06,910 See if it finds something and then fix it. 498 00:43:08,650 --> 00:43:11,990 Otherwise you might be getting a lot of bug bounty reports soon. 499 00:43:14,570 --> 00:43:17,090 And bug bounty hunters, pen testers. 500 00:43:17,550 --> 00:43:20,230 So for you just run cert mitem. 501 00:43:20,450 --> 00:43:21,030 Against everything. 502 00:43:21,230 --> 00:43:22,150 It's really easy to use. 503 00:43:22,390 --> 00:43:25,970 I have my kind of dedicated laptop for it. 504 00:43:26,170 --> 00:43:27,910 It always is kind of hosting. 505 00:43:28,310 --> 00:43:29,830 It has ethernet connectivity. 506 00:43:30,070 --> 00:43:31,210 It has wifi. 507 00:43:31,570 --> 00:43:36,190 So I just need to connect something to it and it will show me in couple of minutes. 508 00:43:36,330 --> 00:43:37,510 Is it vulnerable or not? 509 00:43:40,010 --> 00:43:41,810 So you run it against everything. 510 00:43:41,990 --> 00:43:44,610 You find some vulnerabilities and you make some profit. 511 00:43:45,930 --> 00:43:48,570 So yes, you can run it against everything. 512 00:43:48,870 --> 00:43:49,310 It's. 513 00:43:49,310 --> 00:43:53,410 Quite reliable, nothing has kind of broken horribly. 514 00:43:53,650 --> 00:43:59,070 Sometimes the applications crash and the thing reboots, but it only does it a couple of times. 515 00:43:59,190 --> 00:44:04,710 And then the tests go through, you will definitely find vulnerabilities. 516 00:44:06,930 --> 00:44:10,350 And the profit part is this little bit of yes and no. 517 00:44:12,670 --> 00:44:14,190 So let's first talk about the yes. 518 00:44:14,590 --> 00:44:18,970 So decrypting someone's TLS is. 519 00:44:19,310 --> 00:44:20,150 Kind of a big thing. 520 00:44:21,050 --> 00:44:25,270 So if you kind of hack something really important, you will get a lot of money. 521 00:44:26,550 --> 00:44:27,970 And this is kind of. 522 00:44:30,630 --> 00:44:37,090 So these are everything found by cert mitem, me reporting them, and this is the reply. 523 00:44:40,310 --> 00:44:48,890 The no part is that, uh, this kind of man in the middle attacks are kind of, kind of people. 524 00:44:48,890 --> 00:44:57,910 People don't like them for some reason, kind of some vendors are not worried about connecting to insecure Wi-Fi. 525 00:45:00,750 --> 00:45:01,570 Same with this. 526 00:45:01,830 --> 00:45:05,310 I tried to kind of not include the word man in the middle. 527 00:45:05,370 --> 00:45:09,730 I just said, Hey, we need to do DNS kind of attacks to kind of get this. 528 00:45:10,090 --> 00:45:16,250 And still the answer is like, like if you need to do some kind of DNS attacks, then this is out of scope. 529 00:45:16,890 --> 00:45:18,530 But how many people here kind of. 530 00:45:18,530 --> 00:45:29,130 Trust their DNS, like it's kind of universally kind of not that well, at least in some countries, you might not really get that good DNS replies. 531 00:45:31,830 --> 00:45:34,250 And this was kind of a really funny one. 532 00:45:34,610 --> 00:45:39,630 So this is not a vulnerability because TLS best practices are out of scope. 533 00:45:40,510 --> 00:45:40,990 So. 534 00:45:44,790 --> 00:45:48,150 Um, well, yeah, this might not be kind of a. 535 00:45:48,230 --> 00:45:48,510 Well, yeah, this might not be kind of a. 536 00:45:48,530 --> 00:45:51,850 When they say that TLS best practices are out of scope, they might not mean this. 537 00:45:53,910 --> 00:45:57,910 And then some vendors don't really have any idea what's going on. 538 00:45:58,570 --> 00:46:03,550 So this one is saying that the issue is in kind of the cloud provider. 539 00:46:03,750 --> 00:46:13,610 So AWS or whatever kind of they are that TLS server, like it's not our code and I'm checking their client application. 540 00:46:13,970 --> 00:46:16,110 So it is their code layer. 541 00:46:16,290 --> 00:46:17,750 And the problem is that. 542 00:46:18,930 --> 00:46:25,630 When they're kind of bug bounty programs, kind of if they want to give you negative points, they can. 543 00:46:25,990 --> 00:46:29,890 And if you go see my hacker one reputation, it's not that good. 544 00:46:30,210 --> 00:46:36,270 So I have quite many kind of not applicables or out of scopes and these kind of things. 545 00:46:36,430 --> 00:46:38,870 So I just try to do the good thing and report it. 546 00:46:39,930 --> 00:46:43,030 And but yeah, sometimes I get these. 547 00:46:45,370 --> 00:46:48,510 So I think my main thing is for the platform. 548 00:46:48,510 --> 00:46:53,670 So I think my main thing is for the platforms themselves, so many of the middle and TLS are out of scope in most programs. 549 00:46:53,870 --> 00:47:02,810 So there is this kind of default thing that says that TLS and man in the middle attacks are out of scope, but they are mostly written for web application targets in mind. 550 00:47:03,190 --> 00:47:09,590 So if you have a server kind of man in the middle is not that critical because you kind of don't control the client. 551 00:47:09,970 --> 00:47:13,690 So it's a user's responsibility to have a client that connects securely. 552 00:47:14,650 --> 00:47:17,250 And also like TLS, TLS servers. 553 00:47:17,370 --> 00:47:18,230 They don't do that. 554 00:47:18,330 --> 00:47:18,390 Out. 555 00:47:18,390 --> 00:47:22,470 Identification part usually, so they only do the encryption and the encryption is quite good. 556 00:47:22,970 --> 00:47:28,630 So that's why problems in TLS are usually not problems, and that's why they are out of scope. 557 00:47:30,050 --> 00:47:39,270 But for client applications, these triages, they refuse to accept these kind of reports from certainty. 558 00:47:41,870 --> 00:47:43,790 And the list of no's. 559 00:47:43,930 --> 00:47:45,050 So they were at the four no's. 560 00:47:45,230 --> 00:47:47,370 Three of them actually paid me a bounty. 561 00:47:47,370 --> 00:47:54,510 After kind of some back and forth, me explaining that, hey, this might not be what you mean by kind of TLS best practices. 562 00:47:56,770 --> 00:48:11,470 So I propose if you run a kind of bug bounty program and you have TLS clients, you might want to include that at least for the clients insecure certificate validation should be in scope when impact can be demonstrated. 563 00:48:11,990 --> 00:48:16,530 So this is just or then just make this that, hey, this is out of scope. 564 00:48:16,650 --> 00:48:17,230 So then. 565 00:48:17,370 --> 00:48:19,730 I won't kind of bother myself to report it. 566 00:48:23,370 --> 00:48:25,470 These TLS library developers. 567 00:48:25,770 --> 00:48:42,370 So we had in the beginning this kind of publication, the most dangerous code in the world, and it was written in 2012, and it has this kind of conclusion was that future research is needed for these three things. 568 00:48:42,590 --> 00:48:47,350 So the first one, we need a better black box testing tool. 569 00:48:47,350 --> 00:48:51,650 To discover errors in TLS connection establishment logic. 570 00:48:51,870 --> 00:48:52,930 So this is cert mythem. 571 00:48:53,090 --> 00:49:03,290 So 11 years later, we have successfully done the first thing, the second and the third things, however, kind of still bad. 572 00:49:03,630 --> 00:49:11,650 And I'm hoping with the release of cert mythem, these might get more kind of, we can then move on to the second and the third point. 573 00:49:13,530 --> 00:49:16,270 So this is basically just make better libraries. 574 00:49:16,270 --> 00:49:17,970 It's really hard to use them. 575 00:49:18,030 --> 00:49:21,930 There are so many vulnerabilities because they are super hard to use. 576 00:49:22,430 --> 00:49:23,970 So please make them better. 577 00:49:25,690 --> 00:49:28,950 And with that, we had cert mythem. 578 00:49:29,390 --> 00:49:31,150 You can find it in my GitHub. 579 00:49:31,390 --> 00:49:32,110 There's the link. 580 00:49:32,530 --> 00:49:38,330 It's up there right now and go use it and make the world a better place. 581 00:49:39,950 --> 00:49:40,390 Yeah. 582 00:49:49,250 --> 00:49:55,430 So you can find me here at Defcon, at Nixoo, at LinkedIn, at Bug Bounty. 583 00:49:55,610 --> 00:50:02,690 And if you have any questions, I'm available here next to the stage after this is done. 584 00:50:02,790 --> 00:50:04,150 So pretty much now. 585 00:50:04,270 --> 00:50:04,950 Thank you.