Created
February 27, 2024 14:00
-
-
Save codeskipper/0ac5992de2722d87477920d65e21f6ca to your computer and use it in GitHub Desktop.
create NTLM hash from Mac pasteboard secret and copy to pasteboard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
## ntlm-hash.py | |
# create a NTLM hash from user input (or input redirect) | |
# thanks to https://stackoverflow.com/a/15603809 | |
# usage: | |
# - put this content in ~/dev/ntlm-hash.py | |
# - append next line (without comment) to ~/.zprofile | |
# alias 2ntlm="pbpaste | /usr/bin/python3 ~/dev/ntlm-hash.py | pbcopy" | |
# source ~/.zprofile | |
# - copy password from password manager | |
# 2ntlm | |
# - paste password into its destination | |
import sys, hashlib | |
input = sys.stdin.read() | |
print(hashlib.new('md4', input.encode('utf-16le')).hexdigest()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment