Skip to content

Commit 298ae3b

Browse files
committed
version 2.0.5#dev update
1. add birthday、scratch and pid4 plugin 2. add AwesomeSystemTestUsername.txt wordlist 3. modify --conf function 4. modify CommonWebAdminPass.txt wordlist 5. other perfect modify
1 parent 68803e3 commit 298ae3b

File tree

16 files changed

+1545
-312
lines changed

16 files changed

+1545
-312
lines changed

README.md

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pydictor
2-
[![build](https://img.shields.io/badge/build-passing-brightgreen.svg)](https://www.github.com/landgrey/pydictor) [![Python 2.7|3.4](https://img.shields.io/badge/python-2.7|3.4-yellow.svg)](https://www.python.org/) ![release](https://img.shields.io/badge/version-2.0.4-orange.svg) ![License](https://img.shields.io/badge/license-GPLv3-red.svg)
2+
[![build](https://img.shields.io/badge/build-passing-brightgreen.svg)](https://www.github.com/landgrey/pydictor) [![Python 2.7|3.4](https://img.shields.io/badge/python-2.7|3.4-yellow.svg)](https://www.python.org/) ![release](https://img.shields.io/badge/version-2.0.5-orange.svg) ![License](https://img.shields.io/badge/license-GPLv3-red.svg)
33

44
**README.md [中文版](README_CN.md)**
55

@@ -51,7 +51,7 @@ python pydictor.py
5151
![social engineering dictionary builder](/screenshots/sedb.png "sedb")
5252

5353
## Quick to use:
54-
#### types of generate wordlist(14 types)and descriptions
54+
#### types of generate wordlist(15 types)and descriptions
5555

5656
| wordlist type | number| description |
5757
|:------------- | :---- |:--------------------------------------------------- |
@@ -60,7 +60,7 @@ python pydictor.py
6060
| chunk | 3 | permutation and combination wordlist |
6161
| conf | 4 | based on configuration file wordlist |
6262
| sedb | 5 | social engineering wordlist |
63-
| idcard | 6 | id card last 6/8 char wordlist |
63+
| idcard | 6 | id card last 4/6/8 char wordlist |
6464
| extend | 7 | extend wordlist based on rules |
6565
| scratch | 8 | wordlist based on web pages keywords |
6666
| passcraper | 9 | wordlist against to web admin and users |
@@ -69,20 +69,21 @@ python pydictor.py
6969
| counter | 12 | word frequency count wordlist |
7070
| combiner | 13 | combine the input file generate wordlist |
7171
| uniqbiner | 14 | combine and unique the input file generate wordlist |
72+
| birthday | 15 | birthday keyword wordlist in specify datetime scope |
7273

7374
#### function and scope of support wordlist number
7475

75-
| function | number (wordlist) | description |
76-
|:---------- | :--------------------------- |:-------------------------------------------------------- |
77-
| len | 1 2 3 4 5 6 7 9 10 11 12 14 | lenght scope |
78-
| head | 1 2 3 4 5 6 7 9 10 11 12 14 | add items prefix |
79-
| tail | 1 2 3 4 5 6 7 9 10 11 12 14 | add items suffix |
80-
| encode | 1 2 3 4 5 6 7 9 10 11 12 14 | encode the items |
81-
| occur | 3 4 5 7 9 10 11 12 14 | filter by occur times of letter、digital、special chars |
82-
| types | 3 4 5 7 9 10 11 12 14 | filter by types of letter、digital、special chars |
83-
| regex | 3 4 5 7 9 10 11 12 14 | filter by regex |
84-
| level | 5 7 9 | set the wordlist level |
85-
| leet | 5 7 9 | 1337 mode |
76+
| function | number (wordlist) | description |
77+
|:---------- | :------------------------------ |:-------------------------------------------------------- |
78+
| len | 1 2 3 4 5 6 7 9 10 11 12 14 15 | lenght scope |
79+
| head | 1 2 3 4 5 6 7 9 10 11 12 14 15 | add items prefix |
80+
| tail | 1 2 3 4 5 6 7 9 10 11 12 14 15 | add items suffix |
81+
| encode | 1 2 3 4 5 6 7 9 10 11 12 14 15 | encode the items |
82+
| occur | 3 4 5 7 9 10 11 12 14 | filter by occur times of letter、digital、special chars |
83+
| types | 3 4 5 7 9 10 11 12 14 | filter by types of letter、digital、special chars |
84+
| regex | 3 4 5 7 9 10 11 12 14 | filter by regex |
85+
| level | 5 7 9 | set the wordlist level |
86+
| leet | 5 7 9 | 1337 mode |
8687

8788

8889
## usage examples
@@ -133,23 +134,31 @@ python pydictor.py -extend /names.txt --leet 0 1 2 11 21 --level 1 --len 4 16 --
133134
```
134135

135136

136-
#### 7: id card last 6/8 char wordlist
137+
#### 7: id card last 4/6/8 char wordlist
137138

138139
```
139140
pydictor.py -plug pid6 --types ">=0" ">=4" ">=0" --encode b64
140141
```
141142

142143
**note**: default sex ='all', it decided by lib/data/data.py default_sex, and 'm' is Male, 'f' is Female
143144

145+
146+
#### 7-2: birthday range wordlist
147+
```
148+
pydictor.py -plug birthday 19750101 20001231 --len 6 8
149+
```
150+
151+
144152
#### 8: using passcraper plugin crawl website generating password wordlist based on plain text found and extend rules
145153

146154
1. the rules of passcraper plug and extend function are the same
147155
2. passcraper plug will generate two wordlist,preffix with SCRATCH is raw wordlist by website plain text,
148156
and if you feel that there are a lot of unrelated words in the SCRATCH wordlist,
149157
you can remove them, and then use the extend function to specify the new file to generate dictionary again.
150-
3. you can modify the funcfg/passcraper_blacklist.conf file,add or delete useless words that need to be filtered out,
158+
3. or directed using scratch plug,then remove some useless words and use the extend function to generate dictionary again.
159+
4. you can modify the funcfg/passcraper_blacklist.conf file,add or delete useless words that need to be filtered out,
151160
and also can modify lib/data/data.py file passcraper_filter argument,change the filter regular expressions
152-
4. with same extend function,you can put your weak password in /wordlist/Web,new wordlist will contains them
161+
5. with same extend function,you can put your weak password in /wordlist/Web,new wordlist will contains them
153162

154163
```
155164
python pydictor.py -plug passcraper using default file scraper.sites as multi-input file
@@ -161,8 +170,9 @@ python pydictor.py -plug passcraper http://www.example.com
161170
##### this function contains all of "-base" and "-char" capacities,and more precise control
162171

163172
```
164-
python pydictor.py --conf using default file funcfg/build.conf build the dictionary
165-
python pydictor.py --conf /my/other/awesome.conf using /my/other/awesome.conf build the dictionary
173+
pydictor.py --conf "[1-9]{6,6}<none>" --output six.txt build wordlist
174+
python pydictor.py --conf using default file funcfg/build.conf build the dictionary
175+
python pydictor.py --conf /my/other/awesome.conf using /my/other/awesome.conf build the dictionary
166176
```
167177

168178
**note**: parsing rules details as following,besides referred to build.conf file
@@ -208,7 +218,7 @@ python pydictor.py -tool shredder delete the currently specified output path(d
208218
python pydictor.py -tool shredder base delete the files of it's prefix is "BASE" in currently specified output path
209219
```
210220

211-
prefix(case insensitive) range in 14 items: base,char,chunk,conf,sedb,idcard,extend,handler,uniqifer,counter,combiner,uniqbiner,scratch,passcraper
221+
prefix(case insensitive) range in 15 items: base,char,chunk,conf,sedb,idcard,extend,handler,uniqifer,counter,combiner,uniqbiner,scratch,passcraper,birthday
212222

213223
besides,you can safe shred files or whole directory as following:
214224
```

README_CN.md

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pydictor
2-
[![build](https://img.shields.io/badge/build-passing-brightgreen.svg)](https://www.github.com/landgrey/pydictor) [![Python 2.7|3.4](https://img.shields.io/badge/python-2.7|3.4-yellow.svg)](https://www.python.org/) ![release](https://img.shields.io/badge/version-2.0.4-orange.svg) ![License](https://img.shields.io/badge/license-GPLv3-red.svg)
2+
[![build](https://img.shields.io/badge/build-passing-brightgreen.svg)](https://www.github.com/landgrey/pydictor) [![Python 2.7|3.4](https://img.shields.io/badge/python-2.7|3.4-yellow.svg)](https://www.python.org/) ![release](https://img.shields.io/badge/version-2.0.5-orange.svg) ![License](https://img.shields.io/badge/license-GPLv3-red.svg)
33

44
**README.md [English](README.md)**
55

@@ -55,7 +55,7 @@ python pydictor.py
5555

5656
## 快速上手:
5757

58-
#### 可以生成的字典类型(14种)及其说明
58+
#### 可以生成的字典类型(15种)及其说明
5959

6060
| 类型 | 编号 | 说明 |
6161
|:------------- | :---- |:----------------- |
@@ -64,7 +64,7 @@ python pydictor.py
6464
| chunk | 3 | 排列组合字典 |
6565
| conf | 4 | 配置文件生成字典 |
6666
| sedb | 5 | 社会工程学字典 |
67-
| idcard | 6 | 身份证后6/8位字典 |
67+
| idcard | 6 | 身份证后4/6/8位字典 |
6868
| extend | 7 | 扩展字典 |
6969
| scratch | 8 | 网页原始关键词字典|
7070
| passcraper | 9 | 网页爆破针对字典 |
@@ -73,20 +73,21 @@ python pydictor.py
7373
| counter | 12 | 词频统计字典 |
7474
| combiner | 13 | 合并字典 |
7575
| uniqbiner | 14 | 先合并后去重字典 |
76+
| birthday | 15 | 生日范围字典 |
7677

7778
#### 字典类型与功能适用范围对照表
7879

79-
| 功能 | 适用范围(字典类型编号) | 说明 |
80-
|:---------- | :--------------------------- |:------------------------------------ |
81-
| len | 1 2 3 4 5 6 7 9 10 11 12 14 | 定义长度范围 |
82-
| head | 1 2 3 4 5 6 7 9 10 11 12 14 | 添加前缀 |
83-
| tail | 1 2 3 4 5 6 7 9 10 11 12 14 | 添加后缀 |
84-
| encode | 1 2 3 4 5 6 7 9 10 11 12 14 | 编码或自定义加密方法 |
85-
| occur | 3 4 5 7 9 10 11 12 14 | 字母、数字、特殊字符出现次数范围筛选 |
86-
| types | 3 4 5 7 9 10 11 12 14 | 字母、数字、特殊字符各种类数范围筛选 |
87-
| regex | 3 4 5 7 9 10 11 12 14 | 正则筛选 |
88-
| level | 5 7 9 | 字典级别筛选 |
89-
| leet | 5 7 9 | 1337 模式 |
80+
| 功能 | 适用范围(字典类型编号) | 说明 |
81+
|:---------- | :------------------------------ |:------------------------------------ |
82+
| len | 1 2 3 4 5 6 7 9 10 11 12 14 15 | 定义长度范围 |
83+
| head | 1 2 3 4 5 6 7 9 10 11 12 14 15 | 添加前缀 |
84+
| tail | 1 2 3 4 5 6 7 9 10 11 12 14 15 | 添加后缀 |
85+
| encode | 1 2 3 4 5 6 7 9 10 11 12 14 15 | 编码或自定义加密方法 |
86+
| occur | 3 4 5 7 9 10 11 12 14 | 字母、数字、特殊字符出现次数范围筛选 |
87+
| types | 3 4 5 7 9 10 11 12 14 | 字母、数字、特殊字符各种类数范围筛选 |
88+
| regex | 3 4 5 7 9 10 11 12 14 | 正则筛选 |
89+
| level | 5 7 9 | 字典级别筛选 |
90+
| leet | 5 7 9 | 1337 模式 |
9091

9192

9293
## 使用实例
@@ -138,18 +139,26 @@ webzhang
138139
python pydictor.py -extend /names.txt --leet 0 1 2 11 21 --level 1 --len 4 16 --occur "<=10" ">0" "<=2" -o /possbile/wordlist.lst
139140
```
140141

141-
#### 示例7: 身份证后6/8位生成插件
142+
#### 示例7: 身份证后4/6/8位生成插件
142143
##### 使用pid6插件生成中国公民身份证后6位爆破字典, 并规定至少要出现4种不同的数字,并用base64编码
143144
```
144145
pydictor.py -plug pid6 --types ">=0" ">=4" ">=0" --encode b64
145146
```
146147

147148
****: 默认的性别为全体'all',它由 lib/data/data.py文件default_sex参数指定,'m'指男性,'f'指女性
148149

150+
151+
#### 示例7-2: 生日范围字典生成插件
152+
```
153+
pydictor.py -plug birthday 19750101 20001231 --len 6 8
154+
```
155+
156+
149157
#### 示例8: 使用passcraper插件爬行网站指定页面并基于获得的文本词组生成密码字典
150158

151159
1. passcraper 规则和extend完全一致
152160
2. passcraper 插件会生成两个字典,SCRATCH开头的是从网站内容获得的原始词组列表,如果感觉SCRATCH字典中有许多无关词,可以自己去除后,重新使用extend功能指定文件生成字典
161+
3. 或直接使用scratch插件,只从网站内容中获得原始词列表,人工拣选后,再使用extend功能生成扩展字典
153162
3. 你可以修改 funcfg/passcraper_blacklist.conf 文件,选择需要过滤掉的无用单词,也可以修改lib/data/data.py 中的passcraper_filter,更改过滤正则表达式
154163
4. 和extend一样,你可以将自己的弱密码字典放在 /wordlist/Web 目录下,生成的字典会包含它们
155164

@@ -163,11 +172,15 @@ python pydictor.py -plug passcraper http://www.example.com
163172
1. 此功能可以完成"-base"和"-char"的所有功能,并在此基础上有更精细化的字典控制力;
164173
2. extend.conf 文件支持此功能,具体参考funcfg/extend.conf文件;
165174
3. 可以生成固定模式的字典,比如 lisa【两位到四位数字】@【qq.com, 163.com, some.net 中的一个】,在配置文件中写入
166-
'lisa[0-9]{2,4}<none>@[qq.com,163.com,some.net]{1,1}<none>' ,然后指定运行即可
175+
```
176+
lisa[0-9]{2,4}<none>@[qq.com,163.com,some.net]{1,1}<none>
177+
```
178+
然后指定路径运行即可
167179
168180
```
169-
python pydictor.py --conf --encode b64 使用默认位置的funcfg/build.conf 配置文件建立字典,并用base64编码
170-
python pydictor.py --conf /my/other/awesome.conf 使用/my/other/awesome.conf文件建立字典
181+
pydictor.py --conf "[1-9]{6,6}<none>" --output six.txt 生成6位纯数字字典
182+
python pydictor.py --conf --encode b64 使用默认位置的funcfg/build.conf 配置文件建立字典,并用base64编码
183+
python pydictor.py --conf /my/other/awesome.conf 使用/my/other/awesome.conf文件建立字典
171184
```
172185
173186
**注**: 具体解析规则如下,另可参考build.conf文件示例;
@@ -211,7 +224,7 @@ python pydictor.py -tool shredder 删除当前指定的字典输出目
211224
python pydictor.py -tool shredder base 删除当前指定的字典输出目录下,以"BASE"开头的所有字典文件
212225
```
213226
214-
支持的前缀(不区分大小写)有14种:base,char, chunk, conf,sedb,idcard,extend,handler,uniqifer,counter,combiner,uniqbiner,scratch,passcraper
227+
支持的前缀(不区分大小写)有15种:base,char, chunk, conf,sedb,idcard,extend,handler,uniqifer,counter,combiner,uniqbiner,scratch,passcraper,birthday
215228
216229
另外,还可以像下面这样,将传入的任意位置的一个文件或目录,整个的安全删除
217230
```

core/CONF.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ def get_conf_dic(minlength, maxlength, objflag, encodeflag, head, tail):
2929
return diclist
3030

3131

32-
def build_conf_dic():
33-
storepath = finalsavepath(paths.results_path, pystrs.CONF_prefix, mybuildtime(), pyoptions.filextension, paths.results_file_name)
32+
def build_conf_dic(source="", file_prefix=pystrs.CONF_prefix):
33+
storepath = finalsavepath(paths.results_path, file_prefix, mybuildtime(), pyoptions.filextension, paths.results_file_name)
3434
with open(storepath, "a") as f:
35-
for item in confcore(paths.buildconf_path):
35+
for item in confcore(source):
3636
item = filterforfun(item, head=pyoptions.head, tail=pyoptions.tail,
3737
lenght_is_filter=pyoptions.args_pick,
3838
minlen=pyoptions.minlen, maxlen=pyoptions.maxlen,
@@ -59,10 +59,8 @@ def confcore(resource):
5959
except IndexError:
6060
confdicts = {}
6161
exit(cool.red("[-] parse element error, please check your parsing element"))
62-
6362
finalen = len(confdicts[pystrs.conf_head])
6463
listpool = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
65-
6664
for x in range(0, finalen):
6765
lengthchecker(confdicts[pystrs.conf_minlen][x], confdicts[pystrs.conf_maxlen][x])
6866
listpool[x] = get_conf_dic(int(confdicts[pystrs.conf_minlen][x]), int(confdicts[pystrs.conf_maxlen][x]),
@@ -83,6 +81,7 @@ def confcore(resource):
8381
elif finalen == 4:
8482
countchecker(-1, len(listpool[0]), len(listpool[1]), len(listpool[2]), len(listpool[3]))
8583
for item in itertools.product(listpool[0], listpool[1], listpool[2], listpool[3]):
84+
# print("".join(item) + '\n')
8685
yield "".join(item)
8786
elif finalen == 5:
8887
countchecker(-1, len(listpool[0]), len(listpool[1]), len(listpool[2]), len(listpool[3]), len(listpool[4]))

core/EXTEND.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def extend_enter(rawlist, leet=True):
217217
return unique(res)
218218

219219

220-
def get_extend_dic(target, need_passcratch=False):
220+
def get_extend_dic(target, need_extendscratch=False):
221221
rawlist = []
222222
for t in target:
223223
if os.path.isfile(t):
@@ -226,23 +226,18 @@ def get_extend_dic(target, need_passcratch=False):
226226
rawlist.append(line.strip())
227227
else:
228228
rawlist.append(t)
229-
extend_magic(rawlist, need_passcratch=need_passcratch)
229+
extend_magic(rawlist, need_extendscratch=need_extendscratch)
230230

231231

232-
def extend_magic(rawlist, need_passcratch=False):
232+
def extend_magic(rawlist, need_extendscratch=False):
233233
prefix = pystrs.EXTEND_prefix
234234
if rawlist == []:
235235
exit(pyoptions.CRLF + cool.red("[-] raw extend resource cannot be empty"))
236236

237237
leet = pyoptions.extend_leet
238-
if need_passcratch:
238+
if need_extendscratch:
239239
prefix = pystrs.PASSCRAPER_prefix
240240
leet = pyoptions.passcraper_leet
241-
rawstorepath = os.path.join(paths.results_path, "%s_%s%s" % (pystrs.SCFATCH_prefix, mybuildtime(),
242-
pyoptions.filextension))
243-
with open(rawstorepath, "a") as f:
244-
for line in rawlist:
245-
f.write(str(line) + pyoptions.CRLF)
246241

247242
storepath = finalsavepath(paths.results_path, prefix, mybuildtime(), pyoptions.filextension, paths.results_file_name)
248243
with open(storepath, "a") as f:

0 commit comments

Comments
 (0)