1.在实验时候,先导入crypt库:必须在Unix环境下才能实现这个模块

2.代码贴一下,以后有了Unix环境试试吧:

import crypt
import sys
sys.modules['Crypto']=crypto def testPass(cryptPass):
salt=cryptPass[0:2]
dictFile=open('dictionary.txt','r')
for word in dictFile.readline():
word=word.strip('\n')
cryptWord=crypto.crypto(word,salt)
if(cryptWord==cryptPass):
print("[+] Found Password:"+word+"\n") print("[-] Password Not Found.\n") def main():
passFile=open('passwords.txt')
for line in passFile.readline():
if ":" in line:
user=line.split(':')[0]
cryptPass=line.split(':')[1].strip(' ')
print("[+] Cracking Password For:"+user)
testPass(cryptPass)
if __name__=="__main__":
main()

Python与Hack之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. UNIX口令破解机

    在编写我们的UNIX口令破解机时,我们需要使用UNIX 计算口令hash 的crypt()算法.Python 标准库中已自带有crypt 库.要计算一个加密的UNIX 口令hash,只需调用函数cry ...

  4. python正常时间和unix时间戳时间的相互转换源码

    在学习过程,将内容过程比较常用的一些内容做个珍藏,下面的内容段是关于python正常时间和unix时间戳时间的相互转换的内容,应该是对各朋友有些帮助. import time def timestam ...

  5. python正常时间和unix时间戳相互转换的方法

    python正常时间和unix时间戳相互转换的方法 本文实例讲述了python正常时间和unix时间戳相互转换的方法.分享给大家供大家参考.具体分析如下: 这段代码可以用来转换常规时间格式为unix时 ...

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

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

  7. Python与Hack之守护进程

    1.什么是守护进程: 在linux或者unix操作系统中,守护进程(Daemon)是一种运行在后台的特殊进程,它独立于控制终端并且周期性的执行某种任务或等待处理某些发生的事件.由于在linux中,每个 ...

  8. Python脚本破解压缩文件口令(zipfile)

    环境:Windows python版本2.7.15 Python中操作zip压缩文件的模块是 zipfile . 相关文章:Python中zipfile压缩文件模块的使用 我们破解压缩文件的口令也是用 ...

  9. Python脚本暴力破解FTP口令(ftplib)

    目录 判断FTP服务器是否允许匿名登录 暴力破解FTP口令 列出FTP目录内的网页文件 综合 环境:Windows python2.7.15 ftplib模块是python下用于ftp服务的模块 . ...

随机推荐

  1. 【leetcode】Binary Tree Maximum Path Sum (medium)

    Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. ...

  2. 【leetcode】Set Matrix Zeroes(middle)

    Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. 思路:不能用 ...

  3. 【编程题目】n 个数字(0,1,…,n-1)形成一个圆圈,从数字 0 开始

    第 18 题(数组):题目:n 个数字(0,1,…,n-1)形成一个圆圈,从数字 0 开始,每次从这个圆圈中删除第 m 个数字(第一个为当前数字本身,第二个为当前数字的下一个数字).当一个数字删除后, ...

  4. 【HTTP】WireShark中获取Content-Encoding: gzip时的响应内容

    GZIP格式 详见:http://blog.csdn.net/jison_r_wang/article/details/52068607 表述的很清楚 关键:GZIP头以0x1F8B开始 用WireS ...

  5. sqlserver 动态行转列

    DECLARE @SQL VARCHAR(8000)SET @SQL = 'select overcode 'SELECT @SQL = @SQL + ' , max(case header when ...

  6. IOS-ARC和垃圾回收机制

    ARC是编译层面的东西,垃圾回收是程序运行以后的机制,两者不可混为一谈 苹果觉得垃圾回收这种严重影响电源使用效率的特性,同移动设备天生的实时性是相冲突的.但是在iOS 5当中苹果引入了自动内存管理机制 ...

  7. 在web.xml中classpath和classpath*的区别

    classpath 和 classpath* 区别: classpath:只会到你指定的class路径中查找找文件; classpath*:不仅包含class路径,还包括jar文件中(class路径) ...

  8. MyBatis mapper文件中的变量引用方式#{}与${}的差别

    MyBatis mapper文件中的变量引用方式#{}与${}的差别 #{},和 ${}传参的区别如下:使用#传入参数是,sql语句解析是会加上"",当成字符串来解析,这样相比于$ ...

  9. Hibernate项目用Maven创建(转)

    本文将用Maven3.Hibernate3.6.Oracle10g整合,作为例子. 环境清单: 1.Maven3.0.5 2.Hibernate3.6.5 Final 3.JDK1.7.0.11 4. ...

  10. hdu 1005

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1005 思路:找规律题 #include<stdio.h> main() { ]; int ...