In order to hack a password, we have to try a lot of passwords to get the right one. When an attacker uses thousands or millions of words or character combinations to crack a password there is no surety that any one of those millions of combinations will work or not. This collection of a different combination of characters is called a wordlist. And in order to crack a password or a hash, we need to have a good wordlist which could break the password. So to do so we have a tool in kali Linux called crunch
crunch is a wordlist generating tool that comes pre-installed with Kali Linux. It is used to generate custom keywords based on wordlists. It generates a wordlist with permutation and combination. We could use some specific patterns and symbols to generate a wordlist.
Installing crunch tool
To install crunch tool use the following commands as per your Linux distribution.
In case of Debian/Ubuntu
$sudo apt-get install crunch
In case of CentOS/RedHat
$sudo yum install crunch
In case of Fedora OS
$sudo dnf install crunch
Working with crunch tool
1. To check the installation.
crunch

This command will display the initial page of crunch tool which verifies the tool installation.
2. To create a word list of specific numbers.
cruch 1 2 0123456789

This command will generate a wordlist of 110 words having the one and 2 digit numbers with all combinations of digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. you could use alphabets
3. To save the wordlist into a file
crunch 1 2 0123456789 >wordlist.txt

This command will generate a wordlist of 110 words having the one and 2 digit numbers with all combinations of digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and will copy the same to a text file named as wordlist.txt.
4. To save the wordlist to a file with -o option
crunch 1 2 0123456789 -o wordlist.txt

This command will generate a wordlist of 110 words having the one and 2 digit numbers with all combinations of digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and will copy the same to a text file named as wordlist.txt.
5. To generate a file usig rainbow charset file
crunch 2 3 -f /usr/share/rainbowcrack/charset.txt

This command will use the charset present in the /usr/share/rainbowcrack/charset.txt file in order to generate a wordlist.
6. To generate a wordlist with a specific pattern.
crunch 10 10 -t manav^%%%%
Here we have 4 characters to represent some group of characters which are as follows:
- , for all uppercase letters
- @ for all lowercase letters
- % for all numeric characters
- ^ for all special characters

So the above command will output all the words starting with “manav” and then after that a special character and then 4 digit number.
7. To generate a wordlist with a permutation of some strings or characters
crunch 1 10 -p Hello Manav
In the case of -p, the minimum size and the maximum size values are ignored by the crunch and it displays all the possible permutations.

The above command will give 2 permutations of “hello manav”.
Recommended Posts:
- Difference Between Arch Linux and Kali Linux
- Kali Linux - Password Cracking Tool
- Difference Between Ubuntu and Kali Linux
- How to Install Lazy Script in Kali Linux?
- Kali Linux Tools
- What is Vulnerability Scanning in Kali Linux?
- Introduction to Kali Linux
- How to Change the Mac Address in Kali Linux Using Macchanger?
- How to Hack WPA/WPA2 WiFi Using Kali Linux?
- Kali Linux - File Management
- Kali Linux - Default Passwords
- How to Create Reverse Shells with Netcat in Kali Linux?
- Kali Linux - Terminal and Shell
- Kali Linux - Command Line Essentials
- How to Change the username or userID in Kali Linux?
- Difference Between Fedora and Kali Linux
- Kali Linux - Exploitation Tools
- Kali Linux - Information Gathering Tools
- Kali Linux - Vulnerability Analysis Tools
- Kali Linux - Web Penetration Testing Tools
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

