public static void DomaiGroupDiscoveryLdap(PlaybookTask playbook_task, string log) { string currentPath = AppDomain.CurrentDomain.BaseDirectory; Lib.Logger logger = new Lib.Logger(currentPath + log); logger.SimulationHeader("T1069.002"); logger.TimestampInfo("Using LDAP to execute technique"); try { if (playbook_task.groups.Length > 0) { foreach (string group in playbook_task.groups) { logger.TimestampInfo(String.Format("Querying LDAP for members of '{0}'", group)); DiscoveryHelper.LdapQueryForObjects(logger, 2, "", group); } logger.SimulationFinished(); } else { logger.TimestampInfo("Querying LDAP for all groups"); DiscoveryHelper.LdapQueryForObjects(logger, 2); logger.SimulationFinished(); } } catch (Exception ex) { logger.SimulationFailed(ex); } }
public static void DomainAccountDiscoveryLdap(string log) { string currentPath = AppDomain.CurrentDomain.BaseDirectory; Logger logger = new Logger(currentPath + log); logger.SimulationHeader("T1087.002"); logger.TimestampInfo("Using LDAP to execute this technique"); try { DiscoveryHelper.LdapQueryForObjects(logger, 1); logger.SimulationFinished(); } catch (Exception ex) { logger.SimulationFailed(ex); } }