首先有个test.doc文件
题目:密码由12到18位字符组成。字符由每3个一组的固定单词组成,共6组,分别是“123”,“qwe”,“zxc”,“0-=”,“[]\”,“,./”。
请编写密码字典,并破解test.doc
1.首先生成密码字典
2.读取字典并暴力破解
生成密码字典:
import os
import sys
import itertools as its
words=['123','qwe','zxc','0-=','[]\\',',./']
r1 =its.product(words,repeat=4)
dic = open("pass1.txt","a")
for i in r1:
i=list(i)
temp="";
for k in i:
temp=temp+k;
dic.write(temp+'\n');
r2 =its.product(words,repeat=5)
for i in r2:
i=list(i)
temp="";
for k in i:
temp=temp+k;
dic.write(temp+'\n');
r3 =its.product(words,repeat=6)
for i in r3:
i