Agent: Add IAgentRepository

This commit is contained in:
Mike Salvatore 2022-02-28 15:27:59 -05:00
parent 0df165e140
commit 50ca81f0fc
2 changed files with 22 additions and 0 deletions

View File

@ -1 +1,2 @@
from .i_agent_repository import IAgentRepository
from .exploiter_wrapper import ExploiterWrapper

View File

@ -0,0 +1,21 @@
import abc
import io
class IAgentRepository(metaclass=abc.ABCMeta):
"""
IAgentRepository provides an interface for other components to access agent binaries. Notably,
this is used by exploiters during propagation to retrieve the appropriate agent binary so that
it can be uploaded to a victim and executed.
"""
@abc.abstractmethod
def get_agent_binary(self, os: str, architecture: str = None) -> io.BytesIO:
"""
Retrieve the appropriate agent binary from the repository.
:param str os: The name of the operating system on which the agent binary will run
:param str architecture: Reserved
:return: A file-like object for the requested agent binary
:rtype: io.BytesIO
"""
pass