Crunch is a tool in Kali Linux used in creating custom wordlists for passwords cracking.
Entering the command man crunch yields documentation manual for the tool.
The basic syntax for crunch is
kali > crunch <min> max<max> <characterset> -t <pattern> -o <output filename>
min = The minimum password length.
max = The maximum password length.
characterset = The character set to be used in generating the passwords.
-t <pattern> = The specified pattern of the generated passwords. For example if we know that the target’s birthday was 18th June and we suspected they used their birthday in their password, we could generate a password list that ended with 0618 by giving crunch the pattern @@@@@@@0618. This word generate passwords up to 11 characters (7 variable and 4 fixed) long that all ended with 0618.
-o <outputfile> = This is the file we want our wordlist written to.
We can also use the -f switch to specify a character set, we want to use to create a our wordlists with.
-f /path/to/charset.lst <charactersetname>
In Kali Linux we can find the character set in the directory
Let assume we know that our target uses a password of length between 4 and 8 characters. To generate a wordlists containing passwords with such length we enter the command. Crunch will also tell us how much space the created wordlist will consume.
Now say our target uses numbered passwords of length between 7 to 9 characters. Now let’s generate passwords that meets such criteria and save them to a file.
One of the common trend is people including their birthdays in their passwords to make it easy to remember. Say we know the target’s password is 29th June, 2020 and they are likely include that in a password of 9 character length. We can use this fact to generate passwords that are of 9 character in lengths and end in 290620.
The @ sign is use to represent a wildcard of all possibilities, while the literals “062920” represent the fixed values.
With Crunch we can also create our wordlists using a particular character sets. Kali Linux comes character sets which we could find in the directory: /usr/share/rainbowcrack/. Let’s open it with a leafpad text editor.
Now assuming we know that our target is using 6 character password that comprises of lowercase alphabets. Then we can easily use Crunch to generate such passwords.
To create a 6 character length wordlists using the characters from my name faisal that always ends with the number 24 at the end and without repeating a character consecutively more than twice in a word, save the output in a file called faisal.txt and compress the file as gzip we run the following command.
Actually there is more to Crunch that what is presented here. The manual will enable you unleash the full potential of crunch.