python爆破定长密码脚本

时间:2023-12-30 17:00:50
def get_pwd(str, num):#str为可选字符集,num为密码长度
if(num == 1):
for x in str:
yield x
else:
for x in str:
for y in get_pwd(str, num-1):
yield x+y strKey=""#可选字符集
for i in range(33,127):#所有可见字符
strKey+=chr(i) for x in get_pwd(strKey,17):
#x+="0823}"
print(x)