示例#1
0
        public static void RegistryRunKeyNET(string log)
        {
            string currentPath = AppDomain.CurrentDomain.BaseDirectory;

            Lib.Logger logger = new Lib.Logger(currentPath + log);
            logger.SimulationHeader("T1060");
            //logger.TimestampInfo(String.Format("Starting T1060 Simulation on {0}", Environment.MachineName));
            //logger.TimestampInfo(String.Format("Simulation agent running as {0} with PID:{1}", System.Reflection.Assembly.GetEntryAssembly().Location, Process.GetCurrentProcess().Id));
            try
            {
                PersistenceHelper.RegistryRunKey(logger);
                logger.SimulationFinished();
            }
            catch (Exception ex)
            {
                logger.SimulationFailed(ex);
            }
        }
        public static void CreateRegistryRunKeyNET(string log, bool cleanup)
        {
            string currentPath = AppDomain.CurrentDomain.BaseDirectory;

            Lib.Logger logger = new Lib.Logger(currentPath + log);
            logger.SimulationHeader("T1547.001");
            logger.TimestampInfo("Using the Microsoft.Win32 .NET namespace to execute the technique");

            try
            {
                PersistenceHelper.RegistryRunKey(logger, cleanup);
                logger.SimulationFinished();
            }
            catch (Exception ex)
            {
                logger.SimulationFailed(ex);
            }
        }