File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -578,12 +578,14 @@ def check_if_admin(self):
578
578
search_filter = "(userAccountControl:1.2.840.113556.1.4.803:=8192)"
579
579
attributes = ["objectSid" ]
580
580
resp = self .search (search_filter , attributes , sizeLimit = 0 )
581
+ resp_parsed = parse_result_attributes (resp )
582
+ from pprint import pprint
583
+ pprint (resp_parsed )
581
584
answers = []
582
585
if resp and (self .password != "" or self .lmhash != "" or self .nthash != "" or self .aesKey != "" ) and self .username != "" :
583
- for attribute in resp [0 ][1 ]:
584
- if str (attribute ["type" ]) == "objectSid" :
585
- sid = self .sid_to_str (attribute ["vals" ][0 ])
586
- self .sid_domain = "-" .join (sid .split ("-" )[:- 1 ])
586
+ sid = self .sid_to_str (resp_parsed [0 ]["objectSid" ])
587
+ print (sid )
588
+ self .sid_domain = "-" .join (sid .split ("-" )[:- 1 ])
587
589
588
590
# 2. get all group cn name
589
591
search_filter = "(|(objectSid=" + self .sid_domain + "-512)(objectSid=" + self .sid_domain + "-544)(objectSid=" + self .sid_domain + "-519)(objectSid=S-1-5-32-549)(objectSid=S-1-5-32-551))"
You can’t perform that action at this time.
0 commit comments