Crunch
Jump to navigation
Jump to search
Description
Crunch is a wordlist generator where you can specify a standard character set or a character set you specify. crunch can generate all possible combinations and permutations.
Installation
Download the source:
$ cd /data/src/ $ wget http://downloads.sourceforge.net/project/crunch-wordlist/crunch-wordlist/crunch2.6.tgz $ tar xzvf crunch2.6.tgz
Configure and install
$ cd /data/src/crunch2.6/ $ make $ sudo make install
Note
Notice that crunch creates a new directory in /pentest.
Usage
Basic syntax
./ crunch <min-len> <max-len> [-f /path/to/charset.lst charset-name] [-o wordlist.txt] [-t [FIXED]@@@@] [-s startblock] [-c number]
Options
- min-len
- is the minimum length string you want crunch to start at. This option is required even for parameters that won't use the value.
- max-len
- is the maximum length string you want crunch to end at. This option is required even for parameters that won't use the value.
- charset
- Optional. You may specify a character set for crunch to use on the command line or if you leave it blank crunch will use abcdefghijklmnopqrstuvwxyz as the character set.
- NOTE: If you want to include the space character in your character set you must enclose your character set in quotes i.e. "abc "
- -b number[type]
- Optional. Specifies the size of the output file, only works if -o START is used, eg: 60MB The output files will be in the format of starting letter-ending letter for example: ./crunch 4 5 -b 20mib -o START will generate 4 files: aaaa-gvfed.txt, gvfee-ombqy.txt, ombqz-wcydt.txt, wcydu-zzzzz.txt valid values for type are kb, mb, gb, kib, mib, and gib. The first three types are based on 1000 while the last three types are based on 1024.
- NOTE There is no space between the number and type. For example 500mb is correct 500 mb is NOT correct.
- -c number
- Optional. Specifies the number of lines to write to output file, only works if -o START is used, eg: 60 The output files will be in the format of starting let‐ ter-ending letter for example: ./crunch 1 1 -f /pentest/password/crunch/charset.lst mixal‐ pha-numeric-all-space -o START -c 60 will result in 2 files: a-7.txt and 8-\ .txt The rea‐ son for the slash in the second filename is the ending character is space and ls has to escape it to print it. Yes you will need to put in the \ when specifying the filename because the last character is a space.
- -f </path/to/charset.lst> <charset-name>
- Optional. Allows you to specify a character set from the charset.lst
- -i
- Inverts the output so instead of aaa,aab,aac,aad, etc you get aaa,baa,caa,daa,aba,bba, etc
- -m
- Has been merged with -p. Please use -p instead.
- -o <wordlist.txt>
- Optional. Allows you to specify the file to write the output to, eg: wordlist.txt
- -p <charset> OR -p <word1 word2 ...>
- Optional. Tells crunch to generate words that don't have repeating characters. By default crunch will generate a wordlist size of #of_chars_in_charset ^ max_length. This option will instead generate #of_chars_in_charset!. The ! stands for factorial. For example say the charset is abc and max length is 4.. Crunch will by default generate 3^4 = 81 words. This option will instead generate 3! = 3x2x1 = 6 words (abc, acb, bac, bca, cab, cba).
- THIS MUST BE THE LAST OPTION!
- This option CANNOT be used with -s or -t and it ignores min and max length however you must still specify two numbers.
- -q <filename.txt>
- Optional. Tells crunch to read filename.txt and permute what is read. This is like the -p option except it gets the input from filename.txt.
- -r
- Optional. Tells crunch to resume generate words from where it left off. You must use the same command as the original command used to generate the words. The only exception to this is the -s option. If your original command used the -s option you MUST remove it before you resume the session. Just add -r to the end of the original command.
- -s <startblock>
- Optional. Allows you to specify the starting string, eg: 03god22fs
- -t <@*%^>
- Optional. Allows you to specify a pattern, eg: @@god@@@@ where the only the @'s, *'s, %'s, and ^'s will change. It will also take user specified character sets for each group of characters. The order MUST BE lower case characters, upper case characters, numbers, and then symbols. If you don't follow this order you will not get the results you want. You MUST specify either values for the character type or a plus sign. These charac‐ ters sets MUST be specified BEFORE any other options and after the min and max. See the examples for an example.
- @ will insert lower case characters
- * will insert upper case characters
- % will insert numbers
- ^ will insert symbols
- -z <gzip|bzip2|lzma>
- Optional. Compresses the output from the -o option. Valid parameters are gzip, bzip2, or lzma. gzip is the fastest but the compression is minimal. bzip2 is a little slower than gzip but has better compression. lzma is slowest but has the best compression.
Examples
INCOMPLETE SECTION OR ARTICLE
This section/article is being written and is therefore not complete.
Thank you for your comprehension.
Thank you for your comprehension.