Kali Linux is filled with a myriad of tools to help in security testing. Wordlists play a crucial role in various cybersecurity tests and password-related tasks.

With the crunch command on Linux, you can generate different types of wordlists to use in your security tests, and mastering the crunch command will be a valuable addition to your skill set. Here’s how to install and use crunch efficiently to generate wordlists on Kali Linux.

crunch -h command to check help in linux

How to Install crunch on Kali Linux

The crunch command usually comes preinstalled on Kali Linux. But if you do not have it, you’re able to easily install it from the official repositories. But first, update your system repositories with:

Install the crunch package with:

How to Use the crunch Command on Linux

To learn more about crunch, run:

This gives a brief introduction to the crunch command and its syntax.

For a more detailed and in-depth view of the crunch command and its various options, check out its manual page orget command-line helpwith:

The Basic crunch Syntax

The basic syntax of the crunch command is:

minrefers to the least number of characters you want crunch to generate, whilemaxis the largest number of characters you want to generate.

If you want the same number of characters, set the min and max values to the same number. There are a lot of options provided by the crunch command to make different types of wordlists.

To create a wordlist with all combinations of the characters “abc”, each of length three characters, run:

Set Character Ranges Using the crunch Command

You can customize your wordlists by defining specific character ranges, e.g. all numbers, letters, or just symbols. For instance, to generate a list containing all lowercase letters with a length between four and six characters, run:

To generate a wordlist of just numbers, run:

You can specify the length of the characters.

Output the Wordlist to a File Using crunch

you may use the-ooption to specify the output file for your generated wordlist. To create a wordlist comprising combinations of the characters “abc123”, each consisting of four characters, and save it to a file named “wordlist.txt”, run:

Use Bruteforce Mode in the crunch Command

The-boption allows you to specify a character set for brute-force generation. The normal mode of crunch generates wordlists with combinations of characters from a specified set for a given word length range.

The-bmode is more extensive as it creates wordlists by generating permutations of characters from the base set, allowing it to cover all possible combinations.

This command generates a wordlist with all possible combinations of the characters ‘“1234567890abcdef” with a length of six characters and saves it tobruteforce.txt.

Use the Combination Mode With crunch

The-coption is used to generate combinations of characters from multiple sets.

This command creates a wordlist that combines characters from sets1and@%to generate all possible eight-character combinations, saving them incombinations.txt.

Create Wordlists With a Custom Pattern Using crunch

The-toption allows you to create wordlists based on a custom pattern.

This command generates a wordlist where@@@@represents variable characters andMyPassremains constant. The wordlist is saved inunique.txt.

The resulting wordlist will contain words that adhere to the specified pattern. In this case, it will include words withMyPassfollowed by four variable characters that can be any combination of characters from the character set specified (in this case, the default character set is used, which includes all alphanumeric characters).

This can be particularly useful in scenarios where you need wordlists tailored to a specific format or for testing passwords that follow a predictable pattern. To prevent anyone from easily guessing or brute-forcing your passwords, you should always keep in mindsome common password mistakeswhile generating your new password.

Create Wordlists Using the Dictionary Mode

The-doption lets you use an external dictionary file as the source for your wordlist.

In this example, the command generates a wordlist with words of length six characters using a dictionary file as the source and saves it indictionary-list.txt.

Generate Words Without Repeating Characters Using crunch

To generate words that don’t have repeating characters (i.e., each character in the word is unique), you can use the-poption with crunch. This option specifies that the generated words should be unique and does this by eliminating repetitions of characters within each word.

For example, to generate a wordlist of six-character words with no repeating characters, use:

This command generates words composed of characters “A,” “B,” “C,” “D,” “E,” and “F,” with no repeating characters, and saves the wordlist in thenon-repeating-words.txtfile.

Use the Crunch Command With Other Linux Commands

There are hundreds of commands available on Linux that you can use to generate a very specific wordlist, tailored to your desires. You just need to know what they are and how to use them!

You can use the crunch command alongside Linux commands like grep and sort to filter and sort the wordlists, the wc command to count the entries, and the hydra command to carry out a dictionary command.