From 8c5f25a2db0817c8dd048e9a0237bdb92fa2f538 Mon Sep 17 00:00:00 2001 From: mpgn Date: Sun, 12 Feb 2023 16:11:22 -0500 Subject: [PATCH] if ldaps then ldaps my friend --- cme/protocols/ldap.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cme/protocols/ldap.py b/cme/protocols/ldap.py index 9bc1b15e..83081084 100644 --- a/cme/protocols/ldap.py +++ b/cme/protocols/ldap.py @@ -185,7 +185,8 @@ class ldap(connection): def get_ldap_info(self, host): try: - ldapConnection = ldap_impacket.LDAPConnection('ldap://%s' % host) + proto = "ldaps" if (self.args.gmsa or self.args.port == 636) else "ldap" + ldapConnection = ldap_impacket.LDAPConnection(proto + '://%s' % host) resp = ldapConnection.search(scope=ldapasn1_impacket.Scope('baseObject'), attributes=['defaultNamingContext', 'dnsHostName'], sizeLimit=0) for item in resp: