Skip to content

Commit

Permalink
Merge pull request #169 from b1two/master
Browse files Browse the repository at this point in the history
Allow authentication when LM hash is empty
  • Loading branch information
dirkjanm authored Jul 26, 2024
2 parents 92521a0 + e4d826f commit c28669b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bloodhound/ad/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ def getLDAPConnection(self, hostname='', ip='', baseDN='', protocol='ldaps', gc=
server = Server("%s://%s" % (protocol, ip), get_info=ALL)
# ldap3 supports auth with the NT hash. LM hash is actually ignored since only NTLMv2 is used.
if self.nt_hash != '':
ldappass = self.lm_hash + ':' + self.nt_hash
if self.lm_hash != '':
ldappass = self.lm_hash + ':' + self.nt_hash
else:
# ldap3 requires a 32-character long string for LM hash in order to use the NT hash
ldappass = 'aad3b435b51404eeaad3b435b51404ee:' + self.nt_hash
else:
ldappass = self.password
ldaplogin = '%s\\%s' % (self.userdomain, self.username)
Expand Down

0 comments on commit c28669b

Please sign in to comment.