Skip to content

Instantly share code, notes, and snippets.

@Yeeb1
Created October 27, 2023 07:46
Show Gist options
  • Save Yeeb1/a88e23239cf7fb72dff74b28d9a7282e to your computer and use it in GitHub Desktop.
Save Yeeb1/a88e23239cf7fb72dff74b28d9a7282e to your computer and use it in GitHub Desktop.
smal script to convert a password to NTLM
#!/usr/bin/env python3
import hashlib
import sys
def compute_ntlm_hash(password):
password = password.encode('utf-16-le')
return hashlib.new('md4', password).hexdigest().lower()
if __name__ == '__main__':
if len(sys.argv) != 2:
print("Usage: ntlm_hasher.py <password>")
sys.exit(1)
password = sys.argv[1]
ntlm_hash = compute_ntlm_hash(password)
print("NTLM Hash:", ntlm_hash)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment