前言解密搜索器源码:
这篇文章主要介绍了python如何生成密码字典解密搜索器源码,密码字典主要是配合解密使用,下面利用python实现生成密码字典,需要解密搜索器源码的小伙伴可以参考一下
一、密码字典所谓密码字典,主要是配合解密使用,一般情况用来暴力破解密码,是由指定字符排列组合组成解密搜索器源码的文本文件。如果知道密码设置的规律指定性生成密码,会对破解密码有决定性的帮助!!
二、字典生成1.生成6位数小写字母+数字密码字典代码如下(示例)解密搜索器源码:
import itertools as itswords = 'abcdefghijklmnopqrstuvwxyz1234567890' #采用的字符r = its.product(words, repeat=6) # repeat 要生成多少位的字典dic = open("pass.txt", "a") #保存for i in r: dic.write("".join(i)) dic.write("".join("\r"))dic.close()2.选择模式运行python dictionary.py defaultpython dictionary.py numonlypython dictionary.py letteronly代码如下(示例):
import itertools as itsimport argparsedef run_default(length,filename): global words ''' words='ha' if numonly == True: words="1234567890" else: words="1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM" ''' words="1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM" r =its.product(words,repeat=length) dic = open(filename,'a') for i in r: dic.write("".join(i)) dic.write("".join("\n")) dic.close()def run_numonly(length,filename): global words words="1234567890" r =its.product(words,repeat=length) dic = open(filename,'a') for i in r: dic.write("".join(i)) dic.write("".join("\n")) dic.close()def run_letteronly(length,filename): global words words="qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM" r =its.product(words,repeat=length) dic = open(filename,'a') for i in r: dic.write("".join(i)) dic.write("".join("\n")) dic.close()if __name__ == "__main__": choices={"default":run_default,"numonly":run_numonly,"letteronly":run_letteronly} parser=argparse.ArgumentParser(description='快速生成密码字典') parser.add_argument('model',choices=choices,help='选择哪个模式运行') parser.add_argument('--length',metavar='length',type=int,default=3,help="密码字典内密码的长度") parser.add_argument('-filename',metavar='filename',type=str,default='password.txt',help="密码字典文件昵称") #parser.add_argument('-numonly',metavar='numonly',type=bool,default=False,help="是否只含有数字") args=parser.parse_args() func=choices[args.model] func(args.length,args.filename) 海报
0 条评论
50
相关文章
本站已关闭游客评论,请登录或者注册后再评论吧~