public static List <Computer> GetDomainRandomTargets(int count) { List <Computer> targets = new List <Computer>(); Console.WriteLine("[*] Obtaining domain random targets ..."); targets = Ldap.GetADComputers(count); return(targets); }
public static List <Computer> GetDomainRandomTargets(int count, Logger logger) { List <Computer> targets = new List <Computer>(); logger.TimestampInfo("Obtaining domain random targets ..."); targets = Ldap.GetADComputers(count, logger); return(targets); }
public static List <Computer> GetDomainNeighborTargets(int count, Lib.Logger logger) { List <Computer> targets = new List <Computer>(); PrincipalContext context = new PrincipalContext(ContextType.Domain); string dc = context.ConnectedServer; logger.TimestampInfo("Obtaining domain neighbor targets ..."); targets = Ldap.GetADComputers(count, logger, dc); //Console.WriteLine("[*] Finished"); return(targets); }
public static List <Computer> GetDomainNeighborTargets(int count) { List <Computer> targets = new List <Computer>(); string logonserver = Environment.GetEnvironmentVariable("logonserver").Replace("\\", ""); string dnsdomain = Environment.GetEnvironmentVariable("USERDNSDOMAIN"); string dc = logonserver + "." + dnsdomain; Console.WriteLine("[*] Obtaining domain neighbor targets ..."); targets = Ldap.GetADComputers(count, dc); return(targets); }
public static List <Computer> GetDomainNeighborTargets(int count) { List <Computer> targets = new List <Computer>(); /* * string logonserver = Environment.GetEnvironmentVariable("logonserver").Replace("\\",""); * string dnsdomain = Environment.GetEnvironmentVariable("USERDNSDOMAIN"); * string dc = logonserver + "." + dnsdomain; */ PrincipalContext context = new PrincipalContext(ContextType.Domain); string dc = context.ConnectedServer; //logger.TimestampInfo("[*] Obtaining domain neighbor targets ..."); Console.WriteLine("[*] Obtaining domain neighbor targets ..."); targets = Ldap.GetADComputers(count, dc); //Console.WriteLine("[*] Finished"); return(targets); }