update logging and formatting
parent
908d72159e
commit
38ce4f6112
|
@ -43,7 +43,7 @@ class LDAPConnect:
|
||||||
if kdc is None:
|
if kdc is None:
|
||||||
kdc = domain
|
kdc = domain
|
||||||
|
|
||||||
#This checks to see if we didn't provide the LM Hash
|
# This checks to see if we didn't provide the LM Hash
|
||||||
if ntlm_hash and ntlm_hash.find(':') != -1:
|
if ntlm_hash and ntlm_hash.find(':') != -1:
|
||||||
lmhash, nthash = ntlm_hash.split(':')
|
lmhash, nthash = ntlm_hash.split(':')
|
||||||
elif ntlm_hash:
|
elif ntlm_hash:
|
||||||
|
@ -61,9 +61,7 @@ class LDAPConnect:
|
||||||
ldapConnection = ldap_impacket.LDAPConnection('ldap://%s' % kdc, baseDN)
|
ldapConnection = ldap_impacket.LDAPConnection('ldap://%s' % kdc, baseDN)
|
||||||
ldapConnection.kerberosLogin(username, password, domain, lmhash, nthash, aesKey, kdcHost=kdc, useCache=False)
|
ldapConnection.kerberosLogin(username, password, domain, lmhash, nthash, aesKey, kdcHost=kdc, useCache=False)
|
||||||
# Connect to LDAP
|
# Connect to LDAP
|
||||||
out = u'{}{}:{}'.format('{}\\'.format(domain),
|
out = f"{domain}{username}:{password if password else ntlm_hash}"
|
||||||
username,
|
|
||||||
password if password else ntlm_hash)
|
|
||||||
self.logger.extra['protocol'] = "LDAP"
|
self.logger.extra['protocol'] = "LDAP"
|
||||||
self.logger.extra['port'] = "389"
|
self.logger.extra['port'] = "389"
|
||||||
return ldapConnection
|
return ldapConnection
|
||||||
|
|
Loading…
Reference in New Issue