Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wil committed Jul 3, 2024
1 parent 33f51ec commit c433861
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ldeep/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,7 @@ def list_pso(self, _):
print("{field}: {val}".format(field=field, val=val))

# enum principals affected by PSO if unpriv
print("Unprivileged enumeration:")
print("principal:pso_name")
results = []
# users
attributes = ["objectClass", "cn", "sAMAccountName", "msDS-PSOApplied"]
entries = self.engine.query(self.engine.USER_ALL_FILTER(), attributes)
Expand All @@ -603,7 +602,7 @@ def list_pso(self, _):
)
)
name = entry.get("sAMAccountName")
print(f"{name}:{pso}")
results.append(f"{name}:{pso}")

# groups
entries = self.engine.query(self.engine.GROUPS_FILTER(), attributes)
Expand All @@ -618,7 +617,12 @@ def list_pso(self, _):
)
)
name = entry.get("sAMAccountName")
print(f"{name}:{pso}")
results.append(f"{name}:{pso}")

if results:
print("Unprivileged enumeration:")
print("principal:pso_name")
print(*results, sep="\n")

def list_trusts(self, kwargs):
"""
Expand Down

0 comments on commit c433861

Please sign in to comment.