예제 #1
0
        public override string[] Execute(ParsedArgs args)
        {
            if (string.IsNullOrEmpty(args.GroupName))
            {
                throw new EDDException("GroupName cannot be empty");
            }

            Amass         groupMemberEnum = new Amass();
            List <string> groupMembers    = groupMemberEnum.GetDomainGroupMembers(args.GroupName);

            return(groupMembers.ToArray());
        }
예제 #2
0
        string[] FindMembersOfGroup(List <string> computers, string groupName)
        {
            try
            {
                List <string> results = new List <string>();

                Amass         findUser  = new Amass();
                List <string> groupList = findUser.GetDomainGroupMembers(groupName);

                foreach (string computerHostName in computers)
                {
                    List <Amass.WKSTA_USER_INFO_1> currentLoggedInAccounts = findUser.GetLoggedOnUsers(computerHostName);

                    foreach (string actualUser in groupList)
                    {
                        foreach (Amass.WKSTA_USER_INFO_1 loggedInHere in currentLoggedInAccounts)
                        {
                            if (String.Equals(loggedInHere.wkui1_username, actualUser, StringComparison.OrdinalIgnoreCase))
                            {
                                results.Add($"{loggedInHere.wkui1_username} is currently logged into {computerHostName}");
                            }
                        }
                    }

                    List <Amass.SESSION_INFO_10> currentSessionInfo = findUser.GetRemoteSessionInfo(computerHostName);

                    foreach (string actualDAAgain in groupList)
                    {
                        foreach (Amass.SESSION_INFO_10 sessInformation in currentSessionInfo)
                        {
                            if (String.Equals(sessInformation.sesi10_username, actualDAAgain, StringComparison.OrdinalIgnoreCase))
                            {
                                results.Add($"{sessInformation.sesi10_username} has a session on {computerHostName}");
                            }
                        }
                    }
                }

                return(results.ToArray());
            }
            catch (Exception e)
            {
                return(new string[] { "[X] Failure to enumerate info - " + e });
            }
        }
        public override string[] Execute(ParsedArgs args)
        {
            try
            {
                if (string.IsNullOrEmpty(args.GroupName))
                {
                    throw new EDDException("GroupName cannot be empty");
                }

                Amass         groupMemberEnum = new Amass();
                List <string> groupMembers    = groupMemberEnum.GetDomainGroupMembers(args.GroupName);
                return(groupMembers.ToArray());
            }
            catch (Exception e)
            {
                return(new string[] { "[X] Failure to enumerate info - " + e });
            }
        }