Well, thanks for coming to this talk. I'm Matt Weir. I'm from Florida State University, and this talk here, as you can see, is a password cracking on a budget. Before I begin, there's a couple of people I just want to thank. First of all, Bill Glodek, who is another research student, who unfortunately for me graduated, but he did quite a bit of the work here. Professor Sudhir Agarwal, my major professor, Professor Breno, and then also the National Institute for Justice for funding this research. So I really do appreciate that so I don't have to teach all those intro to C++ classes there. Real quick about me, just so you know who the hell I am. As I said before, my name is Matt Weir. I'm currently a PhD student at Florida State University. Before I decided to go back to college and take a significant pay cut, I was a network security engineer for Northrop Grumman TASC. In the last project I was on, I helped support the JTF Joint Task Force Global Network Operations with some of their forensics investments. Also, just to let you guys know, I have had my password stolen in the past, so this hits a little close to home. In fact, I discovered that during the course of this research. A lot of what we do is try to figure out how people actually create passwords. In order to do that, what we do is we look at disclosed password lists. So like a hacker will break into a site, they'll steal all the passwords, they'll post them online, and then we take a look at them to try to figure out what they are. If they just post the hashes, then we actually have to go ahead and crack those passwords in order to try to figure out how to figure out how people create those passwords in the first place. So a long time ago I played a video game called Batmud, which is way better than World of Warcraft. But unfortunately they didn't have a very secure website apparently. So as I was going through these lists here, I was like, oh hey, I know these people, that's my username. Crap, that's my password. So this has hit a little close to home here for me. But I think that's actually fairly common. If you think that every single website that you've ever entered a username and password into is going to be a password, then you're probably wrong. You're probably not going to be able to get the password. But if you have a website that is really secure and never been broken into, you're kind of probably at the wrong conference here. Now I'd like to have a disclaimer before my talk, just so you notice and can walk out early if you want to. But I'm a student and I crack passwords in a research-type setting. So we're not really getting hard drives and encrypted files and having to crack them. Instead we're going ahead and we're cracking these big old password lists here. So some of the tools that we do use may be a little bit different than what you would use in real life here. But hopefully the techniques are fairly similar. Also, I'll freely admit I've been wrong about many things before. I'll probably be wrong about a lot of stuff in the future. So I certainly don't claim to know everything there is about password cracking. And in fact, quite a bit of what we've been doing I kind of feel has been reinventing the wheel. Because password cracking has been something that's been out there for a long time, but it's not really well documented. So we've had to kind of rediscover a lot of it ourselves. And actually that's kind of the goal of this talk here. If you are just setting up your own forensics shop, or you're a system administrator, the last system admin left and then passed down all the passwords and now your boss is telling you you need to go ahead and crack these passwords, what do you do? Because a lot of stuff online pretty much just says, like, run John the Ripper or Cain and Abel, and leaves it at that. Or maybe gives you a CISSP overview of how to crack passwords. But trying to actually apply that in real life is a lot different, I've found. So really, all this talk is, is just if you're put in that position, how can you maximize the chances of you cracking that password? So since I do tend to kind of wander a bit, I figured I might at least give you an overview of what we're going to be talking about. At the very beginning we're just going to start real quick with just some password cracking basics. Just so everyone here who wandered in kind of were on the same level. And also kind of tell what we've been focusing on as far as our research goes. Then we're going to go ahead and talk about input dictionaries. Word lists. A little bit about where to get them, but more about how to generate them yourselves. Or at least some of our work at trying to generate them. Because a lot of the word lists online are, leave a little bit to be desired there. And then we're going to talk about word mangling rules. How you go ahead and pick them. A little bit of advanced John the Ripper. And then finally, some of our research that we've been doing on trying to automatically generate word mangling rules. Because doing that by hand is a real pain. Also, because this is a 50 minute talk, we're going to talk a little bit about how to generate word lists. From the start let me just talk about some of the way we've been doing it, and then after the talk, and that's probably the worst way to give information about technical stuff in the world. Please, my email address is here. It's on the slides on your CD. If you have any questions, go ahead and let me know. Also, I'll be available in the, you know, Q and A room afterwards. Please show up. Grill me. We can geek out about word lists and stuff like that. But it's really important for me that this research actually has some application in the real world. I don't want to just go ahead and write papers that don't really apply to anything. At the end of the day, if no one's actually using this information or it's not worthwhile, I'll go ahead and I'll try to research something else. Please get in touch with me. If you think what I'm doing is wrong or you think these tools are crap, please let me know, as long as you can tell me maybe a better way or some way to improve that crap there. If you have some good ideas that you want me to look at, we're research students, we're always looking for the stuff to work on, so please, you're not bugging me if you go ahead and contact me. Also, you might want to copy down that URL at the bottom there, because that's not on the slides. All the tools, all the scripts and stuff like that, we're providing online. Unfortunately, our main website, which is on the CD, is currently down right now, because our system admin took it down to make sure it's all patched up and stuff like that, because he said that some people were banging away on that. That's my fault, and now I learned that before you give a talk at DEF CON, you might want to give more than a week's worth of notice. So I apologize for that, but I threw up it on Google Pages there, so it's just reusablesec.googlepages.com, and you can download all tools and scripts. Real quick about password cracking, don't worry, it does not give me a CISSP prep course. There's really two types of password cracking when people think about it, online and offline. Online, we really don't care about too much. This is what people are trying to do to our website a couple days ago. The site's online, or the computer's online, and you're just going to try different username and password combinations to a site that's currently operating. The research that we've been doing really doesn't apply to it that much, because on online password cracking, first of all, it's generally very slow, so you're very limited by the number of guesses you can make. And it's noisy, so the system admin actually looks at the logs, which happens every once in a while. It really shows up. But more importantly, too, you're often only limited by the number of guesses you can make before the system locks you out. You try four passwords, if you get it wrong, then you're locked out of the system. What we're really focusing on, though, is offline password cracking. This is the computer forensics. You obtain the warrant, you broke down the door, you seize the hard drive, you get back to your shop, and all of a sudden you realize, well, this hard drive's encrypted, or there's encrypted files on here. How do we go about breaking these? When you get into that situation there, you're really limited by the number of guesses you can make before the system locks you out. You're really only limited by the amount of time you can spend trying to crack these passwords, and the amount of computing power you can throw at the problem. I'll be talking about password hashes a lot. It really just comes down to, hopefully, your computer, your bank, the website, doesn't store passwords in plain text, because then there's no need for password cracking. Someone breaks into the site, they see all the passwords, they're done, they can have a beer. Most sites go ahead and they store a password in a one-way cryptographic function. You just get massive amounts of passwords in there. You can't figure out what it is very easily. Let's say a user goes ahead and creates the password DEF CON. The computer will not save the word DEF CON on the computer, hopefully, in theory anyway. There's a couple talks about this later where it sometimes does. Instead, the computer will hash the password. The MD5 hash of DEF CON is that long string there. To log in, though, it stores that hash instead of the actual password. When you log in, you type DEF CON in again. The computer hashes that password, and it compares it to what it has stored on the computer. If those two hashes match, it goes ahead and logs you in. Cracking passwords is very similar. You just make a whole lot more guesses. You make a guess, you hash a guess, you compare it to the hash that's on your hard drive, and if those two hashes match, you've cracked the password. Really, the question is, how do you go ahead making those guesses intelligently? Hashing those guesses takes a lot of time sometimes. There are really two main ways that you go about trying to crack a password. The first one, which we're going to be spending most of our time on, is a dictionary attack. You take words from an input dictionary that contain words that you think someone might want to use to create their password, and then you mangle it in a way that people normally do when they create passwords. In your input dictionary, you might have a password, and you try that. If that doesn't work, you try password 11, or capitalize P and replace the A. This is what people normally think about when you talk about password cracking. When we crack these lists here, we hit what we call a brick wall after a certain point. Initially, when we start cracking passwords, we're doing really well, because we're cracking lists of a couple thousand passwords. Initially, we'll crack a couple hundred, and then we'll go down to cracking maybe 10 an hour, and then maybe one an hour, and then one a day. Then, pretty soon, we're to the point where we're cracking maybe one a week, and we're like, why are we doing this? We've got to move on to the next list there. We call that the brick wall, because you go a long, long period of time. It's like hitting a brick wall where you're not cracking any passwords, and it seems like you're just spinning your wheels. When you're doing a dictionary-based attack, it's really frustrating, because you've got to figure out why you're not cracking those passwords. You don't know until you actually crack the password why it was. You could not be just trying to write dictionary words. Your dictionary could be poor. It doesn't have the word in it. It doesn't have DEF CON in it, so you're not trying that. Or, you might not be trying to write word-mangling rule. The person might have capitalized the first letter, replaced A with an at symbol, and added 11 to the end of it. You're just not trying that as your word-mangling rules. It's really hard to figure out, when you're trying to crack these passwords, do I try more dictionaries? Do I start with more dictionary words at the problem? Or do I try more advanced word-mangling rules on the dictionaries I'm currently using? This is a real trade-off, because you're always limited by the amount of time, the amount of guesses that you can make. The bigger your dictionary, the less word-mangling rules you can apply to that dictionary. And vice versa, the more word-mangling rules you do, the less word-mangling rules you can apply to that dictionary. The smaller dictionary that you have to do to apply to those word-manglings, too. So it's a real trade-off. And then there's brute force, where you just kind of go through it. We're just going to go try every single possible combination. And don't let anyone tell you anything differently. Brute force is wonderful. I love brute force if you can do it. The problem is this is password cracking on a budget, and generally brute force is not an option for longer passwords. But if there's no password creation policy, it still helps you get a lot of passwords that you normally wouldn't get with a dictionary-based attack. So here's some examples of some real passwords that crack with brute force, like VPTP. That's not going to be in my dictionary. It's not a real dictionary word. I have no idea how they picked it. But since it's really short, it's easy to crack with brute force. Another one, WFX8ZJ. Once again, I'm not going to crack it with a dictionary-based attack. And luckily, they didn't make it one more character longer, because if they did, I wouldn't be able to crack it with brute force. But since it was only six characters long, I was able to crack it. 00K00. So that's kind of just something that they can remember. Once again, it's very resistant to dictionary attacks. And the final one that kind of just annoys me is Wii, for Nintendo Wii, I think. And this just kind of points out that dictionaries are only good when they were made. So most dictionaries are fairly old. If someone's favorite band is MC Hammer, you're golden. But if you like Linkin Park, even though they're old, too, you're probably not going to crack to find it. Anything recent, it's very hard to keep these dictionaries up to date. I want to run a few demos just so I can have stuff break in front of a couple hundred people. I guess the real question is, how good can I do if I just do the script kitty type thing? I go online, I download John the Ripper, I download a couple of these word lists, and just run them. That's an honest question. If you can do really well with that, then you can just walk out and go to a different talk. You don't have to listen to me talking here. If you'll excuse me, I'll be kind of lame and just copy and paste these commands so I don't fat finger them. What I'm going to do is I'm just going to go ahead and run John the Ripper with the default rule set. Also, we're going to go ahead and we're going to crack half the MySpace password list. A long time ago, one of the more famous disclosed password lists was someone set up a phishing site at MySpace and managed to grab about six 60,000 MySpace usernames and passwords. We feel that these passwords are very representative of what normal people would do when they create a password if there's no strong password creation policy. Also, just so you know, we split these password lists up into two different parts whenever we get a plain text password list, mainly because it's really easy to create password cracking rules if you know all the passwords beforehand. This way, we'll have a training set and a test set. We don't look at the test set at all, but we do look at the training set to try to figure out how people create passwords. Then we go ahead and try to make our rules and crack the test set. If the passwords are hashed when we grab them, the whole thing is a test set because you have to break them in the first place. Also, just so you know, these passwords are not hashed. I'm just outputting them to the standard out and just seeing how many of them we cracked with John the Ripper's rule set. The reason for that is that this is a 50-minute talk and it would be really boring just to watch his crunch numbers here. If this was hashed with, let's say, MD5, this test here would have just taken about an hour. So, I'm going to go ahead and do that. At the very end of the talk, we could have looked at it and it would have been pretty boring. If this has been hashed with a stronger hash like Linux's or Unix's Crip5, which does a thousand MD5 hashes, we'd have to definitely extend this talk time a little bit for this. Just to give you an idea, an hour if this was hashed with a very basic hash, a thousand hours run this test here if this was a stronger hash. We used just a basic words.english.text dictionary, which is one that you find in all the different password crash tests. This is no longer the case anymore. If you're running a script hacking websites. And it ran there, and then we managed to crack 3.2% of all the passwords there. So yeah, I mean, if you're only trying to crack one or two, that'd be great. But if you want to tell your boss, hey, you know, we were setting up a forensic shop here, and we have a 3.2% chance of cracking these passwords, that's probably not going to cut it very well. So the next question is, could we just be using the bad word list here? Actually, you always hear about people always using the same common passwords. So why don't we go ahead and use a word list of just common passwords? And this, once again, is just downloaded offline here. It's like 816 most common passwords. Ran really quick, only 41,000 guesses versus the 10 million guesses from the previous one. And we cracked 1.71% of the passwords. So once again, I mean, that's actually pretty nice. It's very few guesses, but still, you're not even cracking double digits. So let's go ahead and use a bigger dictionary. And this dictionary's description is, the big dictionary. It's dic0294. And this is going to actually take a couple seconds here. And this is actually, just so you know, one of the few good big dictionaries that I've had experiences with. And I'll complain about big dictionaries a little bit more later. But hopefully I'll do it in a minute here. Oh there we go. And finally we're cracking double digits. Okay. So I mean it, but it took much longer there. It took 37 million guesses. But we did manage to crack 19% of the passwords. So this is actually starting to get a little bit semi respectable here. And finally we're going to talk a little bit about custom dictionaries in a little bit here so i might as well go ahead and uh try one of these here real quick just to show you so this is a custom dictionary it's actually based off of wiktionary and wiktionary is a sister project to wikipedia it's an open source dictionary and they actually provide them in a whole bunch of different languages which is really nice so this is actually we're running it off the english dictionary off of wikipedia that we did and this generated much less guesses than a big dictionary um it's this only generated about three million guesses compared to the you know 31 million guesses of the big dictionary here so about 10 but we still managed to crack 12 of the passwords so um using custom dictionaries can definitely help you especially if the hash is really strong cool nothing blew up okay and just in case that wouldn't work there so you can just see a graphical representations that's the top ones a number of guesses and the bottom ones number of passwords cracked there so so you can see uh uh just how well they did there so the first thing i guess we should talk about though is word lists you know how important is a word list to um your password cracking as you can see from that previous demo it actually is extremely important unfortunately it's also boring as hell um i'll freely admit that if you're not doing password cracking currently or you don't enjoy you know organizing your sock drawer this is probably not going to be the most interesting thing in the world um there's probably actually a big overlap between password crackers and people who do like organizing a sock drawer actually uh but so we'll but i'll just hit the high points and once again if you want to meet afterwards and like that we can geek out about word lists so there's a lot of places to find word lists online in fact most of them have the exact same word list so they all steal from each other and try to talk about them being the ultimate word list site um the first one i really want to point out is uh the open wall.com ftp site is for uh john the ripper uh if you go to their website normally they don't really advertise all their word lists because they want you to spend money and buy their uh actual uh big word list which i don't blame them i like to spend money on them i love capitalism uh but if you go to their ftp site you can download a bunch of word lists from them the other two sites below that are just kind of general uh you know uh word list sites uh one site that's kind of want to make fun of a little bit uh please don't hack me if you're in this audience is uh the argon.com and they have the ultimate gigantic word list uh they say it's uh two gigabytes large and everyone says oh it's gotta be good it's two gigabytes of words and that actually has to be one of the worst word lists i've ever played with um first of all so large you can't do any word mangling rules on it it takes forever to run and it there's just so much duplicate so much junk in it that it really doesn't crack passwords very well um about the only password i managed to crack was that that impressed me when i just ran it one time is one guy decided for his password to use an html markup tag which i have to admit you know is a really good password because there's all the symbols uppercase lowercase and all that um and i wonder what he does for a living uh but that was just um in one of the web pages they sucked down he had the exact same html markup tag so i was able to crack that um the last site i just want to point out if you get i'll go on bit torrent you can find it is an exploits master password collection it has a ton of different word list on it but it also has uh what look like passwords on that too i don't know if they actually are passwords or not which is why i can talk about it uh but uh it's really good if you're just starting to try to do your own password cracking research you can go ahead go log on to that and uh try your tools against the the things on that as well and they don't have email addresses on it or anything else like that so i don't feel bad about this because just random passwords so with these word lists here um there's a lot of stuff that you need to be really kind of anal retentive when you're uh dealing with them in order to really help you out later and every single time i try to cut corners with this i've gone seriously burned uh but just things you need to think about was you know when you're managing your word list are you know you want to avoid duplicate words it seems pretty simple but uh it's actually a pain in the butt sometimes especially when you have multiple word lists that you're trying and you can't remember which one you did previously and stuff like that uh but you can't really do that because you're duplicating words equals wasted work because you already tried those guesses before you also got to ask yourself how are those words terminated are they terminated by a tab a space a new line a carriage return and that's really important uh most password crackers are fairly smart about uh dealing with that but if you're writing any custom scripts that can really bite you in the butt which i found out myself too standardized capitalization um how many artifacts are in the word list how many html tags are there you know how many time stamps and junk data just when you try to create the word list because you're not going to go ahead and copy paste all these word lists here and then finally is the word length's important and this is not really for you know the hash that you're doing because most password crackers are fairly smart about that uh but more along the lines if you want to do case mangling because if you have a really long word you want to try every single possible case mangling in that um you're going to spend all day on that one word just trying to case mangle it uh so you might want to terminate it if you're doing a serious case mangling now as i said the word list you find a line leave a lot to be desired so first thing you probably might want to do is if you're a forensics investigator you have the hard drive in front of you and it's you're trying to crack individual files on the hard drive is to try to find to see if you can find a password anywhere else on that hard drive and for that type of research i really want you to point you to david smith's georgetown university and he's doing some really good work and he's doing some really good uh tools for uh parsing that hard drive grabbing out potential passwords uh to try them next thing creating word lists by hand it's a pain but in some cases it can be really effective uh probably the best success i've had is uh swear words in different foreign languages because people using swear words in their password is pretty much an international type saying uh so i've gone to a bunch of different sites you know swear words finnish swear words german and stuff like that uh led me to some interesting sites too uh but just creating those custom word lists there um really work quite well now if you want to go ahead and script this on your backtrack uh that you can use as well uh that works a lot better than wget because it'll actually parse out some of the junk as well it's not perfect but you know it's better than you know doing it by hand sometimes especially if you're grabbing lots of different uh word lists now we created some custom word list uh generation as well um as i mentioned earlier wiktionary uh a lot of the foreign language word lists were really really really poor they didn't have much in them the some of the characters were messed up in it and so on uh so i i wanted to go ahead and create the uh a password crack or crack passwords in foreign languages because um like finnish and swedish all those norwegians really seem to like disclosing passwords uh so i looked at wiktionary i was like i don't want to do that by hand uh so i created a program called uh you know wiki grabber that will go online you can specify you know what language you want uh it'll go ahead and download it you can and since we're doing some passphrase research as well you can actually specify that you want only grab nouns or only grab verbs or adverbs and it actually makes pretty good word lists um the next step of course we are thinking as well if we're already doing this for wiktionary why don't we create something for wikipedia so we can create customized word lists based upon someone's interest so you know if they're a hacker we might do you know hacking beer you know vodka and um you know vegas and just grab the wikipedia pages for that uh that's actually still needs quite a bit of work because i didn't realize it before i started working on this here uh but trying to find the right words on wikipedia is actually fairly difficult so if you do beer for example you'll find out a lot of information about you know the fermenting of the word list and the fermenting of beer the history of beer and so on but you're not going to actually find beer names like amstel light or boddington's for that you'd actually have to go to the individual country's beer list and that's actually not linked off the main web page for beer there so trying to find that it's still hard there's still a lot of work to be done to make that a little bit easier but that's also on the cd and on our website now the next thing we saw was we got a whole bunch of cracked passwords already if someone used a word in their password before the chances of someone else using that word are very high so we wanted to go ahead and parse our cracked password lists and try to make you know customized dictionaries to crack more passwords and that actually works extremely well so the first thing we did was uh we went ahead and extracted you know the alpha characters from a password so um and you use that as a word and you can make certain like judges there so if you have you know an at symbol between two letters that was probably you can probably change that to an a and so on you strip out special characters and so on uh and that as i said uh we've had extremely success with that but uh we were a little bit worried that we're just missing words uh there's mangling rules there that we don't know about because we're dealing with you know tens of thousands of password lists you're not going to look at each one individually so we wanted to go ahead and just try to see if we can uh parse out the low-hanging fruit and look at the remaining ones and try to figure out how they were created and to do that we went ahead and decided uh use edit distance of uh passwords so you're all probably actually familiar with edit distance if even if you haven't really uh dealt with uh that term because uh it's using all the different spell checkers out there so you know you type death or test instead of uh it realizes you know okay you know you might you switch to h and e because that's a very close word there well we thought why can't we go ahead and use that with uh passwords as well with analyzing these so in a normal add distance you have rules like delete swap transpose and insert so change apple to apply it would have an add distance of one because you only need to change the e to a y and then you can match the words based upon whoever has the closest edit distance we decided to add a few more rules to it to simulate how people create passwords so for example adding numbers to the end of a password is one edit so the apple 99 to apple would be having a distance of one and this actually worked really well it had some minuses and pluses but i'm pretty happy with it actually it does produce false negatives sometimes they'll say everything in reverse so it does it does the job even federally捷� it's using a dropbox but on an mise di prey account so it's started off from a standalone That was kind of a bad thing, so we're trying to do like best of breed, so we feed a bunch of different dictionaries and try to create one good dictionary that's really headed towards it. But what we found out later was that it's actually extremely good, though, for evaluating dictionaries. Because it's nice to be able to say this dictionary sucks or blows. It's much nicer in an academic setting to be able to say this dictionary sucks and blows because. So this actually helps us out quite a bit. And also it goes back to, remember when I was talking about hitting the brick wall, whether the problem is you're not trying to write enough words in your word list or whether you should try more word mangling rules? This actually gives us an idea of what is the theoretical maximum number of passwords we could crack with this word list here. And so if we try every single word mangling rule we can think of to crack this password list here with this dictionary, we're only gonna crack this many. So like the really big dictionary will crack about 50% of the passwords if you try every single word list. This is the only word mangling rule you can think of. So that's kind of the top bar there. The words.english dictionary can crack only 10% of them. Even though it has 200,000 words in it. So that's why we can say this one is not very good. Common password one, you can crack about 5.3% of all passwords, just with 816 words. And the Wiktionary one you can crack 32% with 68,000 words. And really the reason why this is good is when you, you're never gonna hit that limit really. Because there's always these crazy word mangling rules that you just don't have a chance to use. But when you start getting close to that, you can realize, okay, I probably cracked all the passwords I'm gonna crack with this dictionary here. Maybe I need to switch to another dictionary to try this. Or maybe go to brute force. So that really helps kind of eliminate the guessing on when you need to do, whether you need to add more words to the problem, or whether you need to add more word mangling rules. Okay, I'm actually gonna kick off the next demo here real quick, and then we'll come back to it later when I have a chance to explain it. So, hopefully it doesn't crash in the meantime. But this is actually gonna be our customized wordless, word mangling rule creator. Cool. So the next thing that we're gonna talk about is word mangling rules. So this is what everyone really thinks about with the password cracking, is how do you go ahead, how do you mangle these passwords here to recreate what a user's actually doing? And I have to say, the one thing that's really surprised me when I started doing this, is how limited most password crackers were when it comes to word mangling rules. And I think the reason for that is that Landman hashes, the old Windows hash, really spoiled us. Because old Landman hashes, they capitalized everything. So you don't have to worry about case mangling at all. And also, they're seven characters maximum, so it became pretty easy to brute force them after a while. So I think we kind of sat on our rear end there for quite a while with a lot of these password crackers. So it makes password crackers look really good when in fact they're not really doing that much advanced stuff. And one thing I found, I mean, it's very easy to crack passwords, or not easy, but it's fairly straightforward to crack passwords to have only one simple word mangling rule applied to them that everyone uses. So like 80% of, it's like 80-something percent of all people in these lists that we've been seeing here use two numbers at the very end of their password for when they create passwords. Or I think that's right. You might want to double check me on that one. That's why I love slides. I need to have the stuff. But a lot of them do, anyway. So that would be one great word mangling rule, really easy. But when you start combining word mangling rules, it gets actually very difficult. So this password here, password12, with a capital P, W, and an at symbol. That is an extremely strong password. I mean, passwords can be in every single person's input dictionary, so that's not a problem. But even though, doing that word mangling rule where you capitalize the first letter, you capitalize the fifth letter, you add two numbers to the end, and you change the A to an at symbol, putting all those word mangling rules together, it's very unlikely that you're actually going to go ahead and try to be able to crack that password there. So that's an extremely strong password, even though we can all see how easy it is to make. Also, if they use a non-standard rule, even one non-standard rule, the chances of you cracking it are very small. So like, password was just a 7 between the P and the A. Since not many people go ahead and use that as a word mangling rule, I'd be really surprised and kind of impressed if someone cracked that without resorting to brute force. The chances of it are very low, even though it seems like a really simple password. So if you're creating your password as a defender, I highly recommend just don't stick with the pack. Try something even a little bit different, and chances are, it'll make your password fairly secure. Now, one question I get when I talk to people here is, should I use Cain and Abel or John the Ripper? Because these are the two major free password crackers out there. And I love Cain and Abel, I have to say, because they put a lot of work into it. It integrates a lot of different things into it. You've got your art poisoning, your sniffing, and everything else. So it's a wonderful program, so I hate to trash it. But really, if you're cracking passwords seriously, you need to be using John the Ripper if it supports the hash that you're trying to crack. And the reason for that's pretty simple. Cain and Abel doesn't have very main word mangling rules at all. In fact, it's extremely trivial. It does adding two numbers to the end of a password and case mangling. And it doesn't even combine those. So if you have a password 1 with a capital P, Cain and Abel is not going to crack that, because it doesn't try capital letters and numbers at the same time. So Cain and Abel is fun to learn how to crack passwords on, but if you're cracking passwords seriously, you don't want to be using it. John the Ripper, on the other hand, is configured via a config file. So you can go ahead and you can get really crazy with all the different word mangling rules you can think of. And in fact, even if John the Ripper doesn't support whatever word mangling rule you want to use, you can always just create a custom script and pipe those guesses directly into John the Ripper since it's command line, which is really nice as well. So you can do pretty much any type of word mangling rule that you want to. Now, when you download John the Ripper, first of all, one thing a lot of people say is it doesn't support the type of hash that I need. And the answer to that is it probably does. Someone's written a patch for it. And so go ahead and find it. Download and install it. And it actually will support more hashes than KN-ABLE does. But you need to go ahead and find those patches. And actually, most of them are actually on the John the Ripper website. Also, I'd recommend against using the default John the Ripper config file. It's not actually bad, but you can do a lot better. Now, one thing that's kind of annoyed me, or it surprised me, is even though this is probably one of the most popular password crackers out there, I've yet to find somebody else's John the Ripper config file that they posted online. People just don't like sharing that information for whatever reason. So it's been kind of hard to tell what other people are doing. So I tried to solve that a little bit there. I included a couple of our sample John the Ripper config files on the CD. So that way, at least you can look at what we're doing and go, ah, noobs, you're doing it horribly. But at least now you have some examples of what some other people are doing. Also, the John the Ripper config file, it is kind of intimidating a little bit, and it's pain. And it surprises me, because I'll be talking to somebody who knows like three different scripting languages and a bunch of different programming languages. And they'll be like, oh, that John the Ripper config file, I can't figure that out. It's like, what? It's not that hard. But. But it just intimidates people a lot. But I mean, there's a rules.readme file there. I highly recommend reading it. I have it open all the time when I'm modifying it, because I forget how they do it. But I highly recommend, if you're going to be doing serious password cracking, you really need to take time to learn that. But because I'm kind of tired about everyone whining about that every single time I mention John the Ripper, I went ahead and I created a custom John the Ripper config file generator. It's menu driven, as long as you don't mind text. Oh, cool. Thanks. And it didn't make it to the CD. I'm sorry it's at the very bottom, the link to it. But once our main website will get up, it'll be on that. And it's on the download one right now at reusablesec.googlepages.com. I probably should have put that at the top there. I'm sorry. But not only would this allow you to go ahead and create custom config files and stuff like that, but I threw in a couple different things that I wanted. And you'll find it as well in this feature creed. First of all, you can save all of your settings that you have here so you don't have to retype them in every single time. You can go ahead and add specialized or password creation policies to this. So that way you don't have to modify all of your config rules every single time you want to try a different site. So you can specify, like, I want the password to be at least eight characters long, have two numbers, two special characters, and so on. Also, I've made it so it's very simple. It's very easy to change the character set as well that it uses. So that way you can switch between different languages as well, since it seems like all the password crackers out there focus on English, and I kind of want to share the love a little bit there. So that makes things a little bit easier. Now, as I said before, brute force is a wonderful, wonderful thing to use. But usually you don't have the option to brute force the entire key space. So there is kind of a halfway thing where it's called targeted brute force, where you try to brute force just the format of the passwords. So that way if your dictionary is poor, you can still maybe crack the password. For example, you might want to brute force six characters followed by two numbers. And that speeds things up a lot. So even though you're brute forcing characters and numbers, you're only trying characters in one spot and numbers in another spot. So it actually narrows down the key space quite a bit. Now, you can do that directly in John the Ripper. It's a bit of a hack. On the CD, there's some additional slides on how to do that, and I included a sample of brute force config file on the CD as well. But in reality, if you really want to get fancy with this, I highly recommend just writing a custom Perl script or something like that and piping it into John the Ripper. And that way you can get really fancy, too, and start adding Markov rules and things like that to really try to help speed up brute force. Cool. We're actually doing good on time. Okay. Now, with Ward-Mangling rules, though, we quickly found out that it really is a pain to specify them, because the first couple of Ward-Mangling rules are fairly easy. But as you get into more and more less probable Ward-Mangling rules, first of all, they take a long time to run, because if you add two numbers to the end of a word, you're trying 100 guesses. If you try four numbers on the end of a word, you're trying 10,000 guesses per word in your input dictionary. So you want to kind of narrow it down quite a bit, and you end up creating a couple hundred different Ward-Mangling rules, and then editing and managing it is a real pain. All right. So this idea was actually Professor Sudhir's idea originally, and it actually really works out pretty well. And that's why we create computers, is why don't we have them go ahead and analyze password lists, try to figure out how passwords were created, and create custom Ward-Mangling rules based upon that. So the actual name of this is Probabilistic Context-Free Grammar Ward-Mangling Rules. So you can tell what we're writing a paper on right now. But really, in theory, all it does is it tries to figure out how passwords are created, and assigns a probability to that Ward-Mangling rule. And it also assigns probabilities to every single number, every single special character, capitalization, and everything else along those lines that it finds in the password list. So it'll say one is much more common to be used than seven, and 99 is much more common to be used than 11. And really what it does then is it tries to generate the most probable passwords first. So right now, we have a fairly basic one that's on CD here. We're going to create a pretty basic one. It's a way of figuring out what the Ward-Mangling rule is. So for password 11, it would say, uppercase the first letter, have seven lowercase letters, and then two numbers. And there's definitely stuff we're looking into adding. It's pretty easy to add on to this, replace the A with an at symbol and stuff like that as well. Well, what it does is that structure there has a probability. The structure of numbers has a probability. And you can actually even assign a probability. You can assign a probability to input dictionaries. So you can say, this is a really common password, so I want to try a lot of Ward-Mangling rules on this. But this is a much bigger input dictionary that I want to try eventually on some of the more common Ward-Mangling rules. And it'll go ahead and it'll spit out the guesses in order for you. So it might try password 12 and then password bang before it tries password 13. So that way, it really specifies all these different Ward-Mangling rules really well for us. All right. All right. All right. All right. So let's get started. Now, our current implementation makes guesses and outputs them to standard out. So that way, we can go ahead and pipe this into any other password cracking program so we don't have to worry about the hashes and keeping track of which passwords are managed and so on. Because I'm lazy and I don't want to have to code all that. So right now, in most of our tests, we actually go ahead and output them standard out and input them into John the Ripper and use John the Ripper just to go ahead and do all the password hashing. Now, I'll admit this structure does have some overhead. That's why I didn't just flip, flip and flip. run it immediately. But the overhead is actually fairly low compared to a strong hash, or even a semi-weak hash. We have used this actually successfully in real-life cases. This is not saying that you run for a couple days and it takes ten times as long or so. Because we have a graph, and I'll show you the results in a little bit, and I'll talk about this graph here afterwards if you want to, but this kind of shows the number of passwords we crack over time versus John the Ripper. Initially, during very high probability rules, we do pretty much the same. In some cases, John the Ripper does a little bit better. But after a certain point, ours starts to do much, much better. Unlike John the Ripper, where you have a set number of word-mangling rules and it's done, ours has just millions of word-mangling rules. They're very small, but they're still millions upon millions of word-mangling rules. If we let this run, it'll just keep on going and going and going, and we don't actually have to specify all these different word-mangling rules. Which is really nice. Now we get to check to see if anything crashed or not. Oh, cool, it looks like it actually worked here. First time for everything here, yep. Once again, we trained this one on the training set of the MySpace rule, and we're trying to crack the test set. If you want to see some graphs and stuff like this of us training it on different password lists and then trying to crack other password lists, talk to me in the after-talk room, and I got some graphs and stuff like that, because we've definitely looked at this too. But with John the Ripper, with the English word list, it cracked 3.2% of the words. With our password cracking thing, we cracked 5.6% of the words. With the common passwords, John the Ripper cracked 1.7%. Using the same number of guesses, we managed to crack 2.9%. So it's not perfect, but... And the Wikipedia English one. John the Ripper cracked 12%. We cracked 21%. So in most cases that we found here, it does much better than John the Ripper. That's pretty much it. Oh, yeah, here's just some graphs so you can see the number of passwords cracked there versus John the Ripper. Oh, I don't have it right now. So... slideshow. That would explain it. So that's it, though. If anyone has any questions, feel free to ask now or talk to me in the talk room here. That's my email address. As I said, please email me if you have any ideas or anything like that. If you have any password lists you want us to crack, as long as they're legal, I'll definitely take a look at those as well. And that's our web page.