问题
How can I calculate NTLM hash of a passowrd in python? Is there any library or sample code?
I want it for writing a NTLM brute force tools with python (Like Cain & Abel )
回答1:
It is actually very quite simple use hashlib here
import hashlib,binascii
hash = hashlib.new('md4', "password".encode('utf-16le')).digest()
print binascii.hexlify(hash)
Or you can additionally use the python-ntlm library here
回答2:
You can make use of the hashlib and binascii modules to compute your NTLM hash:
import binascii, hashlib
input_str = "SOMETHING_AS_INPUT_TO_HASH"
ntlm_hash = binascii.hexlify(hashlib.new('md4', input_str.encode('utf-16le')).digest())
print ntlm_hash
来源:https://stackoverflow.com/questions/15603628/how-to-calculate-ntlm-hash-in-python