一个高度灵活和脚本化的密码字典生成器。
ttpassgen的Python项目详细描述
ttpassgen
TPASSGEN是一个基于Python的高度可伸缩和可编程的密码字典生成器,可以很容易地使用各种规则来生成所需的单词组合。
自述文件I18N:中文说明
功能
- 生成密码使用组合、置换、条件规则等。
- 支持所有可以组成密码的字符或单词(从wordlist选项),提供了一些内置字符集,如字母表和数字表。
- 可以指定单词中每个元素的顺序和频率。
- 简单的规则格式,易于使用,规则可以定义类似的regex样式。
- 耗时的估计、输出大小估计和实时进度报告。
- 使用wordlist选项支持unicode单词。
- 一次生成大量密码,无输出大小限制。
- 它可以按文件大小拆分输出。
安装
TTPassGen
可以使用pip轻松安装:
pip install ttpassgen
如果您使用的是windows操作系统,您可以只使用release version。
要求
python 3.5或更高版本。
快速启动
Switch to the project's
ttpassgen
directory if you want use ttpassgen by downloaded source code.
示例:生成单词列表输出到out.dict,单词格式为前缀三位数,只允许1、2、3出现2或3次,后跟字母A或B。
ttpassgen -r [123]{2:3}[ab] out.dict
完成。
选项
C:\Users\tp730>ttpassgen --help
Usage: ttpassgen [OPTIONS] OUTPUT
Options:
-m, --mode INTEGER generation mode:
0 = combination rule mode
[default: 0]
-d, --dictlist TEXT read wordlist from the file, multi files
should by seperated by comma.
-r, --rule TEXT define word format, $0 means refer first
file in dictlist option, some built-in charsets:
?l = abcdefghijklmnopqrstuvwxyz
?u = ABCDEFGHIJKLMNOPQRSTUVWXYZ
?d = 0123456789
?s = !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
?a = ?l?u?d?s
?q = ]
example: [?dA]{1:2}$0
view *Examples* section for more information.
[default: '']
-c, --dict_cache INTEGER each element in 'dictlist' option represents
a dict file path, this option define the
maximum amount of memory(MB) that can be used,
increasing this value when the file is large
may increase the build speed. [default: 500]
-g, --global_repeat_mode TEXT whether the character is allowd to repeat:
? = 0 or 1 repetitions
* = 0 or more repetitions
[default: ?]
-p, --part_size INTEGER when result data is huge, split package
size(MB) will be applied, 0 is unlimited.
[default: 0]
-a, --append_mode INTEGER whether append content to OUTPUT or not.
[default: 0]
-s, --seperator TEXT word seperator, by default, each word
occupies one line. special char:
  = one space
[default: ]
--inencoding TEXT dict file encoding.
--outencoding TEXT output file encoding. [default: utf-8]
--help Show this message and exit.
生成的密码在OUTPUT
中逐行显示。建议使用notepad++打开此文件(utf-8
)。
示例
[]用于包装字符集。
重复模式
[]1次重复。
[123] -> 1 2 3
[]?0次或1次重复。
[123] -> '' 1 2 3
[]{m:n:r}
when repeatMode is `?`, [123]{1:2:?} -> 1 2 3 12 13 21 23 31 32
when repeatMode is `*`, [123]{1:2:*} -> 1 2 3 11 12 13 21 22 23 31 32 33
[]{m:n}
默认使用global_repeat_mode
选项。
[]{n}或[]{n:r}
与[]{n:n:r}
相同。
$no从dictlist
选项引用dict文件索引。
ttpassgen --dictlist in.dict,in2.dict --rule $0[_]?$1 -s " " out.dict
when dictlist option defined as `in.dict,in2.dict`,
in.dict content:
word11
word12
in2.dict content:
word21
word22
$0[_]?$1 -> word11word21 word11word22 word11_word21 word11_word22 word12word21 word12word22 word12_word21 word12_word22