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

Commit a3de9c3

Browse files
author
mpgn
authored
Merge pull request #641 from Dramelac/fix-ldaps-logger
Fix logging with LDAPS protocol
2 parents 43f4934 + a493672 commit a3de9c3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

cme/protocols/ldap.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,16 +254,17 @@ def plaintext_login(self, domain, username, password):
254254
hash_asreproast.write(hash_TGT + '\n')
255255
return False
256256

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

262-
# Connect to LDAP
263-
out = u'{}{}:{} {}'.format('{}\\'.format(domain),
264-
username,
265-
password if not self.config.get('CME', 'audit_mode') else self.config.get('CME', 'audit_mode')*8,
266-
highlight('({})'.format(self.config.get('CME', 'pwn3d_label')) if self.admin_privs else ''))
267268
self.logger.extra['protocol'] = "LDAP"
268269
self.logger.extra['port'] = "389"
269270
self.logger.success(out)

0 commit comments

Comments
 (0)