在编写我们的UNIX口令破解机时,我们需要使用UNIX 计算口令hash 的crypt()算法。Python 标准库中已自带有crypt 库。要计算一个加密的UNIX 口令hash,只需调用函数crypt.crypt(),并将口令和salt 作为参数传递给它。该函数会以字符串形式返回口令的hash。

设计思路:

黑客穷举了字典中所有单词,并用Unix crypt() 函数对它们加密,然后将结果偷来的加密密码进行对比。 这就是:字典攻击法 ,来破解加密的口令。

环境:Ubuntu
Python3.5.2 # -*- coding: UTF-8 -*-
#破解UNIX口令密码
import crypt def testPass(cryptPass): #穷举密码
salt = cryptPass[0:2]
dicFile = open('dicfile.txt', 'r')
if salt == '$6':
for word in dicFile.readlines():
word = word.strip()
cryptWord = crypt.crypt(word,cryptPass)
if cryptWord == cryptPass:
print('[+] Found Password:' + word)
return
else:
print('[-] Not Found Password')
return
else:
for word in dicFile.readlines():
word = word.strip()
cryptWord = crypt.crypt(word, salt)
if cryptWord == cryptPass:
print('[+] Found Password:' + word)
return
else:
print('[-] Not Found Password')
return def main(): #处理口令文件
passFile = open('passwords.txt','r')
for line in passFile.readlines():
if ':' in line:
user = line.split(':')[0]
cryptPass = line.split(':')[1].strip()
print('[*] Cracking Password For: ' + user)
testPass(cryptPass) if __name__ == '__main__':
main()

get源代码戳我

UNIX口令破解机的更多相关文章

  1. Python 黑客 --- 001 UNIX口令破解机

    Python 黑客 实战:UNIX口令破解机 使用的系统:Ubuntu 14.04 LTS Python语言版本:Python 2.7.10 V crypt 库是Python内置的库.在UNIX系统使 ...

  2. python写unix口令破解器

    看了python绝技做出来的unix口令破解器 首先需要crypt. python并不自带!! windows下pip安装失败= = 后来直接去kali敲了 附件:jiami.txt #假设是unix ...

  3. Python与Hack之Zip文件口令破解

    1.需要的库: **import zipfile**import optparse**from threading import Thread(1)zipfile:1.1 zipfile.ZipFil ...

  4. Python 黑客 --- 002 入门级 ZIP压缩文件口令暴力破解机

    Python 黑客 入门级实战:ZIP压缩文件口令暴力破解机 使用的系统:Ubuntu 14.04 LTS Python语言版本:Python 2.7.10 V 编写zip 压缩文件口令破解器需要使用 ...

  5. 2017-2018-1 20155219《信息安全技术》实验二——Windows口令破解

    2017-2018-1 20155320<信息安全技术>实验二--Windows口令破解 实验目的 了解Windows口令破解原理 对信息安全有直观感性认识 能够运用工具实现口令破解 实验 ...

  6. 2017-2018-1 20155312《信息安全技术》实验二——Windows口令破解实验报告

    2017-2018-1 20155312<信息安全技术>实验二--Windows口令破解实验报告 实验目的 了解Windows口令破解原理 对信息安全有直观感性认识 能够运用工具实现口令破 ...

  7. 《信息安全技术》实验二 Windows口令破解

    <信息安全技术>实验二 Windows口令破解 实验目的 了解Windows口令破解原理 对信息安全有直观感性认识 能够运用工具实现口令破解 实验环境 实验机Windows Server ...

  8. 2017-2018-1 信息安全技术 实验二 20155201——Windows口令破解

    2017-2018-1 信息安全技术 实验二 20155201--Windows口令破解 一.实验原理 口令破解方法 口令破解主要有两种方法:字典破解和暴力破解. 字典破解是指通过破解者对管理员的了解 ...

  9. 20155203 《信息安全技术》 实验2 Windows口令破解

    实验目的 了解Windows口令破解原理 对信息安全有直观感性认识 能够运用工具实现口令破解 系统环境 Windows 实验工具 LC5 SuperDic(密码字典生成器) 实验原理 口令破解方法 口 ...

随机推荐

  1. 【H5 音乐播放实例】第一节 音乐详情页制作(1)

    本教程是一个H5音乐播放的详情页制作,实现了H5音乐播放,音轨的跳动,已经较为酷炫的UI界面. 通过本教程,您会学到: 1.H5音乐播放 (带音轨) 2.iconfont字体图标库 3.div+css ...

  2. Item 26: 避免对universal引用进行重载

    本文翻译自<effective modern C++>,由于水平有限,故无法保证翻译完全正确,欢迎指出错误.谢谢! 博客已经迁移到这里啦 如果你需要写一个以名字作为参数,并记录下当前日期和 ...

  3. Leetcode 665. Non-decreasing Array(Easy)

    Given an array with n integers, your task is to check if it could become non-decreasing by modifying ...

  4. python学习第十篇——while 的灵活运用

    sandwiches_orders = ['apple','banana','mango',"apple","watermelon"] finished_san ...

  5. scrapy框架爬取妹子图片

    首先,建立一个项目#可在github账户下载完整代码:https://github.com/connordb/scrapy-jiandan2 scrapy startproject jiandan2 ...

  6. p67交换幺环为整环的充要条件

    如何理解并且证明这个定理?谢谢 (0)是素理想,也是就是说,只要ab∈(0)就有a∈(0)或者b∈(0) 这等价于说 ab=0就有a=0或b=0. 它这里给的证明是什么意思呢?它是利用了素理想的等价刻 ...

  7. Python3练习题 026:求100以内的素数

    p = [i for i in range(2,100)] #建立2-99的列表 for i in range(3,100): #1和2都不用判断,从3开始     for j in range(2, ...

  8. h5 文件下载

    一.a 标签 移动端不支持 onDownFile= (url, filename) => { const downUrl = `http://10.1.109.123:19092/down/to ...

  9. C#复习笔记(3)--C#2:解决C#1的问题(进入快速通道的委托)

    委托 前言:C#1中就已经有了委托的概念,但是其繁杂的用法并没有引起开发者太多的关注,在C#2中,进行了一些编译器上的优化,可以用匿名方法来创建一个委托.同时,还支持的方法组和委托的转换.顺便的,C# ...

  10. [官网]How to use distributed transactions with SQL Server on Docker

    How to use distributed transactions with SQL Server on Docker https://docs.microsoft.com/en-us/sql/l ...