暴力蟒蛇,杜鹃的蛋 - 让我回到根终端

时间:2016-02-02 04:33:03

标签: python cryptography salt crypt

< p>我开始学习< code>暴力python< / code>本书中的一个练习是使用crypt()< / code>编写一个基本的< code> UNIX密码破解程序。 他们想破解的密码是< code> egg< / code>并且盐是< code> HX< / code> 不幸的是,由于某些原因,终端运行< code> Crypt.py< / code>正确地说,不会出现任何错误,然后返回< code> / root< / code>。< / p> < pre>< code>导入隐藏 def testPass(cryptPass):     salt = cryptPass [0:2]     dictFile = open(' common.txt',' r')     在dictFile.readlines()中的单词:         word = word.strip(' \ n')         cryptWord = crypt.crypt(word,salt)         if(cryptWord == cryptPass):             打印" [+]找到密码:" + word +" \ n"             返回     打印" [ - ]密码未找到。\ n" def main():     passFile = open(' passwords.txt')     for passFile.readlines()中的行:         如果":"排队:             user = line.split(':')[0]             cryptPass = line.split(':')[1] .strip('')             打印" [*]破解密码:" +用户             testPass(cryptPass) if __name__ ==" __ main __":     主要() < /代码>< /预> < p>假设我没有完全关闭,我有一个< code> passwords.txt文件< / code>使用密码< code> egg< / code>和common.txt(这是一本字典)。很明显,我在某个地方犯了一些错误。< / p>

0 个答案:

没有答案
相关问题