Skip to content

Commit ad637e1

Browse files
committed
Enable asreproast with anonymous ldap logins
1 parent 71ccfd9 commit ad637e1

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

nxc/protocols/ldap.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ def plaintext_login(self, domain, username, password):
483483
self.password = password
484484
self.domain = domain
485485

486-
if self.password == "" and self.args.asreproast:
486+
if self.username and self.password == "" and self.args.asreproast:
487487
hash_tgt = KerberosAttacks(self).get_tgt_asroast(self.username)
488488
if hash_tgt:
489489
self.logger.highlight(f"{hash_tgt}")
@@ -965,9 +965,6 @@ def active_users(self):
965965
self.logger.highlight(f"{user.get('sAMAccountName', ''):<30}{pwd_last_set:<20}{user.get('badPwdCount', ''):<9}{user.get('description', '')}")
966966

967967
def asreproast(self):
968-
if self.password == "" and self.nthash == "" and not self.kerberos:
969-
return False
970-
971968
# Building the search filter
972969
search_filter = f"(&(UserAccountControl:1.2.840.113556.1.4.803:={UF_DONT_REQUIRE_PREAUTH})(!(UserAccountControl:1.2.840.113556.1.4.803:={UF_ACCOUNTDISABLE}))(!(objectCategory=computer)))"
973970
resp = self.search(search_filter, attributes=["sAMAccountName"], sizeLimit=0)

0 commit comments

Comments
 (0)