示例#1
0
        public WmicLauncherMenuItem(CovenantAPI CovenantClient, EventPrinter EventPrinter) : base(CovenantClient, EventPrinter)
        {
            this.wmicLauncher    = CovenantClient.ApiLaunchersWmicGet();
            this.MenuTitle       = wmicLauncher.Name;
            this.MenuDescription = wmicLauncher.Description;

            this.AdditionalOptions.Add(new MenuCommandWmicLauncherShow(CovenantClient));
            this.AdditionalOptions.Add(new MenuCommandWmicLauncherGenerate(CovenantClient));
            this.AdditionalOptions.Add(new MenuCommandWmicLauncherCode());
            this.AdditionalOptions.Add(new MenuCommandWmicLauncherHost(CovenantClient));
            this.AdditionalOptions.Add(new MenuCommandWmicLauncherWriteFile());
            var setCommand = new MenuCommandWmicLauncherSet(CovenantClient);

            this.AdditionalOptions.Add(setCommand);
            this.AdditionalOptions.Add(new MenuCommandGenericUnset(setCommand.Parameters.FirstOrDefault(P => P.Name == "Option").Values));

            this.Refresh();
        }
示例#2
0
        public WmicLauncherMenuItem(CovenantAPI CovenantClient) : base(CovenantClient)
        {
            try
            {
                this.WmicLauncher    = CovenantClient.ApiLaunchersWmicGet();
                this.MenuTitle       = WmicLauncher.Name;
                this.MenuDescription = WmicLauncher.Description;

                this.AdditionalOptions.Add(new MenuCommandWmicLauncherShow(CovenantClient));
                this.AdditionalOptions.Add(new MenuCommandWmicLauncherGenerate(CovenantClient));
                this.AdditionalOptions.Add(new MenuCommandWmicLauncherCode(CovenantClient));
                this.AdditionalOptions.Add(new MenuCommandWmicLauncherHost(CovenantClient));
                this.AdditionalOptions.Add(new MenuCommandWmicLauncherWriteFile(CovenantClient));
                var setCommand = new MenuCommandWmicLauncherSet(CovenantClient);
                this.AdditionalOptions.Add(setCommand);
                this.AdditionalOptions.Add(new MenuCommandGenericUnset(setCommand.Parameters.FirstOrDefault(P => P.Name == "Option").Values));
            }
            catch (HttpOperationException e)
            {
                EliteConsole.PrintFormattedWarningLine("CovenantException: " + e.Response.Content);
            }
        }