Esempio n. 1
0
        public void GetACL(string targetDn = null)
        {
            IDisplay   displayer = new DisplayDACL();
            DACLResult result    = new DACLResult();

            if (targetDn == null)
            {
                displayer.DisplayTitle("Interesting ACL on the Domain Object");
                var domainAcl = DACL.GetInterestingACLOnObject(Searcher.LdapInfo.RootDN);
                result.Result = new List <DACL> {
                    domainAcl
                };
                displayer.DisplayResult(result);

                displayer.DisplayTitle("Interesting ACL on Group Policy Objects");
                var gposDN = GPO.GetAllGPODNList();
                result.Result = AsyncCollection.GetInterestingACLAsync(gposDN).Result;
                displayer.DisplayResult(result);

                displayer.DisplayTitle("LAPS Password View Access");
                result.Result = DACL.GetLAPSACL();
                displayer.DisplayResult(result);
            }
            else
            {
                displayer.DisplayTitle($"DACL on {targetDn.ToUpper()}");
                result.Result = new List <DACL> {
                    DACL.GetACLOnObject(targetDn)
                };
                displayer.DisplayResult(result);
            }
        }
Esempio n. 2
0
        public static async Task <List <DACL> > GetInterestingACLAsync(List <string> targetDnList)
        {
            var tasks = new List <Task <DACL> >();

            foreach (string targetDn in targetDnList)
            {
                tasks.Add(Task.Run(() => DACL.GetInterestingACLOnObject(targetDn)));
            }

            var aclList = (await Task.WhenAll(tasks)).ToList();

            return(aclList);
        }