File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77from impacket .uuid import bin_to_string
88from nxc .helpers .msada_guids import SCHEMA_OBJECTS , EXTENDED_RIGHTS
99from nxc .parsers .ldap_results import parse_result_attributes
10- from ldap3 .protocol .formatters .formatters import format_sid
1110from ldap3 .utils .conv import escape_filter_chars
1211from ldap3 .protocol .microsoft import security_descriptor_control
1312import sys
@@ -376,19 +375,6 @@ def backup(self, context):
376375 context .log .highlight ("DACL backed up to %s" , self .filename )
377376 self .filename = None
378377
379- def get_user_info (self , context , sAMAccountName ):
380- """Retrieves the SID and Distinguished Name from a sAMAccountName."""
381- try :
382- resp = self .connection .search (
383- searchFilter = f"(sAMAccountName={ escape_filter_chars (sAMAccountName )} )" ,
384- attributes = ["distinguishedName" , "objectSid" ],
385- )
386- resp_parsed = parse_result_attributes (resp )[0 ]
387- return resp_parsed ["distinguishedName" ], resp_parsed ["objectSid" ]
388- except Exception :
389- context .log .fail (f"User not found in LDAP: { sAMAccountName } " )
390- return False
391-
392378 def resolveSID (self , sid ):
393379 """Resolves a SID to its corresponding sAMAccountName."""
394380 # Tries to resolve the SID from the well known SIDs
You can’t perform that action at this time.
0 commit comments