Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #641 from Dramelac/fix-ldaps-logger
Browse files Browse the repository at this point in the history
Fix logging with LDAPS protocol
  • Loading branch information
mpgn committed Sep 17, 2022
2 parents 43f4934 + a493672 commit a3de9c3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cme/protocols/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,16 +254,17 @@ def plaintext_login(self, domain, username, password):
hash_asreproast.write(hash_TGT + '\n')
return False

# Prepare success credential text
out = u'{}{}:{} {}'.format('{}\\'.format(domain),
username,
password if not self.config.get('CME', 'audit_mode') else self.config.get('CME', 'audit_mode')*8,
highlight('({})'.format(self.config.get('CME', 'pwn3d_label')) if self.admin_privs else ''))
try:
# Connect to LDAP
self.ldapConnection = ldap_impacket.LDAPConnection('ldap://%s' % target, self.baseDN, self.kdcHost)
self.ldapConnection.login(self.username, self.password, self.domain, self.lmhash, self.nthash)
self.check_if_admin()

# Connect to LDAP
out = u'{}{}:{} {}'.format('{}\\'.format(domain),
username,
password if not self.config.get('CME', 'audit_mode') else self.config.get('CME', 'audit_mode')*8,
highlight('({})'.format(self.config.get('CME', 'pwn3d_label')) if self.admin_privs else ''))
self.logger.extra['protocol'] = "LDAP"
self.logger.extra['port'] = "389"
self.logger.success(out)
Expand Down

0 comments on commit a3de9c3

Please sign in to comment.