利用Python 破解类unix系统 /etc/shadow 文件hashed password
2016-03-28 14:57
603 查看
一个比较实用的脚本吧.
破解一些弱口令还行
其他的只能去md5相关网站交钱破解喽
还是要自备字典 和 待破解文件
password文件一定是从/etc/shadow 获取的哦
破解一些弱口令还行
其他的只能去md5相关网站交钱破解喽
还是要自备字典 和 待破解文件
password文件一定是从/etc/shadow 获取的哦
#!/usr/bin/env python # coding=utf-8 #By LiT0 import crypt import sys from concurrent.futures import ThreadPoolExecutor def testpasswd(user,crypt_pass,word): salt = crypt_pass.split('$')[2] insalt = '${}${}$'.format('6',salt) word = word.strip('\n') crypt_word = crypt.crypt(word,insalt) if crypt_pass == crypt_word: print ("[*] Successful Cracked user : {} ".format(user)) print ("[+] Found Password: {}\n".format(word)) return def readpasswd(): with open(sys.argv[1],'r') as passwd_file: for line in passwd_file: if ":" in line: user = line.split(':')[0] crypt_pass = line.split(':')[1].strip(' ') if len(crypt_pass) > 16: with ThreadPoolExecutor(2) as Executor: with open(sys.argv[2],'r') as dict_file: for word in dict_file: Executor.submit(testpasswd,user,crypt_pass,word) print ('[*] All Done!') if __name__ == '__main__': if len(sys.argv) < 3: print ("Usage:\n\t请准备好阴影文件和爆破字典\n\t如: ./nix_passwd.py password.txt dict.txt ") sys.exit(0) print ('[*] Runing... ...') readpasswd()
相关文章推荐
- Python动态类型的学习---引用的理解
- Python3写爬虫(四)多线程实现数据爬取
- 垃圾邮件过滤器 python简单实现
- 下载并遍历 names.txt 文件,输出长度最长的回文人名。
- Unix 即将迎来 50 岁
- install and upgrade scrapy
- Scrapy的架构介绍
- Centos6 编译安装Python
- 使用Python生成Excel格式的图片
- 让Python文件也可以当bat文件运行
- [Python]推算数独
- Python中zip()函数用法举例
- Python中map()函数浅析
- Python将excel导入到mysql中
- Linux VS Unix:Linux欲一统天下 Unix不死
- Python在CAM软件Genesis2000中的应用
- 使用Shiboken为C++和Qt库创建Python绑定
- FREEBASIC 编译可被python调用的dll函数示例