Closed 7MinSec closed 2 years ago
Digging around now it looks like it might be a python version thing. Will update with what I find.
Hello @braimee. Thanks for reporting. I'm looking into it. It seems like this is caused by Python 3.10 (https://bugs.python.org/issue40943). Nonetheless, I'll try to debug it and see if there's a way around. If you haven't found a temporary solution, I can recommend creating the NT hash yourself and pass it to Certipy with -hashes
. It's an MD4 sum of the utf16-le encoded password. So you encode the password as utf16-le (little endian) and then hash it with MD4.
Can you please try in a clean Python virtual environment? I cannot reproduce with Python 3.10
Hey pardon the delay, I started another test and used python3.9 to run the setup file. This time when I do a certipy find
I get:
[*] Finding certificate templates
[+] Authenticating to LDAP server
[-] Got error: unsupported hash type MD4
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/ldap3/utils/ntlm.py", line 500, in ntowf_v2
from Crypto.Hash import MD4 # try with the Crypto library if present
ModuleNotFoundError: No module named 'Crypto'
Googling this error it looks like I might want to install pycryptodome
but I did that, and no love. I'll keep looking but any ideas based on the info above?
I'll also try the python virtual environment but I'm a newb at that so will need to research a bit.
Hello, I'm thinking it's "just a me thing," but in the meantime I did get around this by requesting a TGT using impacket toolkit first, and then got my certipy req
to run using -k -no-pass
params.
Hello @braimee Thanks for returning back. I'm glad you resolved your issue. And even if it has something to do with your Python environment, I would be happy to see if I can do something about it by either specifying a fixed version of something to force it to be compatible. However, I cannot reproduce this error, even in a virtual environment unfortunately.
Hello @7MinSec, this was not just a you thing, this still happens in 2023 in my macOS 13.6.1 with Python 3.11.6 . pycryptodome-only installations output ValueError: unsupported hash type MD4
error, while installations with pycrypto output SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats
error.
Hello,
I'm using certipy on a pentest where my AD account password has '#' in it. When I run a 'certipy find' I get the below error in the output. I am running the latest/greatest certipy on 2 different pentests right now, and on the pentest where my password is just upper/lower/numbers (and a special character that is not a '#'), certipy runs fine.