利用python生成简单的爆破字典
直接贴脚本
import itertools as its
words = "0123456789"
r = its.product(words, repeat=6)
dic = open("pass.txt","a")
for i in r:
dic.write("".join(i))
dic.write("".join("\n"))
dic.close()
生成爆破字典的思路都是类似的,上面贴的代码是用来生成六位的纯数字密码字典
下面让我们来逐行分析
import itertools as its
调用循环迭代模块itertools
words = "0123456789"
将你要生成的元素赋值给words变量
r = its.product(words, repeat=6)
元素在迭代器中循环6次,repeat控制你要生成的密码字典的位数
dic = open("pass.txt","a")
将生成的密码字典保存在pass.txt中
for i in r:
dic.write("".join(i))
dic.write("".join("\n"))
循环,填入密码字典中,\n将密码分行
dic.close()
关闭文档
本博文仅限于博主个人学习和分享使用,请勿用于违法行为。如有侵权,请联系一定删除!