Using John the Ripper to generate a dictionary

John the Ripper is perhaps the favorite password cracker of most penetration testers and hackers in the world. It has lots of features, such as automatically recognizing the most common encryption and hashing algorithms, being able to use dictionaries, and brute force attacks; thus, enabling us to apply rules to dictionary words, to modify them, and to have a richer word list while cracking without the need of storing that list. This last feature is the one that we will use in this recipe to generate an extensive dictionary based on a very simple word list.

Getting ready

We will use the word list generated in the previous recipe, Password profiling with CeWL, to generate a dictionary of possible passwords.

How to do it...

  1. John has the option of only showing the passwords that he will use to crack a certain password file. Let's try it with our word list:
    john --stdout --wordlist=cewl_WackoPicko.txt
    
    How to do it...
  2. Another feature John has, as mentioned before, lets us apply rules to modify each word in the list in various ways, in order to have a more complete dictionary:
    john --stdout --wordlist=cewl_WackoPicko.txt --rules
    

    As you can see in the result, John modified the words by switching cases, adding suffixes and prefixes, and replacing letters with numbers and symbols (leetspeak).

  3. Now we need to do the same but send the list to a text file instead, so that we can use it later:
    john --stdout --wordlist=cewl_WackoPicko.txt --rules > dict_WackoPicko.txt
    
    How to do it...
  4. Now, we have a 999-word dictionary that will be used later to attempt a password guessing attack over the application's login pages.

How it works...

Although John the Ripper's aim is not to be a dictionary generator, but to efficiently use word lists to crack passwords (and it does it very well); its features allow us to use it to expand existing lists and create a dictionary that is better adapted to the passwords used by modern users.

In this recipe, we used the default ruleset to modify our words. John's rules can be defined in its configuration file, located in Kali Linux in /etc/john/john.conf.

There's more...

More information about creating and modifying rules for John the Ripper can be found at: http://www.openwall.com/john/doc/RULES.shtml

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.20.90