Skip to content

Commit 68c197d

Browse files
Kahvi-0Marshall-Hallenbeck
authored andcommitted
Improve Kerberoast Module
On a test where --kerberoast would not return a ticket for a user I knew was kerberoastable. After some digging I changed the LDAP query in ldap.py to be just "(&(servicePrincipalName=*)(!(objectCategory=computer)))". This removes the check for accounts locked out/inactive and this returned the ticket I was able to see with powerview. Personally would still like to get tickets for users that are disabled/locked out in order to attempt to crack their password and see if the password is reused. I also changed the error for Bypassing disabled account {sAMAccountName} to be highlight as I thought this is nice to have. Signed-off-by: Kahvi-0xFF <46513413+Kahvi-0@users.noreply.github.com>
1 parent a4cbd5b commit 68c197d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

nxc/protocols/ldap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ def asreproast(self):
928928

929929
def kerberoasting(self):
930930
# Building the search filter
931-
searchFilter = "(&(servicePrincipalName=*)(UserAccountControl:1.2.840.113556.1.4.803:=512)(!(UserAccountControl:1.2.840.113556.1.4.803:=2))(!(objectCategory=computer)))"
931+
searchFilter = "(&(servicePrincipalName=*)(!(objectCategory=computer)))"
932932
attributes = [
933933
"servicePrincipalName",
934934
"sAMAccountName",
@@ -979,7 +979,7 @@ def kerberoasting(self):
979979

980980
if mustCommit is True:
981981
if int(userAccountControl) & UF_ACCOUNTDISABLE:
982-
self.logger.debug(f"Bypassing disabled account {sAMAccountName} ")
982+
self.logger.highlight(f"Bypassing disabled account {sAMAccountName} ")
983983
else:
984984
answers += [[spn, sAMAccountName, memberOf, pwdLastSet, lastLogon, delegation] for spn in SPNs]
985985
except Exception as e:

0 commit comments

Comments
 (0)