forked from p15670423/monkey
Agent: Add IAgentRepository
This commit is contained in:
parent
0df165e140
commit
50ca81f0fc
|
@ -1 +1,2 @@
|
||||||
|
from .i_agent_repository import IAgentRepository
|
||||||
from .exploiter_wrapper import ExploiterWrapper
|
from .exploiter_wrapper import ExploiterWrapper
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue