Python生成密码字典

>>> import itertools as its
>>> words="0123456789abcdefghijklmnopqrstuvwxyz" //如需要,可加入大写字母及其他符号
>>> dic=open('dictionary.txt','w')
>>> for num in range(8,11)://长度为8~10位数
>>>     keys=its.product(words,repeat=num)
>>>     for key in keys:
>>>         dic.write("".join(key)+"\n")
>>> 
>>>  
dic.close()

提示:生成字典进行枚举密码,现在各种带有密码的场景基本都达到了8位以上,假设一个8位数密码,可能由如下所示的26字母加10数字组合而成,就是36^8种组合,数量随密码位数呈指数型增长,再加上建立连接和其他验证限制,枚举密码基本无法完成。

猜你喜欢

转载自blog.csdn.net/IAGod/article/details/88423059