From 9a46cee3fe8e92e7aee36cb784f306bdbf399354 Mon Sep 17 00:00:00 2001 From: MaxToffy <91328785+MaxToffy@users.noreply.github.com> Date: Fri, 29 Nov 2024 18:07:05 +0100 Subject: [PATCH] Fix dacledit.py object query on specified DN --- examples/dacledit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/dacledit.py b/examples/dacledit.py index 00fbb93af..d5ae72762 100755 --- a/examples/dacledit.py +++ b/examples/dacledit.py @@ -265,7 +265,7 @@ def __init__(self, ldap_server, ldap_session, args): self.ldap_session.search(self.domain_dumper.root, '(sAMAccountName=%s)' % escape_filter_chars(_lookedup_principal), attributes=['objectSid']) elif self.principal_DN is not None: _lookedup_principal = self.principal_DN - self.ldap_session.search(self.domain_dumper.root, '(distinguishedName=%s)' % _lookedup_principal, attributes=['objectSid']) + self.ldap_session.search(_lookedup_principal, '(distinguishedName=%s)' % _lookedup_principal, attributes=['objectSid']) try: self.principal_SID = format_sid(self.ldap_session.entries[0]['objectSid'].raw_values[0]) logging.debug("Found principal SID: %s" % self.principal_SID) @@ -410,7 +410,7 @@ def search_target_principal_security_descriptor(self): self.ldap_session.search(self.domain_dumper.root, '(objectSid=%s)' % _lookedup_principal, attributes=['nTSecurityDescriptor'], controls=controls) elif self.target_DN is not None: _lookedup_principal = self.target_DN - self.ldap_session.search(self.domain_dumper.root, '(distinguishedName=%s)' % _lookedup_principal, attributes=['nTSecurityDescriptor'], controls=controls) + self.ldap_session.search(_lookedup_principal, '(distinguishedName=%s)' % _lookedup_principal, attributes=['nTSecurityDescriptor'], controls=controls) try: self.target_principal = self.ldap_session.entries[0] logging.debug('Target principal found in LDAP (%s)' % _lookedup_principal) @@ -554,7 +554,7 @@ def printparsedDACL(self, parsed_dacl): self.ldap_session.search(self.domain_dumper.root, '(sAMAccountName=%s)' % escape_filter_chars(_lookedup_principal), attributes=['objectSid']) elif self.principal_DN is not None: _lookedup_principal = self.principal_DN - self.ldap_session.search(self.domain_dumper.root, '(distinguishedName=%s)' % _lookedup_principal, attributes=['objectSid']) + self.ldap_session.search(_lookedup_principal, '(distinguishedName=%s)' % _lookedup_principal, attributes=['objectSid']) try: self.principal_SID = format_sid(self.ldap_session.entries[0]['objectSid'].raw_values[0]) except IndexError: