Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1318 [ntlmrelayx] Dump ADCS: bug fixes #59

Merged
merged 2 commits into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions impacket/examples/ntlmrelayx/attacks/ldapattack.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,10 +678,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 @@ -712,7 +714,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
Loading