Skip to content

Commit

Permalink
Merge pull request #59 from SAERXCIT/dumpadcs-fixaceflag
Browse files Browse the repository at this point in the history
fortra#1318 [ntlmrelayx] Dump ADCS: bug fixes
  • Loading branch information
GeisericII authored Jun 3, 2024
2 parents f4c6948 + cc42f5d commit 7fed0fc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions impacket/examples/ntlmrelayx/attacks/ldapattack.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,10 +677,12 @@ def get_enrollment_principals(entry):

for ace in (a for a in sd["Dacl"]["Data"] if a["AceType"] == ldaptypes.ACCESS_ALLOWED_OBJECT_ACE.ACE_TYPE):
sid = format_sid(ace["Ace"]["Sid"].getData())
if ace["Ace"]["ObjectTypeLen"] == 0:
if ace["Ace"]["Flags"] == 2:
uuid = bin_to_string(ace["Ace"]["InheritedObjectType"]).lower()
else:
elif ace["Ace"]["Flags"] == 1:
uuid = bin_to_string(ace["Ace"]["ObjectType"]).lower()
else:
continue

if not uuid in enrollment_uuids:
continue
Expand Down Expand Up @@ -711,7 +713,7 @@ def translate_sids(sids):
sid_map[sid] = sid
continue

if not len(self.client.response):
if not len(self.client.entries):
sid_map[sid] = sid
else:
sid_map[sid] = domain_fqdn + "\\" + self.client.response[0]["attributes"]["name"]
Expand Down

0 comments on commit 7fed0fc

Please sign in to comment.