1 00:00:00,000 --> 00:00:02,060 Hello, and welcome to Deciphering Captcha. 2 00:00:02,320 --> 00:00:07,680 My name is Michael Brooks, and in this talk I'll be discussing two of my automated captcha solvers' work. 3 00:00:08,080 --> 00:00:14,780 These two attacks have been identified by CVE-2008-2020 and CVE-2008-2019. 4 00:00:15,460 --> 00:00:20,820 The name of this talk is Deciphering Captcha, but I do not consider captcha to be a cryptographic primitive. 5 00:00:21,220 --> 00:00:25,100 Although there are similarities between the two, I'm using the word decipher as 6 00:00:25,100 --> 00:00:28,980 to make out the meaning of despite the indistinctness or obscurity. 7 00:00:29,720 --> 00:00:34,900 My biggest motivation for giving this talk is in reaction to how poorly documented captcha solvers are. 8 00:00:35,100 --> 00:00:40,520 I can think of no other widely used security system with so much misinformation associated with it. 9 00:00:40,820 --> 00:00:46,240 One of the effects of this misinformation is the widespread use of weak captchas on the Internet today. 10 00:00:46,800 --> 00:00:51,860 Before making my research public, I could only find a single CVE that was actually solving a Turing test. 11 00:00:52,160 --> 00:00:55,520 This is CVE-2007-3308. 12 00:00:55,740 --> 00:00:58,820 Instead, the clear majority of CVEs against captcha 13 00:00:58,980 --> 00:01:00,740 have been taking advantage of implementation. 14 00:01:04,180 --> 00:01:07,440 The first captcha we'll be looking at is CVE-2008-2020. 15 00:01:08,680 --> 00:01:11,200 This captcha is the one used by phpnuke. 16 00:01:11,720 --> 00:01:15,400 If you want, you can go to phpnuke.org and see it. 17 00:01:15,480 --> 00:01:19,120 They're still vulnerable to this day, even though I reported this flaw back in April. 18 00:01:22,880 --> 00:01:25,460 Computers are great at performing lots of permutations. 19 00:01:25,900 --> 00:01:27,020 And they're only going to... 20 00:01:31,920 --> 00:01:40,920 The number of the possible permutations for this captcha is 10 to the sixth, which is exactly 1 million. 21 00:01:41,960 --> 00:01:44,720 As an attacker, we want to inverse the captcha function. 22 00:01:45,040 --> 00:01:52,200 To do this, we must utilize the very code used to build the captcha to build a lookup table of all possible corresponding outputs. 23 00:01:53,140 --> 00:01:57,640 The input to this capture is the answer and the output is the challenge image. 24 00:01:58,360 --> 00:01:58,960 It needs to be executed as a one-time phone call and a one-time call at the same time. 25 00:01:58,960 --> 00:02:04,320 Instead of storing the entire image outputted from the CAPTCHA function, I'm storing just the message digest. 26 00:02:05,180 --> 00:02:10,340 Using this method, I'm able to use less disk space for building a very large lookup table. 27 00:02:10,720 --> 00:02:16,020 And also, lookup time is considerably less for storing the entire image. 28 00:02:16,680 --> 00:02:20,660 The ability to use MD5 allows me to use Rainbow Crack. 29 00:02:20,820 --> 00:02:21,880 But this is key. 30 00:02:22,120 --> 00:02:25,540 You can't use Rainbow Crack on breaking all CAPTCHAs. 31 00:02:25,540 --> 00:02:31,600 Only this specific CAPTCHA, because it is a one-to-one function in the mathematical sense of the word. 32 00:02:32,290 --> 00:02:38,920 If you start introducing more randomized data to the CAPTCHA, it no longer becomes a function. 33 00:02:39,140 --> 00:02:46,800 And that one answer will have many challenge images relating to it. 34 00:02:50,280 --> 00:02:53,120 However, even though you're adding randomized data, 35 00:02:53,220 --> 00:02:55,380 no matter how much randomized data you're adding, 36 00:02:55,540 --> 00:02:58,080 it can still be reversed. 37 00:02:58,420 --> 00:03:01,200 You can iterate through all of the random call functions, 38 00:03:01,400 --> 00:03:04,120 producing every possible combination. 39 00:03:05,360 --> 00:03:06,540 In fact, the phrase 40 00:03:06,540 --> 00:03:10,380 completely automated Turing test to tell computers and humans apart 41 00:03:10,380 --> 00:03:11,920 is a logic error. 42 00:03:12,300 --> 00:03:16,500 If you have code to build a completely automated test, 43 00:03:16,740 --> 00:03:20,420 then you can use that code to build a table of all possible solutions. 44 00:03:22,460 --> 00:03:24,640 Now, this is a laborious process. 45 00:03:24,860 --> 00:03:25,520 However, it doesn't mean that it's a good idea to build a table of all possible solutions. 46 00:03:25,520 --> 00:03:26,780 It doesn't require much technical ability. 47 00:03:31,620 --> 00:03:34,420 Now, in the case where you don't have the source code, 48 00:03:34,840 --> 00:03:39,240 in fact, paypal.com, right now, if you go to sign up for a PayPal account, 49 00:03:39,500 --> 00:03:41,020 they're using a very similar CAPTCHA. 50 00:03:41,160 --> 00:03:46,720 It doesn't contain randomized data other than the actual message. 51 00:03:46,920 --> 00:03:48,480 Unfortunately, I'm unable to show it to you. 52 00:03:48,820 --> 00:03:50,220 But using a CAPTCHA like this, 53 00:03:51,040 --> 00:03:54,340 the largest number of calculations 54 00:03:55,520 --> 00:03:56,560 is 36 to the 5, 55 00:03:56,800 --> 00:04:02,100 which is 60,466,176 possible combinations. 56 00:04:03,020 --> 00:04:05,480 Now, it's taken many man hours to complete this. 57 00:04:06,140 --> 00:04:09,720 But PayPal suffers from another issue. 58 00:04:10,040 --> 00:04:11,560 By refreshing the login page, 59 00:04:11,780 --> 00:04:13,720 a new CAPTCHA will be given. 60 00:04:14,200 --> 00:04:15,880 So, by building a smaller table, 61 00:04:16,100 --> 00:04:18,900 you can still break them 62 00:04:18,900 --> 00:04:21,400 by asking for another challenge, 63 00:04:21,560 --> 00:04:22,440 another CAPTCHA challenge. 64 00:04:24,240 --> 00:04:24,840 Instumation. 65 00:04:25,520 --> 00:04:27,420 Every open source CAPTCHA 66 00:04:27,420 --> 00:04:30,540 is vulnerable to a permutation attack. 67 00:04:31,100 --> 00:04:33,240 Permutation attack against CAPTCHAs 68 00:04:33,240 --> 00:04:36,220 are recognized by my CVE 2008-2020. 69 00:04:36,980 --> 00:04:38,600 To protect my company, 70 00:04:38,800 --> 00:04:41,260 I had to implement reCAPTCHA, 71 00:04:42,100 --> 00:04:44,120 reCAPTCHA.net, which is a free service. 72 00:04:44,480 --> 00:04:46,320 It's a closed source CAPTCHA 73 00:04:46,320 --> 00:04:48,240 that is developed by Louis von Ahn, 74 00:04:48,320 --> 00:04:50,860 who conducts very provocative research. 75 00:04:52,020 --> 00:04:53,740 A large number of man hours 76 00:04:53,740 --> 00:04:55,500 are wasted solving CAPTCHAs each year. 77 00:04:56,800 --> 00:04:59,340 reCAPTCHA harnesses the power of human computation 78 00:04:59,340 --> 00:05:00,720 to digitize books, 79 00:05:00,940 --> 00:05:02,000 which betters all of humanity. 80 00:05:02,440 --> 00:05:04,240 I feel privileged to live in a time 81 00:05:04,240 --> 00:05:06,640 where organized book burnings 82 00:05:06,640 --> 00:05:07,520 such that of the Nazis 83 00:05:07,520 --> 00:05:09,060 and extremist religious groups 84 00:05:09,060 --> 00:05:10,080 can no longer cause harm. 85 00:05:11,620 --> 00:05:13,440 The next CAPTCHA is more interesting. 86 00:05:14,000 --> 00:05:15,300 The CAPTCHA attack is more interesting. 87 00:05:15,660 --> 00:05:17,400 The attack is much more complex. 88 00:05:18,880 --> 00:05:21,880 This attack is 2008-2019. 89 00:05:22,580 --> 00:05:25,200 It is an audio CAPTCHA built for the simple machines, 90 00:05:25,200 --> 00:05:25,360 but it is not a CAPTCHA built for machines. 91 00:05:26,400 --> 00:05:28,340 A CAPTCHA solver was created 92 00:05:28,340 --> 00:05:30,080 for an earlier version of this CAPTCHA, 93 00:05:30,140 --> 00:05:34,280 and it is identified by CVE 2008-3308, 94 00:05:34,360 --> 00:05:38,100 which is the only other CVE regarding CAPTCHAs. 95 00:05:38,860 --> 00:05:40,780 To address this security issue, 96 00:05:40,920 --> 00:05:42,540 simple machine form developers 97 00:05:42,920 --> 00:05:44,400 added noise to the audio file. 98 00:05:45,220 --> 00:05:48,720 Two major components to decipher the signal are... 99 00:05:48,720 --> 00:05:51,140 I used two major components 100 00:05:51,140 --> 00:05:53,720 in order to decipher the signal despite the noise. 101 00:05:55,200 --> 00:05:57,280 The first component is a Hamming distance. 102 00:05:58,860 --> 00:06:04,400 This is named after Bell Labs researcher Richard Hamming. 103 00:06:04,500 --> 00:06:05,940 Hamming distance was introduced 104 00:06:05,940 --> 00:06:07,440 in the fundamental paper entitled 105 00:06:08,020 --> 00:06:11,060 Error Detecting and Error Correcting Codes in 1950. 106 00:06:12,100 --> 00:06:15,580 A Hamming distance measures the noise between two signals 107 00:06:15,580 --> 00:06:16,940 that should otherwise be identical. 108 00:06:18,700 --> 00:06:20,420 Hamming weight analysis of bits 109 00:06:20,420 --> 00:06:21,720 is used in several disciplines, 110 00:06:21,900 --> 00:06:24,080 including information theory, cryptography, 111 00:06:24,080 --> 00:06:25,780 bioinformatics, and genetics. 112 00:06:26,240 --> 00:06:29,340 It is the fundamental algorithm used 113 00:06:29,340 --> 00:06:32,560 to compare fingerprints and iris scanners 114 00:06:32,780 --> 00:06:35,220 for authentication. 115 00:06:35,740 --> 00:06:38,860 It is also used in optical character recognition software 116 00:06:38,860 --> 00:06:39,680 like Tesseract. 117 00:06:41,160 --> 00:06:44,400 I obtained the Hamming distance function 118 00:06:44,400 --> 00:06:46,740 implemented in PHP from the open source project 119 00:06:46,740 --> 00:06:48,400 PHP for Bioinformatics. 120 00:06:48,720 --> 00:06:51,160 This project is performing Hamming distance calculations 121 00:06:51,160 --> 00:06:52,560 on sequences of DNA. 122 00:06:54,080 --> 00:06:56,320 The other component in this capture attack 123 00:06:56,320 --> 00:06:57,240 is fuzzy logic, 124 00:06:57,900 --> 00:07:00,000 which is a tool used in artificial intelligence. 125 00:07:00,340 --> 00:07:02,500 In short, fuzzy logic is a range of truth 126 00:07:02,500 --> 00:07:03,800 between 0 and 1. 127 00:07:04,300 --> 00:07:05,940 Fuzzy logic is being used today 128 00:07:05,940 --> 00:07:08,040 in places such as washing machines 129 00:07:08,040 --> 00:07:10,060 to tell you how dirty your laundry is 130 00:07:10,060 --> 00:07:12,920 and in dryers to tell you how dry it is. 131 00:07:16,320 --> 00:07:18,460 Using these two elements together alone, 132 00:07:18,660 --> 00:07:22,720 just by performing a Hamming distance calculation 133 00:07:22,720 --> 00:07:25,420 on the very beginning of a file, 134 00:07:25,520 --> 00:07:26,780 I was able to find the first letter. 135 00:07:27,000 --> 00:07:29,000 At this point, I was absolutely ecstatic. 136 00:07:29,160 --> 00:07:30,500 I was jumping up and down, 137 00:07:30,660 --> 00:07:32,000 and I had broken. 138 00:07:32,120 --> 00:07:34,640 I had broken a capture using these systems. 139 00:07:35,060 --> 00:07:37,140 It was only the first letter. 140 00:07:39,580 --> 00:07:41,340 In order to find the other letters, 141 00:07:42,220 --> 00:07:44,200 it was proving to be more difficult. 142 00:07:45,640 --> 00:07:49,060 The ability to find the spaces between letters 143 00:07:49,060 --> 00:07:50,180 was difficult. 144 00:07:51,420 --> 00:07:55,320 There are methods, 145 00:07:55,480 --> 00:07:56,660 but it was very heavy. 146 00:07:56,740 --> 00:07:57,760 Very heavy calculations. 147 00:07:59,620 --> 00:08:01,180 I did find, however, 148 00:08:01,240 --> 00:08:02,280 a problem with the capture. 149 00:08:02,520 --> 00:08:03,560 After each letter, 150 00:08:03,660 --> 00:08:08,600 there is 5600 bytes minimum space 151 00:08:08,600 --> 00:08:09,540 between each letter. 152 00:08:09,860 --> 00:08:11,460 After finding the first letter, 153 00:08:11,560 --> 00:08:13,620 I would skip ahead 5600 bytes. 154 00:08:19,380 --> 00:08:25,600 There is a problem with Hamming distances, 155 00:08:25,780 --> 00:08:28,360 or at least it's an implementation issue. 156 00:08:31,400 --> 00:08:33,940 In order to perform a Hamming distance calculation, 157 00:08:34,400 --> 00:08:36,640 both strings must be of the exact same size. 158 00:08:37,560 --> 00:08:39,600 In order to identify a letter, 159 00:08:39,760 --> 00:08:41,680 I must know exactly where it is, 160 00:08:41,760 --> 00:08:42,600 where it starts. 161 00:08:42,600 --> 00:08:44,620 And even where it ends. 162 00:08:46,620 --> 00:08:48,940 The solution I came was to run 163 00:08:48,940 --> 00:08:50,660 a whole lot of Hamming distance calculations. 164 00:08:51,080 --> 00:08:53,220 I'm running literally thousands of them. 165 00:08:53,640 --> 00:08:56,780 In order to solve about one capture, 166 00:08:56,860 --> 00:08:59,800 it takes about 14,000 Hamming distance calculations. 167 00:09:00,280 --> 00:09:02,520 Luckily, these are very cheap. 168 00:09:02,560 --> 00:09:03,340 Very cheap calculations. 169 00:09:04,640 --> 00:09:07,700 There are other tools for performing 170 00:09:07,700 --> 00:09:12,020 fuzzy comparisons on strings. 171 00:09:12,020 --> 00:09:13,980 One of them is called the Livingston distance. 172 00:09:14,780 --> 00:09:17,440 It doesn't suffer from the same shortcomings as Hamming. 173 00:09:17,580 --> 00:09:19,880 You can perform Livingston distance calculations 174 00:09:19,880 --> 00:09:21,860 on two strings of different sizes. 175 00:09:22,300 --> 00:09:24,060 It's able to identify 176 00:09:27,980 --> 00:09:30,400 comparisons despite transpositions of data, 177 00:09:30,560 --> 00:09:31,700 or moving data around, 178 00:09:31,860 --> 00:09:33,080 or injections of large data. 179 00:09:35,060 --> 00:09:35,620 Unfortunately, 180 00:09:35,900 --> 00:09:37,780 Livingston distance calculations 181 00:09:37,780 --> 00:09:38,880 are extremely heavy. 182 00:09:38,880 --> 00:09:41,500 Performing a calculation on only a few kilobytes of data 183 00:09:41,500 --> 00:09:43,020 will require gigabytes of memory. 184 00:09:44,600 --> 00:09:47,160 Livingston distances are being used in audio processing. 185 00:09:47,480 --> 00:09:48,800 As an example, there is 186 00:09:48,800 --> 00:09:51,980 U.S. patent 6073099 187 00:09:51,980 --> 00:09:52,860 entitled 188 00:09:52,860 --> 00:09:54,740 Predicting Auditory Confusions 189 00:09:54,740 --> 00:09:56,940 Using Weighted Livingston Distances. 190 00:09:59,580 --> 00:10:02,280 The great Alan Turing is the creator of the Turing test, 191 00:10:02,580 --> 00:10:05,200 and where CAPTCHA gets its name. 192 00:10:06,040 --> 00:10:08,800 Turing himself believed this test would eventually 193 00:10:08,880 --> 00:10:09,600 become obsolete. 194 00:10:09,900 --> 00:10:12,080 In 30 years, it would be as easy to ask 195 00:10:13,660 --> 00:10:14,940 a computer a question 196 00:10:14,940 --> 00:10:15,900 Excuse me. 197 00:10:17,300 --> 00:10:18,500 In 30 years, 198 00:10:18,660 --> 00:10:20,840 it will be as easy to ask 199 00:10:20,840 --> 00:10:22,400 a computer a question 200 00:10:22,400 --> 00:10:23,640 as to ask a person. 201 00:10:23,900 --> 00:10:25,680 This is Alan Turing in 1946. 202 00:10:28,200 --> 00:10:29,320 Well, clearly, 203 00:10:30,260 --> 00:10:31,940 that is not the case. 204 00:10:32,100 --> 00:10:33,920 However, I believe that 205 00:10:34,480 --> 00:10:35,900 this eventually will happen. 206 00:10:37,980 --> 00:10:38,860 The CAPTCHA 207 00:10:38,880 --> 00:10:42,060 CAPTCHAs will eventually become obsolete. 208 00:10:42,420 --> 00:10:45,020 Many attacks in software are becoming obsolete, 209 00:10:45,240 --> 00:10:45,860 and so are defenses. 210 00:10:46,380 --> 00:10:48,700 Information security is an ever-changing landscape, 211 00:10:48,840 --> 00:10:50,500 and I don't believe it will ever come to an end. 212 00:10:50,760 --> 00:10:53,180 After 3.5 billion years of evolution, 213 00:10:53,580 --> 00:10:55,580 organisms have become incredibly adept 214 00:10:55,580 --> 00:10:57,140 at defending themselves from viral attack. 215 00:10:58,420 --> 00:11:00,040 Even with the incredible capability 216 00:11:00,040 --> 00:11:01,280 of the human immune system, 217 00:11:01,440 --> 00:11:03,440 we still suffer from many methods of code execution. 218 00:11:03,980 --> 00:11:05,380 These virons are in the room, 219 00:11:05,460 --> 00:11:07,140 pumping through your bloodstream as I speak. 220 00:11:07,140 --> 00:11:09,480 New methods of attacking software 221 00:11:09,480 --> 00:11:10,500 are developed constantly. 222 00:11:11,360 --> 00:11:13,260 Software that was once believed to be secure 223 00:11:13,260 --> 00:11:15,100 can in fact be extremely vulnerable 224 00:11:15,100 --> 00:11:15,700 to new attacks. 225 00:11:16,080 --> 00:11:18,000 For instance, the format string vulnerability 226 00:11:18,000 --> 00:11:19,740 was discovered less than a decade ago, 227 00:11:19,920 --> 00:11:22,220 and more recently, the dangling pointer attack 228 00:11:22,220 --> 00:11:23,920 presented at Black Hat only last year. 229 00:11:25,540 --> 00:11:26,380 Programmers are human, 230 00:11:26,520 --> 00:11:27,380 and we must make assumptions 231 00:11:27,380 --> 00:11:29,340 about how our code will be used. 232 00:11:29,580 --> 00:11:31,120 We cannot foresee every condition 233 00:11:31,120 --> 00:11:32,520 that our code will encounter. 234 00:11:32,520 --> 00:11:34,660 I enjoy that journey into the unknown 235 00:11:34,660 --> 00:11:36,320 and the fruits of my labor of love. 236 00:11:45,960 --> 00:11:46,400 Unfortunately... 237 00:11:51,900 --> 00:11:53,820 My talk would have ran a bit longer 238 00:11:53,820 --> 00:11:55,880 due to my presentation materials. 239 00:11:56,100 --> 00:11:57,400 I'll try and get them working. 240 00:11:57,620 --> 00:11:58,580 Or the visuals. 241 00:11:59,100 --> 00:12:00,440 I'll try and get that working. 242 00:12:00,440 --> 00:12:02,720 The code I have for both of these captures 243 00:12:02,720 --> 00:12:03,920 are available on my website. 244 00:12:05,660 --> 00:12:08,080 The X-Play code is available for both of these. 245 00:12:08,140 --> 00:12:09,260 I encourage you to download them. 246 00:12:10,500 --> 00:12:12,500 Particularly, the code is not very complex. 247 00:12:12,840 --> 00:12:14,080 I think you'll be surprised 248 00:12:14,080 --> 00:12:17,040 on how simple it took to break some of these systems. 249 00:12:18,020 --> 00:12:19,700 I think that's a sign of elegance. 250 00:12:22,380 --> 00:12:25,420 I encourage more research in the area of captures 251 00:12:25,420 --> 00:12:27,040 and people to be open. 252 00:12:27,660 --> 00:12:30,420 I find it unfortunate that many people 253 00:12:30,420 --> 00:12:33,320 keep these methods secretive, 254 00:12:33,320 --> 00:12:36,400 and that they're... 255 00:12:37,120 --> 00:12:38,480 Yeah, it's unfortunate. 256 00:12:43,200 --> 00:12:44,400 Oh, yeah. 257 00:12:44,720 --> 00:12:47,040 My materials are on my website, 258 00:12:47,220 --> 00:12:48,540 rookssecurity.com. 259 00:12:49,840 --> 00:12:51,680 I'll have updated materials as well. 260 00:12:52,180 --> 00:12:53,580 Oh, X-Play code is also available 261 00:12:53,580 --> 00:12:54,400 on the DEF CON CD 262 00:12:55,220 --> 00:12:56,500 for both of these attacks. 263 00:12:57,780 --> 00:12:58,380 Um... 264 00:12:59,140 --> 00:13:00,340 Let's see it in action. 265 00:13:10,820 --> 00:13:11,380 Aha! 266 00:13:13,400 --> 00:13:14,120 All right. 267 00:13:17,040 --> 00:13:18,120 Okay, okay. 268 00:13:18,320 --> 00:13:18,780 Sorry. 269 00:13:18,940 --> 00:13:20,020 I do apologize. 270 00:13:21,080 --> 00:13:21,800 All right. 271 00:13:22,800 --> 00:13:25,700 This is the PHP new captcha. 272 00:13:25,840 --> 00:13:26,760 As you can see... 273 00:13:31,060 --> 00:13:32,200 Very simple, right? 274 00:13:32,380 --> 00:13:32,840 Very simple. 275 00:13:33,360 --> 00:13:33,740 I can't... 276 00:13:33,740 --> 00:13:34,600 But you would be surprised. 277 00:13:34,960 --> 00:13:36,840 The CVE for this captcha... 278 00:13:36,840 --> 00:13:37,840 People using this captcha 279 00:13:37,840 --> 00:13:40,140 was over a half a dozen software packages, 280 00:13:40,260 --> 00:13:40,800 and there are more. 281 00:13:42,660 --> 00:13:43,100 This... 282 00:13:43,100 --> 00:13:43,980 This is... 283 00:13:43,980 --> 00:13:44,400 Oh. 284 00:13:45,020 --> 00:13:45,460 Oh. 285 00:13:46,540 --> 00:13:47,420 Here, wait a bit. 286 00:13:47,540 --> 00:13:47,980 Hold on. 287 00:13:50,080 --> 00:13:52,040 Now, to build up the lookup table, 288 00:13:52,180 --> 00:13:53,300 I start iterating. 289 00:13:53,360 --> 00:13:54,340 I start at 0, 0, 0. 290 00:13:55,440 --> 00:13:56,680 In the far column, 291 00:13:56,740 --> 00:13:58,580 you see that that is the MD5 hash 292 00:13:58,580 --> 00:13:59,900 of the actual image. 293 00:14:00,160 --> 00:14:01,760 I continue on from 0, 0, 0 294 00:14:01,760 --> 00:14:03,260 all the way to 9, 9, 9. 295 00:14:04,300 --> 00:14:05,200 It's very simple. 296 00:14:08,520 --> 00:14:09,000 Backwards. 297 00:14:09,260 --> 00:14:09,540 All right. 298 00:14:10,340 --> 00:14:12,060 This is actually a one-to-one function, 299 00:14:12,180 --> 00:14:14,800 similar to f of x equals x to the 3. 300 00:14:15,420 --> 00:14:18,920 For every one input of the answer, 301 00:14:18,980 --> 00:14:20,140 there is exactly one output. 302 00:14:21,560 --> 00:14:23,440 Now, so when the function is inverse, 303 00:14:23,600 --> 00:14:24,400 it is still a function. 304 00:14:24,400 --> 00:14:26,080 It is f of x to the... 305 00:14:27,700 --> 00:14:28,720 Well, one-third. 306 00:14:29,140 --> 00:14:29,580 Anyway. 307 00:14:30,520 --> 00:14:33,220 Which is shown by the graph. 308 00:14:33,820 --> 00:14:34,580 Now, if you... 309 00:14:35,220 --> 00:14:39,220 If you inverse a non-one-to-one function, 310 00:14:39,360 --> 00:14:40,840 it no longer becomes a function 311 00:14:41,220 --> 00:14:42,240 in terms of... 312 00:14:42,960 --> 00:14:45,240 For one value of x, there are now... 313 00:14:46,480 --> 00:14:46,920 Yeah. 314 00:14:47,020 --> 00:14:47,820 For one value of x, 315 00:14:47,820 --> 00:14:48,720 there are now two values of y. 316 00:14:50,560 --> 00:14:51,000 So... 317 00:14:52,280 --> 00:14:53,900 Rainbow crack is able to... 318 00:14:54,400 --> 00:14:56,580 Is able to break specifically this capture 319 00:14:56,580 --> 00:14:59,400 because of its one-to-one nature. 320 00:15:01,240 --> 00:15:02,880 Okay. This is the audio capture. 321 00:15:03,180 --> 00:15:04,280 The first... 322 00:15:04,280 --> 00:15:06,300 This is one of the main slides I wanted to show you. 323 00:15:06,720 --> 00:15:07,240 Okay. 324 00:15:07,520 --> 00:15:09,260 The picture you see at the top 325 00:15:09,260 --> 00:15:11,800 is the raw audio file being put together. 326 00:15:11,980 --> 00:15:13,900 This is without the noise. 327 00:15:14,320 --> 00:15:18,160 It runs through a noise subroutine as the patch. 328 00:15:18,500 --> 00:15:20,060 And you see at the bottom. 329 00:15:20,820 --> 00:15:22,220 Actually, picking out... 330 00:15:22,220 --> 00:15:23,460 I mean, at the top slide, 331 00:15:23,460 --> 00:15:25,120 picking out that black space is pretty easy. 332 00:15:25,260 --> 00:15:26,360 I mean, you can do it with a string compare. 333 00:15:26,760 --> 00:15:28,360 But doing it... 334 00:15:28,920 --> 00:15:31,860 It becomes more difficult later on. 335 00:15:32,240 --> 00:15:33,100 Not only... 336 00:15:33,100 --> 00:15:35,540 Not only are the black spaces changed, 337 00:15:35,920 --> 00:15:37,520 but also the wav file... 338 00:15:37,520 --> 00:15:39,540 Each letter themselves are changed. 339 00:15:39,720 --> 00:15:41,760 And we can measure this change using a hemming distance. 340 00:15:43,560 --> 00:15:45,480 And I can show you the exploits. 341 00:15:45,800 --> 00:15:46,480 Right here. 342 00:15:49,360 --> 00:15:49,880 Okay. 343 00:15:52,600 --> 00:15:53,120 Um... 344 00:15:56,120 --> 00:15:57,420 It looks like... 345 00:15:57,420 --> 00:15:57,820 It looks... 346 00:15:57,820 --> 00:15:58,640 It's very simple. 347 00:15:58,820 --> 00:16:01,280 Basically, I just upload the .wav file. 348 00:16:01,860 --> 00:16:03,560 At least the interface is very simple. 349 00:16:03,640 --> 00:16:04,420 It's a PHP file. 350 00:16:05,060 --> 00:16:07,880 I upload the .wav file produced from the image. 351 00:16:08,260 --> 00:16:08,780 Attack. 352 00:16:10,020 --> 00:16:10,540 Attack. 353 00:16:11,460 --> 00:16:12,420 It'll take a while. 354 00:16:14,620 --> 00:16:16,280 This is on a different system. 355 00:16:16,440 --> 00:16:18,340 On my personal machine, 356 00:16:18,520 --> 00:16:20,800 I have, like, a dual-core 2.4 gigahertz. 357 00:16:21,080 --> 00:16:23,440 It'll take around about 14 seconds or so. 358 00:16:23,440 --> 00:16:24,860 To break it. 359 00:16:25,460 --> 00:16:25,700 Um... 360 00:16:25,700 --> 00:16:28,480 The server that I'm using right now isn't as beefy. 361 00:16:29,380 --> 00:16:29,860 Um... 362 00:16:29,860 --> 00:16:30,460 But here... 363 00:16:30,460 --> 00:16:31,040 Oh. 364 00:16:31,480 --> 00:16:32,440 A bit out of order. 365 00:16:32,620 --> 00:16:35,020 This is the captcha used on PayPal's sign-up site right now. 366 00:16:36,420 --> 00:16:37,680 What are you doing? 367 00:16:37,980 --> 00:16:38,460 Why? 368 00:16:38,680 --> 00:16:40,080 Why are you doing that, PayPal? 369 00:16:41,060 --> 00:16:41,540 Like... 370 00:16:43,440 --> 00:16:43,920 It... 371 00:16:45,240 --> 00:16:47,160 It is disconcerting to me 372 00:16:47,160 --> 00:16:51,460 that a financial institution would be using such a weak captcha. 373 00:16:51,960 --> 00:16:52,440 Um... 374 00:16:52,440 --> 00:16:53,320 I... 375 00:16:54,840 --> 00:16:58,580 And then, also, phpnuke.org. 376 00:17:02,620 --> 00:17:03,880 Here's phpnuke.org. 377 00:17:03,960 --> 00:17:05,880 It has been downloaded by, um... 378 00:17:07,320 --> 00:17:09,880 It says 8.35 million downloads. 379 00:17:10,900 --> 00:17:11,660 And look. 380 00:17:11,840 --> 00:17:14,600 And if you see the captcha in the corner, security code, 381 00:17:15,840 --> 00:17:17,060 they're still using my... 382 00:17:17,060 --> 00:17:17,680 And this was... 383 00:17:17,680 --> 00:17:19,800 This exploit code has been available since April. 384 00:17:20,060 --> 00:17:21,440 Yet they have not patched. 385 00:17:21,440 --> 00:17:22,140 I... 386 00:17:23,640 --> 00:17:24,120 Uh... 387 00:17:24,120 --> 00:17:25,640 I'm not sure... 388 00:17:25,640 --> 00:17:27,540 I'm not sure I can't explain that one. 389 00:17:28,020 --> 00:17:28,500 Anyway. 390 00:17:28,900 --> 00:17:29,360 Um... 391 00:17:29,360 --> 00:17:29,680 Okay. 392 00:17:29,760 --> 00:17:31,440 So in this hack, um... 393 00:17:35,920 --> 00:17:36,400 Um... 394 00:17:36,400 --> 00:17:39,660 A total of, uh... 395 00:17:39,660 --> 00:17:43,620 A total of 5,527 hamming distances were used in this attack. 396 00:17:44,740 --> 00:17:45,220 Um... 397 00:17:46,520 --> 00:17:47,000 Uh... 398 00:17:47,520 --> 00:17:48,220 And I... 399 00:17:48,220 --> 00:17:48,560 Here. 400 00:17:48,700 --> 00:17:49,420 I'll pop the code. 401 00:17:49,420 --> 00:17:51,520 I don't know how many of you are programmers. 402 00:17:51,960 --> 00:17:52,420 But, um... 403 00:17:54,040 --> 00:17:54,960 I like the code. 404 00:18:07,140 --> 00:18:07,560 Uh... 405 00:18:07,560 --> 00:18:09,460 In essence... 406 00:18:09,460 --> 00:18:11,800 I don't know. 407 00:18:12,400 --> 00:18:13,020 Two minutes? 408 00:18:13,180 --> 00:18:13,660 Two minutes left? 409 00:18:17,900 --> 00:18:18,320 Hmm. 410 00:18:18,520 --> 00:18:19,080 Oh, well. 411 00:18:19,160 --> 00:18:19,400 So... 412 00:18:20,460 --> 00:18:20,960 Uh... 413 00:18:20,960 --> 00:18:23,380 If you see the code... 414 00:18:24,060 --> 00:18:26,260 I start by loading all of the... 415 00:18:26,260 --> 00:18:26,800 Um... 416 00:18:26,800 --> 00:18:28,720 All of the clean letters into the... 417 00:18:28,720 --> 00:18:29,640 Into, um... 418 00:18:29,640 --> 00:18:30,400 Into memory. 419 00:18:30,900 --> 00:18:31,400 Uh... 420 00:18:31,400 --> 00:18:33,640 And then I began, uh... 421 00:18:34,700 --> 00:18:35,600 On this line here. 422 00:18:38,980 --> 00:18:39,480 Um... 423 00:18:42,220 --> 00:18:44,380 I know that I'm searching for five letters. 424 00:18:44,560 --> 00:18:46,100 And that's what I'm saying right here. 425 00:18:46,240 --> 00:18:47,440 I'm looking for, uh... 426 00:18:47,440 --> 00:18:49,400 After finding five characters, I would like to... 427 00:18:49,400 --> 00:18:50,280 I'd like to, um... 428 00:18:51,300 --> 00:18:51,740 Stop. 429 00:18:52,020 --> 00:18:52,960 I know I've reached the end. 430 00:18:53,520 --> 00:18:53,960 Uh... 431 00:18:53,960 --> 00:18:54,920 Here I'm performing... 432 00:18:54,920 --> 00:18:55,540 Uh... 433 00:18:55,540 --> 00:18:57,380 On this line over here, I'm performing the hamming distance. 434 00:18:57,620 --> 00:18:57,960 Uh... 435 00:18:57,960 --> 00:18:58,180 With... 436 00:18:58,180 --> 00:18:59,400 I found a way to, uh... 437 00:18:59,400 --> 00:19:02,900 Save resources by actually not performing a hamming distance on the entire letter, 438 00:19:02,980 --> 00:19:04,180 but only, uh... 439 00:19:04,180 --> 00:19:05,320 The, um... 440 00:19:05,320 --> 00:19:06,020 First... 441 00:19:06,020 --> 00:19:06,500 Uh... 442 00:19:06,500 --> 00:19:07,140 First three characters. 443 00:19:07,260 --> 00:19:09,560 In this case, the first 512 bytes of the... 444 00:19:10,000 --> 00:19:10,620 Of the file. 445 00:19:11,680 --> 00:19:12,120 Um... 446 00:19:12,800 --> 00:19:13,240 Here. 447 00:19:13,760 --> 00:19:14,200 Um... 448 00:19:14,200 --> 00:19:15,680 Hamming distance... 449 00:19:18,740 --> 00:19:19,380 Hamming distance... 450 00:19:19,400 --> 00:19:20,320 Hamming distance is actually, uh... 451 00:19:20,320 --> 00:19:21,400 A fairly simple calculation. 452 00:19:22,460 --> 00:19:22,980 Um... 453 00:19:22,980 --> 00:19:23,760 Here, uh... 454 00:19:23,760 --> 00:19:24,340 I'll show you... 455 00:19:24,340 --> 00:19:24,880 This is, uh... 456 00:19:24,880 --> 00:19:25,680 Hamming distance... 457 00:19:26,400 --> 00:19:27,680 Shown on, uh... 458 00:19:27,680 --> 00:19:28,620 Just regular words. 459 00:19:28,840 --> 00:19:31,940 For instance, the hamming distance between toned and roses is three. 460 00:19:32,100 --> 00:19:33,020 Where, uh... 461 00:19:33,020 --> 00:19:34,040 Three characters are... 462 00:19:34,040 --> 00:19:34,480 Are different. 463 00:19:34,720 --> 00:19:35,760 And then, uh... 464 00:19:35,760 --> 00:19:37,700 Again, the hamming distance shown between, uh... 465 00:19:37,700 --> 00:19:39,040 Two sequences of binary. 466 00:19:40,580 --> 00:19:41,100 Um... 467 00:19:41,100 --> 00:19:41,980 Um... 468 00:19:41,980 --> 00:19:42,420 So... 469 00:19:42,420 --> 00:19:43,240 Uh... 470 00:19:43,240 --> 00:19:44,200 How the CAPTCHA... 471 00:19:44,200 --> 00:19:44,680 Oh. 472 00:19:44,800 --> 00:19:45,760 This is... 473 00:19:45,760 --> 00:19:46,440 Uh... 474 00:19:46,440 --> 00:19:47,100 Another thing. 475 00:19:47,220 --> 00:19:47,460 If you're... 476 00:19:47,460 --> 00:19:48,240 If you were to use this... 477 00:19:48,240 --> 00:19:48,500 Uh... 478 00:19:48,500 --> 00:19:49,820 A similar attack on another... 479 00:19:49,820 --> 00:19:51,000 On another CAPTCHA... 480 00:19:51,000 --> 00:19:52,380 You must make sure... 481 00:19:53,020 --> 00:19:54,440 That you're comparing... 482 00:19:54,440 --> 00:19:55,200 The, uh... 483 00:19:55,200 --> 00:19:56,480 The raw pulse code modulation. 484 00:19:57,000 --> 00:19:57,560 Uh... 485 00:19:57,560 --> 00:19:59,020 What this means is that... 486 00:19:59,020 --> 00:19:59,520 Uh... 487 00:19:59,520 --> 00:19:59,960 I... 488 00:19:59,960 --> 00:20:00,740 Uh... 489 00:20:00,740 --> 00:20:02,480 The CAPTCHA they're giving to me is a wave. 490 00:20:02,680 --> 00:20:05,940 So it is a raw stream of, uh... 491 00:20:05,940 --> 00:20:06,540 Uh... 492 00:20:06,540 --> 00:20:06,660 Uh... 493 00:20:06,660 --> 00:20:08,800 A digital representation of... 494 00:20:08,800 --> 00:20:09,740 This, uh... 495 00:20:09,740 --> 00:20:10,380 Analog... 496 00:20:10,380 --> 00:20:10,940 Of... 497 00:20:10,940 --> 00:20:11,220 Of... 498 00:20:11,220 --> 00:20:12,400 This analog wave. 499 00:20:13,200 --> 00:20:13,480 Uh... 500 00:20:13,480 --> 00:20:14,880 If you've taken calculus... 501 00:20:14,880 --> 00:20:15,120 Uh... 502 00:20:15,120 --> 00:20:16,460 This looks very similar to a... 503 00:20:16,460 --> 00:20:16,740 Uh... 504 00:20:16,740 --> 00:20:17,440 An integral. 505 00:20:19,300 --> 00:20:19,660 Uh... 506 00:20:21,020 --> 00:20:21,380 Now... 507 00:20:21,380 --> 00:20:22,040 Uh... 508 00:20:22,040 --> 00:20:22,260 Uh... 509 00:20:23,780 --> 00:20:24,140 Um... 510 00:20:24,140 --> 00:20:24,380 So... 511 00:20:24,380 --> 00:20:24,580 Okay. 512 00:20:24,700 --> 00:20:25,220 So if... 513 00:20:25,220 --> 00:20:26,060 If you were to give... 514 00:20:26,060 --> 00:20:26,300 Uh... 515 00:20:26,300 --> 00:20:27,440 Get a challenge response in an... 516 00:20:27,440 --> 00:20:28,660 An MP3, for instance... 517 00:20:28,660 --> 00:20:31,060 You would have to change it to a dot wave before, uh... 518 00:20:31,440 --> 00:20:32,160 Before, uh... 519 00:20:32,160 --> 00:20:32,620 Performing it. 520 00:20:32,780 --> 00:20:33,040 Uh... 521 00:20:33,040 --> 00:20:33,280 Anyway. 522 00:20:33,640 --> 00:20:34,500 My time is done. 523 00:20:34,700 --> 00:20:35,500 I, uh... 524 00:20:36,880 --> 00:20:37,240 I... 525 00:20:37,240 --> 00:20:37,800 I wish the best. 526 00:20:37,900 --> 00:20:38,200 I hope... 527 00:20:38,200 --> 00:20:40,680 I hope that there will be more research in the area of CAPTCHAs. 528 00:20:40,680 --> 00:20:41,820 And people will be open with their research. 529 00:20:42,060 --> 00:20:42,840 Thank you very much. 530 00:20:45,120 --> 00:20:48,120 And have a wonderful day.