if ldaps then ldaps my friend
parent
59e0e6b340
commit
8c5f25a2db
|
@ -185,7 +185,8 @@ class ldap(connection):
|
||||||
|
|
||||||
def get_ldap_info(self, host):
|
def get_ldap_info(self, host):
|
||||||
try:
|
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)
|
resp = ldapConnection.search(scope=ldapasn1_impacket.Scope('baseObject'), attributes=['defaultNamingContext', 'dnsHostName'], sizeLimit=0)
|
||||||
for item in resp:
|
for item in resp:
|
||||||
|
|
Loading…
Reference in New Issue