@@ -364,7 +364,7 @@ def kerberos_login(self, domain, username, password="", ntlm_hash="", aesKey="",
364364 if nthash :
365365 self .nthash = nthash
366366
367- if self .password == "" and self .args .asreproast :
367+ if self .username and self . password == "" and self .args .asreproast :
368368 hash_tgt = KerberosAttacks (self ).get_tgt_asroast (self .username )
369369 if hash_tgt :
370370 self .logger .highlight (f"{ hash_tgt } " )
@@ -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 } " )
@@ -574,7 +574,7 @@ def hash_login(self, domain, username, ntlm_hash):
574574 self .username = username
575575 self .domain = domain
576576
577- if self .hash == "" and self .args .asreproast :
577+ if self .username and self . hash == "" and self .args .asreproast :
578578 hash_tgt = KerberosAttacks (self ).get_tgt_asroast (self .username )
579579 if hash_tgt :
580580 self .logger .highlight (f"{ hash_tgt } " )
@@ -875,7 +875,7 @@ def resolve_and_display_hostname(name, domain_name=None):
875875 trust_direction = int (trust ["trustDirection" ])
876876 trust_type = int (trust ["trustType" ])
877877 trust_attributes = int (trust ["trustAttributes" ])
878-
878+
879879 # See: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/e9a2d23c-c31e-4a6f-88a0-6646fdb51a3c
880880 trust_attribute_flags = {
881881 0x1 : "Non-Transitive" ,
@@ -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