Skip to content

Commit e17b5ad

Browse files
committed
Prevent crash when password flag was not specified
1 parent 5fb9946 commit e17b5ad

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

nxc/protocols/ldap.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,13 +1004,15 @@ def kerberoasting(self):
10041004
skipped.append(base_name)
10051005
continue
10061006

1007+
if not self.username:
1008+
self.logger.fail("Likely executed without password flag. Please run the command with -p ''")
1009+
return
10071010
hashline = KerberosAttacks(self).get_tgs_no_preauth(self.username, spn)
10081011
if hashline:
10091012
hashes.append(hashline)
10101013

10111014
if skipped:
10121015
self.logger.display(f"Skipping account: {', '.join(skipped)}")
1013-
10141016
if hashes:
10151017
self.logger.display(f"Total of records returned {len(hashes)}")
10161018
else:
@@ -1021,7 +1023,6 @@ def kerberoasting(self):
10211023
if self.args.kerberoasting:
10221024
with open(self.args.kerberoasting, "a+", encoding="utf-8") as f:
10231025
f.write(line + "\n")
1024-
10251026
return
10261027

10271028
# Building the search filter

0 commit comments

Comments
 (0)