Certipy: Authentication error for Windows Server 2022?
Facing issues when authenticating to Windows Server 2022 (password/ticket valid)
certipy find -scheme ldaps -enabled -dc-only -dc-ip <redacted> -ns <redacted> -target <redacted> -dns-tcp -k -u <redacted> -debug
Certipy v4.8.0 - by Oliver Lyak (ly4k)
...
[+] Getting TGS for 'host/<redacted>'
[+] Got TGS for 'host/<redacted>'
[-] Got error: [{'result': 49, 'description': 'invalidCredentials', 'dn': '', 'message': '80090346: LdapErr: DSID-0C09070F, comment: AcceptSecurityContext error, data 80090346, v4f7c\x00', 'referrals': None, 'saslCreds': None, 'type': 'bindResponse'}]
...
certipy find -enabled -dc-only -dc-ip <redacted> -ns <redacted> -target <redacted> -dns-tcp -u <redacted> -debug
...
[+] Authenticating to LDAP server
[-] Got error: Failed to authenticate to LDAP. Invalid credentials
About this issue
- Original URL
- State: closed
- Created 9 months ago
- Reactions: 2
- Comments: 15 (4 by maintainers)
I made a fork of LDAP3 and merged the PR from @ThePirateWhoSmellsOfSunflowers. Thanks a lot for that!
The new Certipy version
4.8.1now supports LDAP channel binding over LDAPS using NTLM authentication. Kerberos authentication isn’t supported, and LDAP signing isn’t supported as well. While I’d like to support Kerberos and LDAP signing, I do not have the time or knowledge yet to implement this in the forked LDAP3 module.If you encounter an environment with LDAP signing, I’d recommend using LDAPS instead of LDAP, and if required, use channel binding as well with the new
-ldap-channel-bindingswitch. To use the new channel binding feature, it is required to pip install the forked module:pip3 install git+https://github.com/ly4k/ldap3. This will uninstall the old module and install the forked module. The old module doesn’t seem to have had any commits since May 2023, but I’ll try to keep an eye on it.In the meantime, we’ll use this quick and dirty fix, and Certipy will spit out better error messages with relevant information (including the pip install command) if you end up in this scenario.
Thanks for reporting. I am looking into it.
This worked in my environment with
-scheme ldaps- I just adjustedldap.pyquick and dirty. Many thanks, great community!I have a Github sponsors profile, which isn’t supposed to be public yet, as I’m planning to publish it when my next tool is released, but it is available and live here: https://github.com/sponsors/ly4k 😃
As for Certipy, I am considering making a fork of ldap3 and merging the PRs. I will test later.
Yeah this seemed to fix the invalidCredential issue , which is a step forward in the right direction . But now i have another issue with enum.py :
I have seen some other issues that relate to my new one , I’ll try to see If i can fix it like its mentioned in this issue https://github.com/ly4k/Certipy/issues/159 . Thank you very much for your time and for your help @ThePirateWhoSmellsOfSunflowers @ly4k .
Simple Authentication is a “non NTLM authentication” as defined in the LDAPv3 RFC but Active Directory is compatible with it. You will need to change certipy code to something like
instead of
Yes the password is sent in cleartext but within a TLS channel, because you are using LDAPS.