Mar-28-2022, 02:42 AM
Quote:Hello, I'm trying to read and compare from an online list, through a given hash, but I'm getting this error:
Quote:Does anybody can help me please?
Error:Traceback (most recent call last):
File "c:\Users\Orlando\Documents\SandBox\MasterHckPython\hack\bruteforce1.py", line 23, in <module>
main()
File "c:\Users\Orlando\Documents\SandBox\MasterHckPython\hack\bruteforce1.py", line 16, in main
z = hashlib.md5(p).encode()
TypeError: Strings must be encoded before hashing
Quote:Used Hash: 21232f297a57a5a743894a0e4a801fc3
import hashlib import urllib.request def main(): hashpass = input('Hash: ') req = urllib.request.urlopen('https://raw.githubusercontent.com/danielmiessler/SecLists/master/Passwords/Common-Credentials/10-million-password-list-top-1000000.txt') passwordlist = req.read().decode('utf-8') print(type(passwordlist)) for p in passwordlist.split('\n'): z = hashlib.md5(p).hexdigest() if z == hashpass: print('Password: {} HASH: {}'.format(p,z)) if __name__ == '__main__': main()
Quote:Regards!