How to calculate NTLM hash in python?

hash, ntlm, python

Solution

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

Problem

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 )

Original source