我有以下代码:
import hashlib
pass_hash = input("Enter MD5 Hash: ")
wordlist = input("Wordlist name: ")
try:
pass_file = open(wordlist, 'r')
except FileNotFoundError:
print("File not found.")
quit()
def main():
counter = 0
print(f"List count: {str(counter)} Type: alphanum")
for word in pass_file:
encoded_word = word.encode('utf-8')
digest = hashlib.md5(encoded_word.strip()).hexdigest()
counter += 1
if digest == pass_hash:
print(f"Password found: {word}")
break
else:
print("Password not found")
main()
我试图打印逆流阶段,例如1被2替换,然后被3替换,等等,直到密码散列被破解。就像一个加载条,只需要迭代到目前为止的数字
使用字符串连接:
您可以使用回车完成此操作:
您需要刷新标准输出流以确保它被写入(通常输出流将等待大量缓冲区或换行符(\n)打印出来,因此您需要手动刷新
您还需要在找到密码时添加一个换行符,因为我们在写入计数器时不包含换行符
相关问题 更多 >
编程相关推荐