OUTPUT:

[+] Hash type SHA-512 detected ... 
[+] Be patien ... 
[DEBUG]: 65536 
[DEBUG]: A9UiC2ng 
[DEBUG]: hellocat 
Traceback (most recent call last): 
File "ShadowFileCracker.py", line 63, in <module> 
    main() 
    File "ShadowFileCracker.py", line 60, in main 
    testPass(cryptPass,user) 
    File "ShadowFileCracker.py", line 34, in testPass 
    cryptWord = hashlib.pbkdf2_hmac(digest().name,bytearray(word, 'utf-8'),bytearray(salt, 'utf-8'), rounds) 
TypeError: an integer is required 

rounds变量需要是一个整数,而不是字符串。正确的路线应该是:

rounds = int(cryptPass.split("$")[2].strip('rounds=')) 

此外,strip()可能不去除领先的“轮=”最好的方法。它会起作用,但它会去掉一组字符而不是一个字符串。稍好的方法是:

rounds = int(cryptPass.split("$")[2].split("=")[1]) 

相关推荐