网站首页 > 资源文章 正文
前言:
这篇文章主要介绍了python如何生成密码字典,密码字典主要是配合解密使用,下面利用python实现生成密码字典,需要的小伙伴可以参考一下
一、密码字典
所谓密码字典,主要是配合解密使用,一般情况用来暴力破解密码,是由指定字符排列组合组成的文本文件。如果知道密码设置的规律指定性生成密码,会对破解密码有决定性的帮助!!
二、字典生成
1.生成6位数小写字母+数字密码字典
代码如下(示例):
import itertools as its
words = '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 default
python dictionary.py numonly
python dictionary.py letteronly
代码如下(示例):
import itertools as its
import argparse
def 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)
- 上一篇: 渗透测试——生成密码字典(渗透测试扫描)
- 下一篇: 28G超大密码字典居然是个坑(最全的密码字典)
猜你喜欢
- 2024-10-16 8.7 创建密码字典(密码字典文件下载)
- 2024-10-16 密码字典生成工具:crunch(密码字典在线生成)
- 2024-10-16 Web渗透——制作一个属于自己的密码字典
- 2024-10-16 28G超大密码字典居然是个坑(最全的密码字典)
- 2024-10-16 渗透测试——生成密码字典(渗透测试扫描)
- 2024-10-16 如何制作密码字典(密码字典原理)
- 2024-10-16 社工密码字典生成工具|字典工具(社工库密码查询)
- 2024-10-16 个性化密码破解字典生成工具:cupp
你 发表评论:
欢迎- 最近发表
- 标签列表
-
- 电脑显示器花屏 (79)
- 403 forbidden (65)
- linux怎么查看系统版本 (54)
- 补码运算 (63)
- 缓存服务器 (61)
- 定时重启 (59)
- plsql developer (73)
- 对话框打开时命令无法执行 (61)
- excel数据透视表 (72)
- oracle认证 (56)
- 网页不能复制 (84)
- photoshop外挂滤镜 (58)
- 网页无法复制粘贴 (55)
- vmware workstation 7 1 3 (78)
- jdk 64位下载 (65)
- phpstudy 2013 (66)
- 卡通形象生成 (55)
- psd模板免费下载 (67)
- shift (58)
- localhost打不开 (58)
- 检测代理服务器设置 (55)
- frequency (66)
- indesign教程 (55)
- 运行命令大全 (61)
- ping exe (64)
本文暂时没有评论,来添加一个吧(●'◡'●)