1 00:00:00,000 --> 00:00:27,780 What's up? Good afternoon. Thank you for skipping your lunch coming here. So yeah, buying time, what is your data worth? This is an approach to distributed password brute forcing along with some statistical analysis and an approach to giving a real dollar value to your password based on brute force attacking done in a cloud on the internet environment and the cost that is involved in that. 2 00:00:31,160 --> 00:00:52,920 So, all right. Who am I? I'm a member of Chaos Theory and a proud DC404 member. This is our fourth out of seven talks here at DEF CON this year, so we're going to go ahead and assume that we've taken over the con. And we're the largest local DEF CON community group here. At this point, maybe the only. 3 00:00:56,120 --> 00:00:59,720 You know, with DC404, just for a few minutes in case anybody's heard of it. 4 00:01:00,000 --> 00:01:09,900 I worked on Anonymous and SAM I.O. And if anybody is into the depths of the internet, I was also one of the primary contributors to Group Hug. 5 00:01:11,100 --> 00:01:24,280 So, what is this? Distributed password cracking. It's a scalable password cracking solution that will go across multiple machines and at the same time, on each machine, it's a multi-threaded solution. 6 00:01:24,680 --> 00:01:29,780 So, instead of the majority of the password cracking tools that exist now, utilizing a 7 00:01:29,780 --> 00:01:29,980 single password cracking tool, it's a multi-threaded solution. 8 00:01:30,000 --> 00:01:34,920 core in a system with dual and quad core systems becoming more prevalent, this will actually 9 00:01:34,920 --> 00:01:39,300 utilize 100% of the processing power in the box, which gives an order of magnitude in 10 00:01:39,300 --> 00:01:41,180 and of itself in password cracking. 11 00:01:44,000 --> 00:01:45,760 Yeah, there we go. 12 00:01:51,720 --> 00:01:52,560 All right. 13 00:01:53,180 --> 00:01:54,540 Sounds loud enough up here. 14 00:01:57,760 --> 00:02:02,600 In addition to that, it comes with its own level of pretty great level of flexibility 15 00:02:03,420 --> 00:02:04,560 along with some simplicity. 16 00:02:05,020 --> 00:02:09,260 It really can take as an input just about anything you want to feed to it. 17 00:02:09,480 --> 00:02:13,540 Some existing inputs that are going to come with the tool as it's released, obviously 18 00:02:13,540 --> 00:02:19,220 you can send it brute force string, brute force attacks, and then a start and a stop 19 00:02:19,220 --> 00:02:21,180 string and an alphabet to run through. 20 00:02:21,380 --> 00:02:24,440 It can run through a word list, a rainbow table or hash table. 21 00:02:24,540 --> 00:02:26,500 It can also spit out its own output. 22 00:02:26,780 --> 00:02:32,180 In addition to providing an answer, it can provide a rainbow table as output, do some 23 00:02:32,180 --> 00:02:34,280 pre-computing as well. 24 00:02:36,620 --> 00:02:39,040 It's a visual aid for how it works. 25 00:02:39,300 --> 00:02:44,340 Basically, when you feed it the input, you're going to feed it a brute force attack, a dictionary 26 00:02:44,340 --> 00:02:49,460 hat, rainbow table, and it's going to take that as a single large key space or crypt 27 00:02:49,460 --> 00:02:51,540 space and break it into smaller chunks. 28 00:02:51,900 --> 00:02:54,060 Those smaller chunks will get sent out across. 29 00:02:54,540 --> 00:03:00,160 Different servers and then each server will take that chunk of its own, break itself into 30 00:03:00,160 --> 00:03:04,440 smaller chunks, and send those out to the individual threads on the system. 31 00:03:04,680 --> 00:03:09,100 Then the thread will take the chunk and actually process each individual word at a time and 32 00:03:09,100 --> 00:03:11,300 then spit back and ask for another chunk. 33 00:03:11,580 --> 00:03:16,400 That will all roll back up, so if a server finishes its chunk and there's more available, 34 00:03:16,660 --> 00:03:20,380 it will come out, request a second chunk, and just process through the whole thing by 35 00:03:20,380 --> 00:03:24,140 splitting it up into smaller pieces instead of trying to attack it just one word at a time. 36 00:03:26,760 --> 00:03:32,000 Again, just a quick review on the technology, just in case people aren't extremely familiar 37 00:03:32,000 --> 00:03:32,780 with password cracking. 38 00:03:33,480 --> 00:03:39,220 You've got your different algorithms, your MD5, which is the FreeBSD and the more common 39 00:03:39,220 --> 00:03:46,040 Unix-based password hashing, NTLM on the Windows side of the fence, SHA, which is what 40 00:03:46,040 --> 00:03:49,020 WPA2 uses or the CALPADDY2 uses. 41 00:03:50,140 --> 00:03:53,540 Those of course will come with their own different speeds that they can run at. 42 00:03:53,640 --> 00:03:54,520 In addition, you can do a lot of other things. 43 00:03:54,520 --> 00:03:58,100 You can feed it, of course, a brute force dictionary rainbow tables, which is exactly 44 00:03:58,100 --> 00:03:59,760 what your rainbow tables look like right here. 45 00:04:01,700 --> 00:04:05,580 Also one of the things that you run into when you're trying to brute force or crack 46 00:04:05,580 --> 00:04:10,200 a password are the different tools or utilities that people put in place to make it more difficult. 47 00:04:10,760 --> 00:04:16,780 SALT being the one that's most applicable for this tool, largely designed to prevent 48 00:04:16,780 --> 00:04:21,160 you from being able to do a rainbow table or hash-based attack, which is again one of 49 00:04:21,160 --> 00:04:24,500 the reasons why this tool helps reinvigorate that. 50 00:04:24,500 --> 00:04:30,520 When a rainbow table isn't a solution because of SALT, like on an MD5 password, you're left 51 00:04:30,520 --> 00:04:36,380 with having to try each password again and you're left back to that problem of time. 52 00:04:38,280 --> 00:04:45,220 If this tool were to be used, which it could in an approach similar to the Hydro tool so 53 00:04:45,220 --> 00:04:51,280 that you could do a remote attack on an actual service, again you've got a prevention mechanism 54 00:04:51,280 --> 00:04:52,880 there of limited number of retries. 55 00:04:52,880 --> 00:04:57,980 and also the actual availability of the system to handle X number of connections per second. 56 00:04:59,020 --> 00:05:02,900 Distributed computing, the approach here, particularly for password cracking, 57 00:05:03,100 --> 00:05:08,020 is considered embarrassingly parallel because it's extremely easy to, at least in theory, 58 00:05:08,700 --> 00:05:12,800 divide the attack up into smaller chunks like I described in the last slide 59 00:05:12,800 --> 00:05:15,000 and send it out across all the servers. 60 00:05:16,940 --> 00:05:19,360 Distributed.net did this forever ago. 61 00:05:19,360 --> 00:05:25,320 Their approach was largely aimed at cryptography itself, not password cracking, 62 00:05:25,640 --> 00:05:31,240 which is really a whole other ball of wax because one of the issues you run into there is 63 00:05:31,240 --> 00:05:35,040 the key space is so large, so much larger than a password, 64 00:05:35,420 --> 00:05:39,980 the numbers are quite, it takes quite a bit longer. 65 00:05:40,080 --> 00:05:43,520 This may help, but it still takes years, as distributed.net has shown, 66 00:05:43,680 --> 00:05:47,920 to actually effectively attack a cryptography-based hash. 67 00:05:48,560 --> 00:05:52,540 Such as public-private key or anything like that. 68 00:05:52,780 --> 00:05:57,500 Other tools that are similar to this, Dijon is John in the distributed format. 69 00:05:58,040 --> 00:06:03,320 It's not as easy to use as this, but it's one approach. 70 00:06:03,540 --> 00:06:06,780 John, through its ability to add functions to it, 71 00:06:06,900 --> 00:06:12,100 someone has written a parallel function that you can use to make it at least run parallel on the same machine 72 00:06:12,100 --> 00:06:16,200 and maybe, through some creativity, get it to run across separate machines. 73 00:06:16,520 --> 00:06:17,900 Access data has a command. 74 00:06:17,920 --> 00:06:20,960 It's a commercial product called DNA that appears to be very similar to this approach, 75 00:06:21,200 --> 00:06:23,420 but it's not GPL'd. 76 00:06:24,300 --> 00:06:24,580 You know what? 77 00:06:24,720 --> 00:06:27,420 If I don't put it there, there we go. 78 00:06:34,180 --> 00:06:35,420 So, what is it? 79 00:06:37,320 --> 00:06:41,240 There's two pieces to this tool, and the first piece is actually written in C, 80 00:06:41,460 --> 00:06:44,580 obviously for speed reasons, and that is the multi-threaded side of it 81 00:06:44,580 --> 00:06:47,660 for breaking it down on one system across all the cores. 82 00:06:49,220 --> 00:06:51,880 It was designed to be as simple as possible, 83 00:06:51,980 --> 00:06:56,180 so it takes a single function to crack a single password 84 00:06:56,180 --> 00:06:58,960 and then return a single true-false result 85 00:06:58,960 --> 00:07:03,940 or optionally fill a buffer that was passed to it with the resulting hash 86 00:07:03,940 --> 00:07:07,640 in the instance in which you're actually producing hashes and not cracking a password. 87 00:07:08,300 --> 00:07:12,340 So, I don't know if anyone's tried to poke around in John's source code 88 00:07:12,340 --> 00:07:17,900 where you can actually add new password hashing methodologies or anything else, 89 00:07:17,900 --> 00:07:21,020 but it's far simpler than anything else I was able to find 90 00:07:21,020 --> 00:07:24,640 in the sense that it doesn't have a library or list of 12 different functions 91 00:07:24,640 --> 00:07:27,800 with different states to apply to actually crack the password. 92 00:07:28,080 --> 00:07:32,180 You write one simple function to do one password, and it does the rest, 93 00:07:32,300 --> 00:07:34,960 and we'll send it across all the servers and everything else for you. 94 00:07:36,380 --> 00:07:39,020 Additionally, it's an asynchronous, interruptible process. 95 00:07:39,400 --> 00:07:43,060 So, you start the attack, it returns immediately, and you feed it a callback function, 96 00:07:43,220 --> 00:07:45,040 so it will return when it's done. 97 00:07:45,160 --> 00:07:47,880 You still get your status, but you can turn around, do everything, 98 00:07:47,880 --> 00:07:48,340 do other things. 99 00:07:48,620 --> 00:07:53,360 You can, at your own will, report on the status of the attack as it's going 100 00:07:53,360 --> 00:07:57,060 on an individual level, and obviously that was pretty important 101 00:07:57,060 --> 00:08:01,080 to be able to get it to run across multiple servers and then send the data back. 102 00:08:01,700 --> 00:08:05,840 So, that's another nice benefit of this particular C library. 103 00:08:08,080 --> 00:08:12,940 And then, again, it's very easy to take the output of using the C framework 104 00:08:12,940 --> 00:08:16,780 and turn it into the Python distributed attack module. 105 00:08:17,020 --> 00:08:17,860 So, really... 106 00:08:17,880 --> 00:08:23,200 Really, what's inside, basically what's inside this lib attack tarball is an entire environment 107 00:08:23,200 --> 00:08:29,720 for you to build easily a single, multi-threaded attack, like command line program. 108 00:08:30,200 --> 00:08:36,280 It comes with all of the lib tool and make and configure setup inside of it. 109 00:08:36,380 --> 00:08:40,100 You just drop your code in, run a configure, make, make install, and you're done. 110 00:08:41,660 --> 00:08:45,620 And then, with just a little bit of glue, it actually will turn around and turn into 111 00:08:45,620 --> 00:08:47,780 the next step of the attack for making a distribution. 112 00:08:47,880 --> 00:08:47,940 So, that's pretty much what we did. 113 00:08:49,840 --> 00:08:53,340 Breaking down into the detail on lib attack thread, there's the primary structure, which 114 00:08:53,340 --> 00:08:54,000 is the attack... 115 00:08:54,000 --> 00:08:56,420 It's a C structure, which is called attack ST. 116 00:08:56,640 --> 00:09:00,820 This is the attack structure that you build when you launch your attack. 117 00:09:01,140 --> 00:09:05,740 You're primarily filling it with your reader and your writer, which are the file structures 118 00:09:05,740 --> 00:09:10,920 that you use to send, okay, what's my list of words, what's my list of hashes, and then 119 00:09:10,920 --> 00:09:14,120 if you're actually going to want to write this back out, where am I writing it to? 120 00:09:14,220 --> 00:09:15,880 What's the file I'm going to write the output to? 121 00:09:16,280 --> 00:09:17,160 All of this... 122 00:09:17,160 --> 00:09:22,280 Even the writing out of hashes can still be easily distributed across all the different 123 00:09:22,280 --> 00:09:26,560 servers, and you set it to null if you don't want to write out, or if you wanted to write 124 00:09:26,560 --> 00:09:28,440 out, you just pass it a file structure. 125 00:09:28,700 --> 00:09:35,240 Both the file in and file out file structures are the same structure type, which is on the 126 00:09:35,240 --> 00:09:35,680 next slide. 127 00:09:37,540 --> 00:09:41,820 Next, the other important thing that you'll need to feed this, a fair amount of it, everything 128 00:09:41,820 --> 00:09:46,880 from S under is essentially private or internal data used by the attack itself. 129 00:09:47,160 --> 00:09:50,280 Nothing you need to fill, but in addition to filling in file in and file out, you'll 130 00:09:50,280 --> 00:09:55,220 give it the actual function that it's using to cracking, the one that takes one word and 131 00:09:55,220 --> 00:09:59,680 returns the result, and then the number of threads you want it to run on, and your callback 132 00:09:59,680 --> 00:10:00,020 function. 133 00:10:01,900 --> 00:10:02,300 Nice. 134 00:10:05,980 --> 00:10:08,520 All right, I'm moving on, we'll just burn. 135 00:10:09,540 --> 00:10:13,300 This is the file structure that you'll prepare, that you'll send to it. 136 00:10:13,420 --> 00:10:14,580 There are initialization... 137 00:10:15,260 --> 00:10:16,820 There are initialization... 138 00:10:16,820 --> 00:10:16,940 There are initialization... 139 00:10:16,940 --> 00:10:17,140 There are initialization... 140 00:10:17,160 --> 00:10:17,960 There are initialization functions inside. 141 00:10:18,480 --> 00:10:22,260 Thank you for making me talk louder, since that's exactly what this is designed for. 142 00:10:22,540 --> 00:10:27,100 There are initialization functions assigned inside the library that come with the different 143 00:10:27,100 --> 00:10:29,760 reader and writer modules that you can plug in. 144 00:10:30,100 --> 00:10:37,620 This was designed somewhat similar to the GTKC object-oriented approach, where you've 145 00:10:37,620 --> 00:10:43,180 got a couple of pieces of data, and then you've got a series of methods that are referenced 146 00:10:43,180 --> 00:10:45,040 inside the actual file structure itself. 147 00:10:45,480 --> 00:10:47,080 You'll pass it the path of the file. 148 00:10:47,080 --> 00:10:52,540 For instance, if you're opening a file, you can also pass it... 149 00:10:52,540 --> 00:10:57,220 When you're building your own reader or writer, you can pass it a pointer to your own data 150 00:10:57,220 --> 00:10:57,660 to use. 151 00:10:57,820 --> 00:11:01,040 For instance, on a file reader, you can pass it the file pointer itself. 152 00:11:02,320 --> 00:11:06,080 On a brute force attack, you use the pointer to store the start and end string, things 153 00:11:06,080 --> 00:11:06,520 like that. 154 00:11:07,140 --> 00:11:11,300 Then there's four functions that the lib attack thread will call on any particular reader 155 00:11:11,300 --> 00:11:11,700 or writer. 156 00:11:11,920 --> 00:11:16,980 It'll open it, it'll ask for the next block, which on a reader would be the next block, 157 00:11:17,080 --> 00:11:22,500 of words to read, and on a writer, that's going to be the next block to write data out 158 00:11:22,500 --> 00:11:22,760 to. 159 00:11:22,840 --> 00:11:26,320 That'll get essentially like a write buffer that'll get flushed out to the file. 160 00:11:27,500 --> 00:11:32,300 Free is called every time a block is completed, so you have to manage your own memory inside 161 00:11:32,300 --> 00:11:34,140 of the file structures. 162 00:11:34,520 --> 00:11:38,660 If you allocate a block, you're responsible for deallocating it when you're done, and 163 00:11:38,660 --> 00:11:42,420 the free function will be called for every block to assist you in that. 164 00:11:42,720 --> 00:11:46,000 When the attack's done, it closes the read, the file structure. 165 00:11:47,080 --> 00:11:54,460 That's essentially the entire attack structure. 166 00:11:55,200 --> 00:12:01,680 You've got your attack ST and your two different files, your read in and your read out. 167 00:12:04,440 --> 00:12:08,120 Once you've built your structure, there's three different methods you use to manage 168 00:12:08,120 --> 00:12:08,540 the attack. 169 00:12:08,880 --> 00:12:12,260 One to start it, one to stop it, and one to check it. 170 00:12:12,340 --> 00:12:16,580 Since it's asynchronous, once you've started it, whether it's through a signal interrupt, 171 00:12:16,580 --> 00:12:19,900 or your own decision, you can stop the attack at any time. 172 00:12:20,040 --> 00:12:26,500 It clears out any unprocessed words, and will stop the attack after finishing any blocks 173 00:12:26,500 --> 00:12:27,620 that are currently going on. 174 00:12:27,960 --> 00:12:30,820 Generally it'll stop it just about immediately. 175 00:12:30,940 --> 00:12:32,820 In a few hundred milliseconds, the attack will shut down. 176 00:12:34,740 --> 00:12:38,960 Checking will just return the current status of the attack, the number of records that 177 00:12:38,960 --> 00:12:41,300 it's tried so far, and the total number of records. 178 00:12:41,640 --> 00:12:46,260 This function is obviously only going to return the attack running on the current system. 179 00:12:46,260 --> 00:12:48,220 Or in the current environment. 180 00:12:48,480 --> 00:12:55,300 On a distributed attack, this is something that has to be aggregated, and is what's handled 181 00:12:55,300 --> 00:12:55,820 by Medusa. 182 00:12:57,740 --> 00:13:00,560 Here's a complete attack function, after all of that. 183 00:13:02,280 --> 00:13:07,840 The entire function's quite a bit simpler, again, than other approaches. 184 00:13:08,720 --> 00:13:12,260 It's passed a word, the size of the word. 185 00:13:12,440 --> 00:13:16,040 If it's going to need to write out, it's passed the buffer. 186 00:13:16,040 --> 00:13:18,560 The buffer for writing out to, and the size of that buffer. 187 00:13:19,420 --> 00:13:22,900 You set up the void data. 188 00:13:23,040 --> 00:13:27,480 The data pointer is your own pointer that you have access to, if you need to use. 189 00:13:28,280 --> 00:13:32,780 This is generally where you're going to store the hash that you're trying to find the answer 190 00:13:32,780 --> 00:13:33,060 for. 191 00:13:34,300 --> 00:13:39,000 For example, with CalPadi, it stores all the different fields of data that are extracted 192 00:13:39,000 --> 00:13:40,520 out of the packet dump. 193 00:13:40,840 --> 00:13:44,620 With an MD5 hash cracking attempt, it's got two values. 194 00:13:44,720 --> 00:13:45,560 It's going to store the salt. 195 00:13:45,680 --> 00:13:46,020 It's going to store the data. 196 00:13:46,040 --> 00:13:47,120 It's going to store the hash in the actual crypt text. 197 00:13:48,280 --> 00:13:54,200 Load that up out of the data pointer, pass it over to a function to actually produce the 198 00:13:54,200 --> 00:13:56,180 resulting hash, and then compare your results. 199 00:13:56,620 --> 00:13:59,420 There's three different return values that this function can return. 200 00:13:59,660 --> 00:14:05,200 Either it's an invalid word that can't be checked, it found the answer, or it didn't 201 00:14:05,200 --> 00:14:05,780 find the answer. 202 00:14:06,720 --> 00:14:11,680 Again, simplicity was the goal here, to try to build something that could easily take 203 00:14:11,680 --> 00:14:15,280 on additional brute forcing password cracking attempts. 204 00:14:17,480 --> 00:14:19,660 This is actually the building of a hashing function. 205 00:14:20,040 --> 00:14:24,020 Instead of the first one that was actually trying to crack a password, this is a function 206 00:14:24,020 --> 00:14:26,660 that is going to produce a hash file. 207 00:14:26,860 --> 00:14:32,580 In this particular hash function I chose, in part because it's so simple, this one 208 00:14:32,580 --> 00:14:36,520 is actually just copying the input word into the output buffer. 209 00:14:36,780 --> 00:14:39,000 It's not actually producing any type of hash. 210 00:14:41,180 --> 00:14:46,020 To produce a hash, the only extra line that you would add ... The two that I had for produce, 211 00:14:46,040 --> 00:14:47,780 producing hashes, didn't quite fit well on the screen. 212 00:14:48,460 --> 00:14:51,280 The additional line, you actually produce the hash and write it back out. 213 00:14:51,420 --> 00:14:56,700 Where this particular function is used is actually taking a list of words and turning 214 00:14:56,700 --> 00:14:58,720 it into a lib attack thread dictionary. 215 00:14:59,360 --> 00:15:03,340 The only difference here that you can see is that the word's the same, but what it does 216 00:15:03,340 --> 00:15:05,400 is it null pads it to a fixed size. 217 00:15:05,900 --> 00:15:12,180 The dictionary that lib attack thread prefers to use is a fixed size set of words. 218 00:15:13,780 --> 00:15:16,020 The reason that was critical is when you're doing a hash, you want to make sure that you're 219 00:15:16,040 --> 00:15:19,660 doing a distributed attack and you're passing the same dictionary out to hundreds of different 220 00:15:19,660 --> 00:15:24,480 computers, it's very likely that you will take, out of one dictionary, have multiple 221 00:15:24,480 --> 00:15:26,680 clients use different pieces of it. 222 00:15:26,960 --> 00:15:31,740 By making the dictionary words fixed length, it's very easy to give out chunks of that 223 00:15:31,740 --> 00:15:34,120 dictionary to different clients. 224 00:15:35,040 --> 00:15:38,340 Basically a rainbow table would look the same. 225 00:15:38,680 --> 00:15:42,060 The majority of the rainbow tables I looked at, I've seen so far, have all been fixed 226 00:15:42,060 --> 00:15:45,760 widths on each chunk of each hash that it's using. 227 00:15:45,760 --> 00:15:49,260 This is basically the same thing except instead of it being a hash, it's just a word that 228 00:15:49,260 --> 00:15:49,900 needs to be checked. 229 00:15:50,920 --> 00:15:56,200 You can see here that building a function that produces rainbow tables is also very 230 00:15:56,200 --> 00:15:56,600 simple. 231 00:15:57,580 --> 00:16:01,400 You just take in the word, produce the result, send it back to the output buffer. 232 00:16:01,780 --> 00:16:06,460 Lib attack thread takes care of the responsibility of taking each individual hash, aggregating 233 00:16:06,460 --> 00:16:10,580 it together into a larger buffer, and then sending that back to another thread that actually 234 00:16:10,580 --> 00:16:14,080 writes all the data out into the resulting file for you. 235 00:16:16,640 --> 00:16:20,540 Now we've got an attack function. 236 00:16:20,840 --> 00:16:29,020 It needs to be rolled up into the actual library that you can use to send out to a distributed 237 00:16:29,020 --> 00:16:29,360 attack. 238 00:16:30,120 --> 00:16:35,560 This is an example of a library function that can be used for exactly that purpose. 239 00:16:37,100 --> 00:16:41,920 The initialization of the library is a two-step process. 240 00:16:42,360 --> 00:16:45,000 First, you initialize your readers and your writers. 241 00:16:45,100 --> 00:16:45,580 Your files. 242 00:16:45,760 --> 00:16:49,980 All structures that actually will be bringing in the words or writing the words back out. 243 00:16:50,200 --> 00:16:54,300 And then you initialize the actual attack, passing it those readers and writers, passing 244 00:16:54,300 --> 00:16:57,940 it your function that you're using, the number of threads, and all the other details. 245 00:16:59,540 --> 00:17:04,040 The check, stop, and attack don't need to be customized or modified for each and every 246 00:17:04,040 --> 00:17:04,320 attack. 247 00:17:04,500 --> 00:17:08,760 You just basically need to initialize your attack, and then the rest of the library works 248 00:17:08,760 --> 00:17:09,160 as is. 249 00:17:10,780 --> 00:17:14,780 As you can see here, it's just as important to make an initialization function, you also 250 00:17:14,780 --> 00:17:17,480 need to make something to clean your mess up when you're done. 251 00:17:17,920 --> 00:17:22,280 There's really two functions in your library for every different type of attack that you 252 00:17:22,780 --> 00:17:23,580 want to build. 253 00:17:26,660 --> 00:17:32,940 Because it comes with automake, autoconfigure, and libtool pre-setup in this environment, 254 00:17:33,320 --> 00:17:37,740 adding a new attack to the environment and making it so that you can do all the fancy 255 00:17:37,740 --> 00:17:40,120 configure, make, make, install is pretty simple. 256 00:17:40,340 --> 00:17:41,280 It's basically three lines. 257 00:17:41,500 --> 00:17:43,200 You need to specify the name of the library. 258 00:17:43,400 --> 00:17:44,760 You need to specify the name of the library. 259 00:17:44,760 --> 00:17:47,720 You need to specify the source files that you're using for the library, and if there's 260 00:17:47,720 --> 00:17:52,040 any additional libraries you need to link in, then you specify those, but that's all 261 00:17:52,040 --> 00:17:52,720 there is to it. 262 00:17:53,560 --> 00:17:59,240 Most of the mess here is also taken care of in producing an attack library. 263 00:18:03,160 --> 00:18:10,200 Here's an example of actually running the attack inside of, say, a command line executable. 264 00:18:10,420 --> 00:18:14,740 Once you've got your initialization methods put together, you're going to have a lot of 265 00:18:14,740 --> 00:18:15,120 data structure. 266 00:18:15,120 --> 00:18:19,080 You've got your resulting C library that you're going to load into your program. 267 00:18:19,540 --> 00:18:21,820 You basically initialize your data structure. 268 00:18:22,000 --> 00:18:25,340 Here's an example of a cow-patty data initialization. 269 00:18:25,640 --> 00:18:30,060 You can see that there's several different variables that are required to compare the 270 00:18:30,060 --> 00:18:32,160 hash against what was pulled off the wire. 271 00:18:32,700 --> 00:18:36,800 You'll fill up your cow-patty data structure with what you want to attack. 272 00:18:37,160 --> 00:18:43,020 You'll fill up your dictionary attack structure with a dictionary file. 273 00:18:43,300 --> 00:18:44,720 The actual index is actually a little bit more difficult to use. 274 00:18:44,740 --> 00:18:50,020 actual function that's going to be used to run the attack word by word and then the number 275 00:18:50,020 --> 00:18:56,060 of threads and the callback when it's done. Then you start the attack, and it's going 276 00:18:56,060 --> 00:18:58,800 to return immediately, and the attack again is going to run on a separate thread. 277 00:18:59,060 --> 00:19:03,740 Now you're free to do whatever you want. In this particular instance, I'm just looping, 278 00:19:04,360 --> 00:19:08,540 waiting for the attack to finish every five seconds and spitting out the current number 279 00:19:08,540 --> 00:19:13,920 of records that have been processed. This current approach is fairly similar to 280 00:19:13,920 --> 00:19:19,120 what CalPadi currently does, the main difference being that instead of spitting out each thousandth 281 00:19:19,120 --> 00:19:25,220 word and the time involved, every five seconds just spits out how many words has been computed. 282 00:19:25,680 --> 00:19:30,440 One of the side effects to running a multi-threaded attack is in some examples where they'll show 283 00:19:30,440 --> 00:19:33,980 you the last password that was tried, it's fairly difficult to determine what the last 284 00:19:33,980 --> 00:19:39,080 password that was attacked was as a part of output back to the user because it's running 285 00:19:39,080 --> 00:19:43,720 three, four, five, however many threads you've got going at once, different simultaneous attacks. 286 00:19:43,920 --> 00:19:50,420 Instead, useful output is the number of passwords tried per second and the total percentage 287 00:19:50,420 --> 00:19:52,580 of the key space that's been exhausted, things like that. 288 00:19:53,540 --> 00:19:58,700 When you're done, you run the destroy function, and the callback will get called for you. 289 00:19:58,740 --> 00:20:02,700 Even if you stop the attack prematurely, the callback will still get called, so you can 290 00:20:02,700 --> 00:20:05,600 get your output and any errors that came out of the attack. 291 00:20:08,940 --> 00:20:13,900 There we go. It's very easy to stop. Signal handling can often be frustrating, but it's 292 00:20:13,900 --> 00:20:16,720 frustrating when dealing with just about anything that you have to write and see. 293 00:20:18,540 --> 00:20:26,620 Here's a very simple example of one function call to actually stop your attack. Storing 294 00:20:26,620 --> 00:20:32,380 the attack structure globally inside of the executable and then just calling stop attack 295 00:20:32,380 --> 00:20:37,600 on it is all you need to do. You can put this on all of your signal handles, 296 00:20:37,720 --> 00:20:42,140 and at any point in time the attack will stop, the binary will close up, and everything cleans 297 00:20:42,140 --> 00:20:43,580 itself up nicely. 298 00:20:47,920 --> 00:20:53,160 Then again, just like building the library was fairly simplistic, making it so that you 299 00:20:53,160 --> 00:20:57,780 can utilize the existing framework for building the actual executable is just as simple. Again, 300 00:20:57,860 --> 00:21:03,200 you really only need three lines. The name of the output executable file, a list of all 301 00:21:03,200 --> 00:21:07,380 of your source files that are needed to compile it, and a list of any special libraries that 302 00:21:07,380 --> 00:21:12,060 need to be linked into the executable. All the libraries that are required by the 303 00:21:12,060 --> 00:21:13,880 attack function itself, Pthread, are linked to the executable. The ones that are required 304 00:21:13,900 --> 00:21:18,180 for the threading or anything else for the attack function will actually already be linked 305 00:21:18,180 --> 00:21:23,360 in to the library, so you really only need to specify anything additional. For instance, 306 00:21:23,460 --> 00:21:28,600 with CALPADDY, it needs access to the PCAP so that it can pull apart the data capture 307 00:21:28,600 --> 00:21:33,560 and get the variables out of it. That's really the only thing you have to link in in this 308 00:21:33,560 --> 00:21:34,200 particular case. 309 00:21:37,660 --> 00:21:43,100 Just a quick recap. Again, you're going to build an attack structure that's primarily 310 00:21:43,100 --> 00:21:48,100 filled with where you want to read your word or hash list from and where you want to output 311 00:21:48,100 --> 00:21:54,800 your data if you're going to do a rainbow or hash table. You need to also specify the 312 00:21:54,800 --> 00:21:59,500 function that's going to be used individually for attacking each word and then the number 313 00:21:59,500 --> 00:22:07,040 of threads and then a callback function inside of that. Initialization and destruction methods 314 00:22:07,040 --> 00:22:11,420 inside of your library are the two things that you have to define there, but altogether 315 00:22:11,420 --> 00:22:13,080 you're looking at writing three things. 316 00:22:13,080 --> 00:22:17,960 You've got two functions, all of which should be easily less than 100 lines apiece, and you've 317 00:22:17,960 --> 00:22:21,480 got a multi-threaded distributed command line attack beast. 318 00:22:24,340 --> 00:22:32,120 Next step, now one machine's nice. Taking CALPADDY as an example from 90 or 100 passwords 319 00:22:32,760 --> 00:22:38,580 per second to three, four, or 800 passwords per second, or in one particular instance, 320 00:22:38,660 --> 00:22:43,060 I was able to get it to run at almost 1,900 passwords per second on one system. You can 321 00:22:43,080 --> 00:22:47,720 see that it's nice, but you're still limited to one box, and you're still limited most 322 00:22:47,720 --> 00:22:53,640 likely to a box that you have. The next step is running that out across as 323 00:22:53,640 --> 00:23:00,060 many machines as you can rent, buy, steal, store, or infect. That is where Medusa comes 324 00:23:00,060 --> 00:23:05,740 into play. Medusa is a web-based framework that will load up an attack library module 325 00:23:05,740 --> 00:23:10,380 and then send it out across multiple clients that have linked into it. It's written in 326 00:23:10,380 --> 00:23:12,340 Python, which is where the name Medusa comes from. 327 00:23:13,900 --> 00:23:19,580 It operates on a client-server protocol. You've got one server that distributes the 328 00:23:19,580 --> 00:23:23,960 attack out to as many clients as you link up to it. It's one level deep, it's not multiple 329 00:23:23,960 --> 00:23:29,260 levels, and it doesn't do P2P, but it's still very effective. With this type of approach, 330 00:23:29,560 --> 00:23:34,820 it reflects the type of control that you're probably going to want in the sense that you're 331 00:23:34,820 --> 00:23:38,180 going to want to make sure that the systems that are linked into you are systems that 332 00:23:38,180 --> 00:23:41,540 you trust. If it's not a system that you trust and it's 333 00:23:41,540 --> 00:23:44,240 cracking passwords, it could be returning bad data. 334 00:23:45,580 --> 00:23:50,000 It will automatically load up the attack modules. Basically what you do is you drop the library 335 00:23:50,000 --> 00:23:53,880 module into a directory and it searches in that directory and pulls everything into it. 336 00:23:54,040 --> 00:23:58,000 It loads those up. It drops it into a web interface for you 337 00:23:58,000 --> 00:24:01,960 to fill in all of your initialization data, and then runs the attack for you. 338 00:24:05,380 --> 00:24:09,680 There's a little bit of glue that has to be stuck in between the C library and the Python 339 00:24:09,680 --> 00:24:11,520 module that actually gets loaded up. It has to get a little bit of glue that gets 340 00:24:11,520 --> 00:24:16,460 Basically, what you're doing here is you're telling the web framework what it is that 341 00:24:16,460 --> 00:24:21,080 it's being fed. At the very top of the file, you specify the 342 00:24:21,080 --> 00:24:29,940 name of the data structure that is holding your hash data, the name of the Python module, 343 00:24:30,260 --> 00:24:34,940 and then the description that gets put on the web page of what exactly this is doing. 344 00:24:36,060 --> 00:24:42,400 Underneath that, you then define those arguments that are being sent to the attack to be processed. 345 00:24:42,920 --> 00:24:49,040 In this particular instance, this is an MD5 crack and this is the initialization argument. 346 00:24:49,340 --> 00:24:52,640 It needs a salt and it needs the actual crypt text. 347 00:24:53,320 --> 00:25:01,160 One of the things that is convenient about this wrapper is that it will actually allow 348 00:25:01,160 --> 00:25:04,860 you to reorganize those arguments into something that 349 00:25:04,860 --> 00:25:08,600 is more convenient for the web framework and for user input. 350 00:25:08,940 --> 00:25:14,920 In this particular instance, both the salt and the crypt are being passed to one argument 351 00:25:14,920 --> 00:25:17,200 type. The argument type is called MD5 password. 352 00:25:17,860 --> 00:25:25,780 Inside of Medusa's framework is another directory full of Python scripts that are also loaded 353 00:25:25,780 --> 00:25:31,340 up that you can add to that list different argument types, string, integer, hex. 354 00:25:32,240 --> 00:25:36,540 This is a custom one that I put in for FreeBSD's MD5 crack. 355 00:25:37,360 --> 00:25:45,260 Basically what it does is it produces to the user web input of, give me the entire hash, 356 00:25:45,560 --> 00:25:49,080 dollar sign one, dollar sign, salt, dollar sign, and then the actual crypt text. 357 00:25:49,420 --> 00:25:54,520 It takes the salt and the crypt text out. It turns the crypt text from its current text 358 00:25:54,520 --> 00:25:59,160 representation into a binary representation, and then it feeds those two pieces back to 359 00:25:59,680 --> 00:26:01,320 the actual library. To do that, you need to have a binary representation. 360 00:26:01,340 --> 00:26:10,840 Instead of producing two inputs to the user to have to do the work themselves, it can 361 00:26:10,840 --> 00:26:14,060 actually wrap that up. Another example of this type of convenience, 362 00:26:14,380 --> 00:26:19,440 you can have 20 or 40 or 60 individual hash files that you want to aggregate together 363 00:26:19,440 --> 00:26:25,640 into a single conglomerated hash table. You can have those 20 files. 364 00:26:25,640 --> 00:26:33,460 The file in archetype that's already in Medusa will see those 20 files and read the description 365 00:26:33,460 --> 00:26:37,460 out of it and produce to the user one option on the dropdown to pick from. 366 00:26:37,740 --> 00:26:42,760 It will then take that 20 files, divide it by the number of clients that are attached 367 00:26:42,760 --> 00:26:46,680 to it, and when it actually spits out the attack, it will break each file into as many 368 00:26:46,680 --> 00:26:50,960 pieces as it needs to and send out each piece of each different file to each client and 369 00:26:50,960 --> 00:26:55,560 manage the attack for you. Doing all of that in Python means that not only 370 00:26:55,560 --> 00:26:59,260 is it easier to add new argument types because Python's a lot easier to write in and much 371 00:26:59,260 --> 00:27:04,520 more flexible, but it also means that the interface between Python and C is much more 372 00:27:04,520 --> 00:27:08,260 simplistic. This argument type here, the md5 password 373 00:27:08,800 --> 00:27:11,700 argument type here, can also be referenced like a function. 374 00:27:11,940 --> 00:27:15,940 You can actually pass arguments to it. Those arguments automatically get shoved into 375 00:27:15,940 --> 00:27:22,420 the init function on the Python class, the argument type class. So, if you wanted to 376 00:27:22,420 --> 00:27:25,540 have greater flexibility, one example that I just took up here was using the Python class, which is essentially the project that requires 377 00:27:25,560 --> 00:27:31,280 I don't think I have in the slides here, but with your file and an argument type, you can 378 00:27:31,280 --> 00:27:35,600 pass it a type, hash, dict, or whatever you want. 379 00:27:35,820 --> 00:27:40,420 When it looks at all the different hashes that are inside of this attack server, it'll 380 00:27:40,420 --> 00:27:46,240 group it by type and it'll only show if you say file in hash, then it'll only show you 381 00:27:46,240 --> 00:27:49,720 the hash or rainbow table files in the system. 382 00:27:49,840 --> 00:27:53,540 If you pass it dict, then it'll only show you the dictionary files inside of the system. 383 00:27:53,540 --> 00:27:58,340 There's lots of ways in which you can customize the argument types to, again, present a valuable 384 00:27:58,340 --> 00:28:04,080 user interface on the web attack side and, at the same time, not have to deal with writing 385 00:28:04,080 --> 00:28:08,120 too much C code for processing this, since you can all handle it in Python instead. 386 00:28:11,160 --> 00:28:12,580 Here's the actual wrapper code. 387 00:28:12,840 --> 00:28:14,020 Now you've defined your arguments. 388 00:28:14,420 --> 00:28:20,540 Basically, all you have to do, this function's goal here is to take the arguments from Python 389 00:28:21,020 --> 00:28:22,180 and feed them into C. 390 00:28:22,540 --> 00:28:23,520 There's four functions. 391 00:28:23,520 --> 00:28:24,320 There's four pieces of that. 392 00:28:24,520 --> 00:28:29,060 The first, you just define, whether it's an integer, string, whatever it is, the different 393 00:28:29,060 --> 00:28:31,060 arguments that you're expecting to get from Python. 394 00:28:31,420 --> 00:28:37,160 The second chunk is where you call the py parse tuple. 395 00:28:37,320 --> 00:28:43,400 It will actually get the attack arguments and shove them into your C variables. 396 00:28:44,380 --> 00:28:46,040 The third step is an optional one. 397 00:28:46,680 --> 00:28:53,380 When you're dealing with binary data that is not a null, not a C string that's null 398 00:28:53,520 --> 00:28:58,100 padded, then Python will also pass you the size of the string. 399 00:28:58,200 --> 00:29:00,060 You're going to want to check that against what you're expecting. 400 00:29:00,560 --> 00:29:08,100 For instance, with CalPatty, the nonce and the EA pull frame variables very likely will 401 00:29:08,100 --> 00:29:12,840 have zero byte data inside of it, so you can't just receive it as a string and check the 402 00:29:12,840 --> 00:29:13,240 length of it. 403 00:29:13,300 --> 00:29:17,520 You've got to get the actual size of the data that's being passed back from Python, and 404 00:29:17,520 --> 00:29:19,400 check and make sure it's the right size that you're expecting. 405 00:29:20,620 --> 00:29:23,500 If you're just dealing with simple strings and integers, you can actually just get it 406 00:29:23,500 --> 00:29:27,400 actually skip that part, or if you just don't feel like actually checking your data, you 407 00:29:27,400 --> 00:29:28,060 can skip it anyways. 408 00:29:28,620 --> 00:29:32,620 Then the last piece is where you just call your initialization function. Again, you don't 409 00:29:32,620 --> 00:29:35,620 need to deal with calling the start and the stop and the checks or anything else. You're 410 00:29:35,620 --> 00:29:39,220 just getting the data initialized so that the attack can run. Once it's initialized, 411 00:29:39,280 --> 00:29:41,400 Medusa will take over the rest for you. 412 00:29:44,340 --> 00:29:52,560 Again with the argument types, I think I really skipped ahead and covered a bit of 413 00:29:52,560 --> 00:29:58,460 this already, but again, whatever you pass inside of the argument type will get fed into 414 00:29:58,460 --> 00:30:02,400 the C, and it can take arguments that will pass to the class, and in this lies a class. 415 00:30:03,240 --> 00:30:08,740 Here is an example. Here you see file in dict. This is exactly what I was talking about earlier. 416 00:30:08,980 --> 00:30:14,740 The file in argument type can take an option of what type of files to show to the user. 417 00:30:14,840 --> 00:30:18,400 In this particular case, this is only going to show dictionary files that it wants to 418 00:30:18,400 --> 00:30:19,820 crack and not show hash files. 419 00:30:22,940 --> 00:30:27,320 Medusa was built using Aaron Swartz' WebPY framework. The biggest reason why I chose 420 00:30:28,320 --> 00:30:35,480 WebPY was so that you can run it however you want. If you just run the actual Python framework, 421 00:30:35,560 --> 00:30:41,300 run the controller file, it will spit up its own web server and chunk right along. 422 00:30:41,560 --> 00:30:45,440 If I remember correctly, it uses the CherryPy web server, Python-based web server, so you 423 00:30:45,440 --> 00:30:48,760 don't have to actually do anything to get it to run simply. 424 00:30:49,440 --> 00:30:49,800 Subtitles by the Amara.org community 425 00:30:49,820 --> 00:30:55,620 It's not going to be SSL-encrypted, and you're going to have other limitations to 426 00:30:55,620 --> 00:31:01,100 using that approach, but that's the simple approach. It's also a full WSGI framework-compliant 427 00:31:01,100 --> 00:31:06,440 application because of WebPY. You can drop this into Apache, drop it into LightHTTPD, 428 00:31:06,580 --> 00:31:11,680 drop it into basically any web server that supports fastCGI, and take advantage of the 429 00:31:15,120 --> 00:31:19,800 SSL. If you were to roll it into Apache, you can SSL-encrypt the actual traffic. You can 430 00:31:19,820 --> 00:31:26,340 take advantage of the fact that it's going to be a far more robust framework or service 431 00:31:26,340 --> 00:31:30,800 to run in. It gives you that flexibility to run it however you want or wherever you want. 432 00:31:30,880 --> 00:31:34,080 You can run it inside of an existing website. You can embed it inside of an existing website 433 00:31:34,080 --> 00:31:39,180 with an htaccess file as long as it had support for fastCGI and a pendant under the end of 434 00:31:39,180 --> 00:31:42,740 something in an existing site and hiding it somewhere as well. 435 00:31:43,720 --> 00:31:47,720 Right. Yes, exactly. Someone else's website. 436 00:31:48,080 --> 00:31:49,800 All right. Let's see. Let's see. Let's see. Let's see. Let's see. Let's see. Let's see. Let's see. Let's see. Let's see. 437 00:31:51,460 --> 00:31:54,400 It's moving right along. It's time for the live demo. 438 00:31:56,460 --> 00:31:58,700 Fraught. Fraught with parallel. 439 00:32:04,540 --> 00:32:19,780 Here we go. Here is Medusa running in an environment 440 00:32:19,800 --> 00:32:27,940 with 40 different clients attached to it. Typically, Medusa will output the URLs of 441 00:32:27,940 --> 00:32:34,560 the different clients attached to it so that you can see what you're working with. In this 442 00:32:34,560 --> 00:32:41,500 particular case for the demo, I'm actually hiding the URLs. The whole framework is stateless-based. 443 00:32:41,820 --> 00:32:49,780 The entire distribution of the attack is stateless. Every single request between the 444 00:32:49,800 --> 00:32:54,940 clients and the servers or between you and the server is done with basic HTTP authentication 445 00:32:54,940 --> 00:33:02,180 and absolutely no session or state inside of it. Again, simplicity was a goal of this 446 00:33:02,180 --> 00:33:13,560 design as well. It uses XMLRPC to communicate between the clients and the servers. Let's 447 00:33:13,560 --> 00:33:17,800 go straight to doing an attack. Let's go straight to doing an attack. 448 00:33:17,800 --> 00:33:27,860 Here I've loaded up CalPATI and FreeBSD MD5 modules that can either do a brute-force 449 00:33:27,860 --> 00:33:33,880 attack on CalPATI, a dictionary attack on CalPATI, a rainbow table. It can actually 450 00:33:33,880 --> 00:33:39,200 produce rainbow tables. Each client will write its own rainbow table file out to its own 451 00:33:39,200 --> 00:33:46,280 self. In that particular instance, if you're not going to use a shared file system or back 452 00:33:46,280 --> 00:33:51,040 back it up to any of those cloud data storage systems that are available, then you're going 453 00:33:51,040 --> 00:33:56,140 to have to deal with bringing those hash files back, but the goal and intent here is to use 454 00:33:56,140 --> 00:34:03,520 a shared file system to store the actual data on. I'm not going to name any even though 455 00:34:03,520 --> 00:34:12,260 I'm tempted to. If you pop in here, this is to do cow patty. 456 00:34:16,280 --> 00:34:21,660 I'm just actually going to fill it in with some data that was pre-extracted. 457 00:34:21,720 --> 00:34:28,240 For this particular demo, I did not have time in Python to write, let's say, for instance, 458 00:34:28,520 --> 00:34:33,880 something that can process a packet capture dump like cow patty could. It certainly could, 459 00:34:34,140 --> 00:34:40,100 but instead of doing that, I'm just simply asking for the output that comes from processing 460 00:34:40,440 --> 00:34:45,360 the dump off of the wire. Included with the updated cow patty release 461 00:34:45,360 --> 00:34:46,260 is a... 462 00:34:46,260 --> 00:34:50,680 It's a small C program where you just feed it the dump. It spits out these variables 463 00:34:50,680 --> 00:34:56,100 exactly as they need to be retyped. Also, it would be terribly difficult to write a 464 00:34:56,100 --> 00:35:02,540 Python module that would be dropped into Medusa where you would upload the actual dump from 465 00:35:02,540 --> 00:35:06,360 your packet capture, and then it will break that into the values and send it out. 466 00:35:07,020 --> 00:35:12,700 One of the other advantages to this being a web-based system that's running on the cloud 467 00:35:12,700 --> 00:35:16,240 is you don't have to have any of this hardware with you. 468 00:35:16,240 --> 00:35:23,760 You can use your cell phone when you walk in somewhere and grab a FreeBSD MD5 hash off 469 00:35:23,760 --> 00:35:27,200 of a system. If you were to do the whole dropping of USB 470 00:35:27,200 --> 00:35:30,780 sticks attack and hope that someone picked it up and put it into their machine, when 471 00:35:30,780 --> 00:35:34,060 it reads the hashes off of their Windows computer, it could upload it automatically 472 00:35:34,060 --> 00:35:38,920 to an existing Medusa server and start an attack for you immediately. 473 00:35:39,280 --> 00:35:44,900 The whole thing is done on the Internet, so you don't need any more hardware than a basic 474 00:35:44,900 --> 00:35:46,220 web browser like a cell phone. You don't need any more hardware than a basic web browser 475 00:35:46,240 --> 00:35:48,620 to actually start up an attack. 476 00:35:50,300 --> 00:35:58,520 This particular one will... I've only got one dictionary file here, and it's a 40 million 477 00:35:58,520 --> 00:36:02,960 word dictionary file, just a little bit more, and it's going to get split across 40 clients. 478 00:36:03,860 --> 00:36:09,700 Now, the attack's running. Each block has its own status of how much 479 00:36:09,700 --> 00:36:13,440 of it's been processed out of the block that's been split up against. Now again, this is 480 00:36:13,440 --> 00:36:15,160 one file. This is one... 481 00:36:16,240 --> 00:36:20,260 dictionary file that was split into smaller chunks and passed out to each server. 482 00:36:20,580 --> 00:36:28,400 Each server has gotten a roughly one million word chunk of that dictionary file that it's 483 00:36:28,400 --> 00:36:32,040 responsible for processing. One of the things that you'll notice is that 484 00:36:32,040 --> 00:36:36,440 the attack speed, or records per second here, is accelerating. 485 00:36:36,700 --> 00:36:38,460 It started off pretty low and it's getting faster. 486 00:36:39,180 --> 00:36:44,380 There's two things to be aware of here. The first thing is that the time that's being 487 00:36:44,380 --> 00:36:49,720 measured for the attack started right before the attack actually got sent out to each client 488 00:36:49,720 --> 00:36:53,340 and is being measured as the clients send their results back in. 489 00:36:53,500 --> 00:36:58,180 For the purposes of this demo, I accelerated things to be between one and five seconds 490 00:36:58,180 --> 00:37:01,200 on the reporting back. In a normal attack, that's going to be a lot 491 00:37:01,200 --> 00:37:03,860 of traffic. If you've got 10, 100, or a million different 492 00:37:03,860 --> 00:37:08,580 bots or cloud computers running together, you're not going to want to have each one 493 00:37:08,580 --> 00:37:10,980 of them shoot back the status every few seconds. 494 00:37:11,280 --> 00:37:14,360 It works well for a demo. But in reality, it's going to be a lot of 495 00:37:15,180 --> 00:37:18,980 time that you're going to want to set and then wait for the answer to come back for 496 00:37:18,980 --> 00:37:21,300 you. One of the other things that I've noticed, 497 00:37:21,700 --> 00:37:28,160 and I'm assuming so far that this is a side effect of the particular computers I'm using 498 00:37:28,160 --> 00:37:34,340 for this attack, but when the attack starts up, when it pegs the CPU at 100%, it seems 499 00:37:34,340 --> 00:37:41,400 to be allocating the resources on the fly. When it first starts, for the first couple 500 00:37:41,400 --> 00:37:44,300 of seconds, it'll use one or two cores out of the eight core systems. 501 00:37:44,300 --> 00:37:49,220 And then after about five or ten minutes, it's eventually consuming 100% of all the 502 00:37:49,220 --> 00:37:51,140 cores. But for some reason, there is a delay there 503 00:37:51,140 --> 00:37:56,040 before it actually ramps up. At any rate, you can see it's already running 504 00:37:56,040 --> 00:38:00,840 at over 10,000 keys per second. If you run Cowpatty on your local laptop, 505 00:38:01,080 --> 00:38:07,940 you're likely to get about 90 keys a second. This is several orders of magnitude higher. 506 00:38:08,100 --> 00:38:13,140 And this is currently running on, it's actually 20 different cloud servers linked together. 507 00:38:13,140 --> 00:38:20,460 And basically, the cost to me to run all of these is $16 an hour. 508 00:38:20,780 --> 00:38:28,520 So for $16 an hour, you can go over 100 times faster than you could on your local laptop 509 00:38:28,520 --> 00:38:36,180 when trying to crack Cowpatty in particular. Just looking at the output here, again, each 510 00:38:36,180 --> 00:38:42,020 block has its own status as it's being processed, and then each client is listed underneath 511 00:38:42,020 --> 00:38:43,120 it with its... 512 00:38:43,140 --> 00:38:47,940 All right, let's stop the refresh. With whether or not it's still actively processing 513 00:38:47,940 --> 00:38:52,900 blocks being utilized for this attack. The client, once a client links up to a server, 514 00:38:53,060 --> 00:38:57,220 the client essentially only produces status output of what it's currently doing. 515 00:38:57,480 --> 00:39:01,640 You cannot start an attack from a client or manage a client at all from the web interface. 516 00:39:01,900 --> 00:39:06,720 You can only manage things from the server. Let's see. 517 00:39:16,000 --> 00:39:22,800 So, and again, it continues to ramp up over time. This will eventually scale up to about 518 00:39:22,800 --> 00:39:31,720 1,800 keys per server, which across 40 servers would be about 80,000 keys a second, once 519 00:39:31,720 --> 00:39:38,920 it fully ramps up, if I'm doing my math in my head right. So again, for about $16 an 520 00:39:38,920 --> 00:39:42,200 hour, you can do 80,000 keys a second. Ten minutes. All right. 521 00:39:42,600 --> 00:39:43,120 So, I did that. I did that. I did that. I did that. I did that. I did that. 522 00:39:46,480 --> 00:39:53,240 I can't even see it. There is a reset button here at the very bottom 523 00:39:53,240 --> 00:39:57,820 of the screen that's not showing up to stop an attack and restart another one. 524 00:39:58,600 --> 00:40:04,520 The hash-based attack on cowpatty accelerates this so much faster to the point where a 40 525 00:40:04,520 --> 00:40:11,700 million hash is run in less than a second on the 40 linked servers together. 526 00:40:12,380 --> 00:40:19,900 A brute force attack of MD5 password runs at about 33,000 keys per server. 527 00:40:21,900 --> 00:40:25,920 While this is fun, since I'm running out of time, I'm actually going to stop the demo 528 00:40:25,920 --> 00:40:30,840 short and get back here. 529 00:40:45,340 --> 00:40:50,980 Where this became very useful, besides trying to get other people's passwords, was actually 530 00:40:50,980 --> 00:40:57,140 taking the output of how fast you can run an attack on a rented cloud server and take 531 00:40:57,140 --> 00:41:01,620 that versus what it costs you to rent that server and use that to come up with a dollar 532 00:41:01,620 --> 00:41:02,600 value for passwords. 533 00:41:04,500 --> 00:41:10,580 Here, for instance, are your cracks per dollar for five different hash types. 534 00:41:10,800 --> 00:41:14,120 The last two actually were estimated. I was not able to get an attack module put 535 00:41:14,120 --> 00:41:19,340 together for them, so instead I compared the speed of John on password MD5 to the speed 536 00:41:19,340 --> 00:41:22,780 of John on those two different types and extrapolated the results here. 537 00:41:23,520 --> 00:41:32,220 Again, for a dollar, you can get about 8 million cowpatty cracks with a dictionary, 2.8 billion 538 00:41:32,220 --> 00:41:33,720 if you're going to use a rainbow table. 539 00:41:34,680 --> 00:41:42,880 149,000 MD5 attacks, 237 billion on NT-LandMan. If people didn't somehow already believe that 540 00:41:42,880 --> 00:41:47,140 that LandMan was dead, I've got some numbers here that'll show you that for about a couple 541 00:41:47,140 --> 00:41:49,680 hundred bucks you can get any NT-LandMan password. 542 00:41:50,340 --> 00:41:58,880 And then with OpenBSD Blowfish, it still reigns supreme on the password hashing coming 543 00:41:58,880 --> 00:42:03,700 in just about, just a little bit faster than WPA, which is pretty impressive. 544 00:42:03,720 --> 00:42:04,000 It's pretty slow. 545 00:42:07,500 --> 00:42:10,660 Go ahead and give me the money, I'll get that for you later. 546 00:42:13,800 --> 00:42:20,020 Here's that extrapolated to different passwords based on the characters you're going to use 547 00:42:20,020 --> 00:42:23,580 inside of your password. If you're only going to use lower alphanumeric 548 00:42:23,580 --> 00:42:28,260 characters in cowpatty and you've got a seven character password, you can get your password 549 00:42:28,260 --> 00:42:31,760 for a couple hundred bucks. It doesn't even cost a dollar to get it if 550 00:42:31,760 --> 00:42:32,520 it's NT-LandMan. 551 00:42:32,520 --> 00:42:39,700 And if you go all the way to a mixed alphanumeric and all special characters, NT-LandMan is 552 00:42:39,700 --> 00:42:45,740 still 273 bucks and you can run through the entire key space. On cowpatty, you're in the 553 00:42:45,740 --> 00:42:48,640 millions already in terms of dollars to break that type of password. 554 00:42:49,020 --> 00:42:52,660 If you look at eight character passwords, I went ahead and at this point dropped the 555 00:42:52,660 --> 00:42:58,340 extrapolation data because the numbers that I'm multiplying were so high that I'm just 556 00:42:58,340 --> 00:43:01,820 assuming they were going to be wrong at this point because it was estimated from the beginning. 557 00:43:02,520 --> 00:43:06,020 But just working with the three things here, you can see that an eight character password, 558 00:43:06,180 --> 00:43:08,900 as you would assume, really kind of steps the bar up a bit. 559 00:43:09,260 --> 00:43:14,120 But if you're using a hash table on cowpatty, you're still at about $2 million for an eight 560 00:43:14,120 --> 00:43:18,280 character password. And with an MD5 password, you're at $40 million. 561 00:43:19,080 --> 00:43:23,400 So just as a potential conclusion that you could draw from here, if this was a home network, 562 00:43:23,580 --> 00:43:26,380 it looks like an eight character password if you were to attack the entire key space 563 00:43:26,380 --> 00:43:32,160 would keep you pretty safe. But if this was, let's say, a WPA network that Google decided 564 00:43:32,160 --> 00:43:38,120 for whatever stupid reason to store all their sensitive data on, an eight character password 565 00:43:38,120 --> 00:43:39,840 isn't going to do it. It's not secure enough. 566 00:43:40,900 --> 00:43:44,120 Now a ten character password and all of a sudden the numbers are quite different. 567 00:43:44,560 --> 00:43:50,460 You're in the billions, trillions on cowpatty, billions if you're using a rainbow table, 568 00:43:50,680 --> 00:43:53,820 and pretty large billions on a FreeBSD dictionary. 569 00:43:54,180 --> 00:43:57,620 So ten character password, if you really just want to be stupid and brute force the whole 570 00:43:57,620 --> 00:44:00,760 thing, you're getting into fairly safe territory here. 571 00:44:00,760 --> 00:44:03,600 But that's assuming that brute forcing is the only way to go. 572 00:44:04,720 --> 00:44:10,040 What about a dictionary attack? Now, the key space is massive, but here's 573 00:44:10,040 --> 00:44:16,360 an example of using dictionary words and assuming that each dictionary word that you use is actually 574 00:44:16,360 --> 00:44:21,080 run sort of like through John's, I forget the extension, but the ability to actually 575 00:44:21,080 --> 00:44:24,900 take one word and, well, let's reverse it, let's spot some characters, let's put some 576 00:44:24,900 --> 00:44:30,360 prefixes and suffix. So this assumes that you've got 10 million words and you do 2,000 577 00:44:30,360 --> 00:44:35,920 translations per word. What is the value of that type of approach? 578 00:44:36,380 --> 00:44:41,580 An example of how this can be useful is companies looking to keep their passwords secure. 579 00:44:42,340 --> 00:44:46,760 It's not uncommon for them to run a password through a dictionary and look for something 580 00:44:46,760 --> 00:44:51,000 common, but here's an example of the size of the dictionary you ought to be using to 581 00:44:51,000 --> 00:44:55,680 consider that to be a safe password. A 10 million word dictionary with 2,000 translations, 582 00:44:55,880 --> 00:45:00,340 so you're really looking at a 20 billion different passwords that are being translated. So that's 583 00:45:00,340 --> 00:45:04,480 still a couple of thousand dollars in CalPadi. It's really not a whole lot. If you use a 584 00:45:04,480 --> 00:45:09,760 hash, it's seven bucks. This could be any length of password. It could be any length 585 00:45:09,760 --> 00:45:13,280 as long as it fits within, you know, you're only going to try 10 million different words 586 00:45:13,280 --> 00:45:20,720 or combinations of words. And then it's also fairly inadequate on the MD5 password hash. 587 00:45:21,220 --> 00:45:27,920 Even if you extrapolate that to 10 trillion words, still with 2,000 different combinations 588 00:45:28,380 --> 00:45:30,320 per word, you're talking about 10 billion words. That's not a lot of money. You're 589 00:45:30,320 --> 00:45:35,660 talking with CalPadi, without rainbow tables, it looks pretty good. But with rainbow tables 590 00:45:35,660 --> 00:45:40,620 on a large-scale corporate or enterprise network, that's really not a whole lot of money. And 591 00:45:40,620 --> 00:45:47,040 with the FreeBSD, you're talking $133 million. That's a fair chunk of change, but again, 592 00:45:47,180 --> 00:45:52,380 if this is the Unix system account to Google's financial data or something else critical 593 00:45:52,380 --> 00:45:59,120 that a password is protecting, it very well could be insufficient still. And that is a 594 00:45:59,120 --> 00:46:00,300 massively large difference. So, again, it's not a whole lot of money. You're talking 595 00:46:00,300 --> 00:46:03,940 about a large dictionary. So while brute forcing isn't very effective, 596 00:46:04,200 --> 00:46:08,140 walking that line between having a password that you can remember that you're completely 597 00:46:08,140 --> 00:46:14,040 sure isn't somehow even accidentally based on extrapolation of a large dictionary file, 598 00:46:14,280 --> 00:46:18,800 which you're talking, I mean, even all the words in the human language is going to be 599 00:46:18,800 --> 00:46:23,560 under a million, I would assume. Even if it was 100 million, you're still talking about 600 00:46:23,560 --> 00:46:27,940 several combinations of each word and then still run through multiple permutations. 601 00:46:28,080 --> 00:46:30,280 It's pretty likely, with a file of that size, that it's going to be less than a million. 602 00:46:30,300 --> 00:46:35,180 But you could get most passwords, and you're still talking about a pretty reasonable amount 603 00:46:35,180 --> 00:46:38,300 of money to spend, depending upon what you're trying to get to. 604 00:46:40,120 --> 00:46:44,080 Right. Right. This is a worst-case scenario, and that's the whole point here, is to take 605 00:46:44,080 --> 00:46:48,940 what password are you currently using. Are you really confident that if I had a 10 billion 606 00:46:49,480 --> 00:46:54,560 password dictionary that I was trying several combinations of each word on, I wouldn't come 607 00:46:54,560 --> 00:46:59,960 up with the password you chose? Whether it was 12 characters, 24 characters, if it's 608 00:46:59,960 --> 00:47:04,260 still based on something mnemonic, it's very likely that it would be found in a dictionary 609 00:47:04,260 --> 00:47:09,540 of that size. That's still a reasonable amount of money to be spending, depending upon the 610 00:47:09,540 --> 00:47:14,920 data you're trying to get at. Again, where's the impact? The impact comes 611 00:47:14,920 --> 00:47:19,420 from the fact that you're not actually buying these servers. Whether you're renting it illegally 612 00:47:19,420 --> 00:47:25,200 off of a botnet from a black hat standpoint, you're doing it legitimately off of cloud 613 00:47:25,200 --> 00:47:29,840 computing services, or you're, for whatever reason, using off time on your existing enterprise 614 00:47:29,960 --> 00:47:33,220 network with a large number of machines. There are several different ways in which 615 00:47:33,220 --> 00:47:38,180 you can utilize this to not only test your own passwords and come up with the dollar 616 00:47:38,180 --> 00:47:41,700 value strength of your passwords that you can compare against the data that you're trying 617 00:47:41,700 --> 00:47:47,840 to protect, but this is something that can, and perhaps even already is in use on botnets 618 00:47:47,840 --> 00:47:52,320 already. The amount of traffic, particularly if you're not wanting to watch the actual 619 00:47:52,320 --> 00:47:58,400 keys per second, can be almost zero. You really just need one packet to start it, and one 620 00:47:58,400 --> 00:47:59,940 packet per client per second. That's a lot of data, and it's a lot of work, and it's 621 00:47:59,940 --> 00:48:04,100 a lot of response to end it. That's it. With a million, you're talking a million 622 00:48:04,100 --> 00:48:06,960 clients, you're talking a million and one packets, perhaps, spread out over the lifetime 623 00:48:06,960 --> 00:48:11,880 of the attack. It's something that could be very easily hidden inside of botnet traffic 624 00:48:11,880 --> 00:48:19,700 as is with spam and other data. Also, everything's getting faster. One particular 625 00:48:19,700 --> 00:48:25,020 cloud computing option just doubled, well, actually two and a half times increased their 626 00:48:25,020 --> 00:48:28,720 processing power for the same amount of money between the beginning of this year and today. 627 00:48:29,940 --> 00:48:34,800 Even if you're going to just assume Moore's Law, then these dollar values cut in half 628 00:48:34,800 --> 00:48:40,360 every two years, but the current rate of cloud computing, I assume because it still 629 00:48:40,360 --> 00:48:47,080 is new and the actual cost isn't quite clearly known yet, it's still changing. These numbers 630 00:48:47,080 --> 00:48:51,220 are going to continually decrease every day, and the passwords will become cheaper and 631 00:48:51,220 --> 00:48:59,240 cheaper and cheaper to break. Again, a recap, that password strength is a good way to measure 632 00:48:59,240 --> 00:49:03,880 the safety of your data. The strength of your password should correlate to the value 633 00:49:04,420 --> 00:49:08,760 of the data you're trying to protect. With this method, you can now apply a dollar value 634 00:49:08,760 --> 00:49:14,120 to the strength of your password, and then you can correlate that to whether or not you're 635 00:49:14,120 --> 00:49:18,960 sufficiently securing the data that you're trying to secure. In most cases, I would argue 636 00:49:18,960 --> 00:49:23,340 at this point that you're not being very effective because most passwords that won't fall into 637 00:49:23,340 --> 00:49:28,620 a potential dictionary-style attack of this scale are probably too hard to remember. Now, 638 00:49:28,620 --> 00:49:31,640 you've got the post-it note problem. You wrote it down somewhere, or you wrote it 639 00:49:31,640 --> 00:49:38,100 down in a system that's protected with another easier password. Either way, ultimately, you're 640 00:49:38,100 --> 00:49:44,120 stuck with most likely a mnemonic password system, which ultimately can be found from 641 00:49:44,120 --> 00:49:52,160 a dictionary. Rainbow tables make it even easier. I'm done. 642 00:49:54,560 --> 00:49:58,540 Just 30 seconds on what next. There's a lot more that can be done with this 643 00:49:58,620 --> 00:50:05,080 tool, including, for instance, that dictionary approach of splitting, trying 2,000 different 644 00:50:05,080 --> 00:50:09,020 or more combinations per word. All of these things can be easily added to the Python side 645 00:50:09,020 --> 00:50:12,640 of the framework instead of the C, and make it very easy to distribute it out across the 646 00:50:12,640 --> 00:50:16,600 attack. Q&A is across the hall. 647 00:50:19,660 --> 00:50:20,940 Okay. That's it. Thanks, guys.