How to create custom wordlist on Kali Linux with crunch

With the Crunch command on Linux, you can create different types of wordlists to use in your security tests, and mastering the Crunch command will be a valuable addition to your skill set.

Kali Linux has countless tools to support security testing. Wordlist plays an important role in various cybersecurity tests and password-related tasks.

With the Crunch command on Linux, you can create different types of wordlists to use in your security tests, and mastering the Crunch command will be a valuable addition to your skill set. Below is how to install and use Crunch effectively to create wordlists on Kali Linux.

How to install Crunch on Kali Linux

The Crunch command is usually pre-installed on Kali Linux. But if you don't have it yet, you can easily install it from the official repository. But first, update your system inventory with:

sudo apt update

Install the Crunch package with:

sudo apt install crunch

How to use Crunch command on Linux

To learn more about Crunch, run:

crunch -h

This section briefly introduces the Crunch command and its syntax.

Picture 1 of How to create custom wordlist on Kali Linux with crunch

For a more detailed and in-depth look at the Crunch command and its various options, see the man page or get command line help with:

man crunch

Basic Crunch syntax

The basic syntax of the Crunch command is:

crunch [options]

min refers to the least number of characters you want to generate, while max is 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 many options provided by the crush command to create different types of wordlists.

To create a wordlist with all "abc" character combinations, each three characters long, run:

crunch 3 3 abc

Set the character range using the Crunch command

You can customize your wordlist by defining a specific character range, for example, all numbers, letters, or just symbols. For example, to create a list containing all lowercase letters that are between 4 and 6 characters long, run:

crunch 4 6 abcdefghijklmnopqrstuvwxyz

To create a wordlist with only numbers, run:

crunch 10 10 0123456789

Note : You can specify the length of the characters.

Export wordlist to file using Crunch

You can use the -o option to specify the output file for your created wordlist. To create a wordlist consisting of the character combinations "abc123", each consisting of 4 characters, and save it to a file named "wordlist.txt", run:

crunch 4 4 abc123 -o wordlist.txt

Use Bruteforce mode in the Crunch command

The -b option allows you to specify a character set for brute-force generation. The normal processing mode produces a wordlist with combinations of characters from a specified set for a given range of word lengths.

The -b mode is more extensive because it creates the wordlist by generating permutations of characters from the base set, allowing it to include all possible combinations.

crunch 6 6 -b 1234567890abcdef -o bruteforce.txt

This command creates a wordlist with all possible combinations of the characters '"1234567890abcdef" with a length of 6 characters and saves it to bruteforce.txt.

Use Combination mode with Crunch

The -c option is used to create a combination of characters from multiple sets.

crunch 8 8 -c 1@% -o combinations.txt

This command creates a wordlist that combines characters from set 1 and @% to generate all possible combinations of 8 characters, saving them in combinations.txt.

Create wordlists with custom templates using Crunch

The -t option allows you to create a wordlist based on a custom template.

crunch 8 8 -t MyPass@@@@ -o unique.txt

This command creates a wordlist where @@@@ represents mutable characters and MyPass is constant. wordlist is saved in Unique.txt.

The resulting Wordlist will contain words that follow the specified pattern. In this case it will consist of words with MyPass followed by 4 variable characters which can be any combination of characters from the specified character set (in this case the default character set is use, including all alphanumeric characters).

This can be especially useful in situations where you need the wordlist to be tailored to a specific format, or to test passwords that follow a predictable pattern. To prevent others from easily guessing or brute-force your password, you should always keep some common password mistakes in mind when creating a new password.

Create wordlist using Dictionary mode

The -d option allows you to use an external dictionary file as the source for your wordlist.

crunch 6 6 -f /usr/share/dict/words -o dictionary-list.txt

In this example, the command creates a wordlist of words that are 6 characters long using the dictionary file as the source and saves it to dictionary-list.txt.

Create words without repeating characters using Crunch

To create words without repeated characters (i.e. each character in the word is unique), you can use the -p option followed by a hyphen.

This option specifies that the generated words must be unique and does this by removing repetition of characters within each word.

For example, to create a wordlist of 6-letter words with no repeating characters, use:

crunch 6 6 -p ABCDEF -o non-repeating-words.txt

This command creates words consisting of the letters "A," "B," "C," "D," "E" and "F" without repeating characters and saves the wordlist in a non-repeating-words file . txt.

Update 23 October 2023
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile