Skip to Content

How to Create Custom Password Dictionary in Linux

In my previous Blog post I have written about how to hack any WiFi in Linux  OS. You can read that Blog on this link:
https://ramzantechs.odoo.com/blog/our-blogs-2/how-to-capture-and-crack-wifi-passworid-using-linux-2

However in that Blog we tried to crack Handshake file using Third Party already created Password Dictionary that may work  for your WiFi Password cracking or not. So in that case you can create your custom Password dictionary in any Linux OS. For that you have to install a tool called Crunch.


What is Crunch Tool

Linux's Crunch program is a command-line application that creates wordlists, which are frequently used for security auditing and password cracking. By defining parameters like length, character set, and other requirements, it generates unique wordlists. When a list of possible passwords or phrases is required to verify the security of systems, such as in penetration testing, brute force assaults, and other security assessments, this is especially useful.

To verify its installation run this command:

crunch

If its not installed you will this output:

To install this tool run this command:

sudo apt install crunch

And again run "crunch" command you should see output like this:

Now you have successfully installed Crunch Tool.

How to use Crunch Tool

Lets learn how to use this tool from basic command first:

crunch 6 8 abcdefghijklmnopqrstuvwxyz -o wordlist.txt
  • crunch: This is the tool name
  • 6: This value specify the minimum length of random words that will be generated
  • 8: This value specify the maximum length of random words
  • After that i wrote whole small alphabets, these specify the characters that will be used in random words. You can also enclose all these in double quotes. If you want to add Capital Alphabets, number or symbols as well you should write it in order:
    1:  Lowercase letters (a-z)
    2: Uppercase letters (A-Z)
    3: Numbers (0-9)
    4: Symbols (e.g., !@#$%^&*)

    If you don't specify it in this order then your output file will not be the same as you expected.

  • -o : It is used to specify the file name in which random words will be stored.

Above command will generate random passwords from length 6 to 8 containing small alphabets.


Output of above command will be like this in this you can see that its showing that 1 TB means 1812 GB file will be generated because we are using 26 characters and specifying 6 to 8 length which means Crunch tool will create every possible combination of these 26 alphabets. You can also see in the picture it is also showing the number of lines that will be generated actually these are number of random words.

So this was just basic intro to tool we will not be using it like this to create huge password files because it will take a lot of Space and computing and time. And then you will use that file to crack password it will take a long time to match all passwords.


Specific Patterns using Crunch Tool

We can use crunch tool to generate random words using specific pattern as stated below:

crunch 8 8 -t @@^^rt%%
  • 8 : Min Length
  • 8 : Max Length
  • -t : It is used to specify the pattern that you want to use to create words
    @ : It is used as a placeholder of alphabets
    ^ : It is used  as a place holder of  Special Symbols
    % : It is used as a place holder of Numbers
  • In this i didn't mentioned any character set to use so it will be using default char set that includes all lower and upper case alphabets, all numbers and special symbols.
  • I also not used -o parameter so it will not store this output in any any file and will start printing all generated words on terminal.

This will be output of above command you can see that its printing first 2 characters of alphabet in place of "@@", next 2 are special symbols in place of "^^" and then "rt" that we specified will be printed as it is and the last 2 are numbers because we used "%%" at end.

So in this way you can create any type of pattern using crunch tool depending on special WiFi you will be testing. For example if the owner name is "rt" you can specify that name at first characters and then at end will be random numbers and then try this against that WiFi and if you have extra details you can create different passwords file using different patterns and can try to crack WiFi Password.


Advance Parameters of Crunch


There are many others parameters that we can pass to crunch tool that will change the way it behaves and can be useful in many cases so lets learn all these:

1. -b number[type] :

          This parameter is used to specify the size of the output file and only works if the "-o" parameter value is set to "START"​​. For example suppose you are generating a huge combination of words and you want to store it in parts in different files so that you can test each file separately. If your file size will be lets suppose 20mb and you pass "-b5mb" what it will do it will create 4 output files each of max 5mb so as files will be generated dynamically it does not accept file name because it will not be 1 file.
Lets see a practical of it:

crunch 3 3 -b 1kb -o START

The output of command will be this when you run it:

It will start generating files and files that will be created will be like this:

he

you can see that it has created these files and each file will be of max 1kb that we specified in command and file name is according to pattern range that is stored in file.

The possible values that you can pass to "-b" are kb, mb, gb, kib, mib, and gib and there should be no space between number and this type value.

2. -d numbersymbol :


        Limits the number of duplicate characters.  "-d  2@"  limits  the lower  case  alphabet to output like aab and aac.  aaa would not be generated as that is 3 consecutive letters of a.  The  format is number then symbol where number is the maximum number of consecutive characters and symbol is the symbol of the the  character set you want to limit i.e. @,%,^


3. -z gzip, bzip2, lzma, and 7z :


        Compresses  the output from the -o option.  Valid parameters are gzip, bzip2, lzma, and 7z.

gzip is the fastest but the compression is minimal. 

bzip2 is little slower than gzip but has better compression. 

7z is slowest but has the best compression.


That is useful in cases your output file is big and you want to compress it so it will take less space to store and when ever you want you can extract it.


4. -u :

 

     This command is used to not display completing percentage in the terminal. By default when we use crunch command it show progress percentage in the terminal. With this command it will not show progress but at end will show that process has completed.



I will create video tutorial very soon and link will be updated here.

Stay Tuned for tutorial.





Sign in to leave a comment