我正在使用 crunch 创建一本词典,其中包含 8 个字符的所有组合。一段时间后,它停止创建词典,因为它需要 56 TB 的空间。
我怎样才能解决这个问题?
答案1
好吧。如果你对所有 8 个字符的组合运行它,你会得到
(26 * 2)^8 * 8 = 427677828251648
字符。这大约是 389TB 的空间(未压缩)。您试图生成的字典太大。要减少它,您可以
- 限制字符集,或者
- 密码长度
或者,你可以通过以下方式限制问题(但不修复它)
- 使用选项压缩它
-z
(这几乎没有足够的帮助,因为压缩随机字符串效率不高) -d
使用或选项限制重复-p
。- 将输出拆分为多个文件(请参阅
-o START
)
摘录自man 1 crunch
:
-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 a little slower than gzip but has better
compression. 7z is slowest but has the best compression.
-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. @,%^ See examples 17-19.
-p charset OR -p word1 word2 ...
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 and it ignores min and max length however you must still specify
two numbers.