1.在实验时候,先导入crypt库:必须在Unix环境下才能实现这个模块
2.代码贴一下,以后有了Unix环境试试吧:
import cryptimport syssys.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()
时间: 2024-11-05 16:11:50