diff --git a/monkey/infection_monkey/i_puppet.py b/monkey/infection_monkey/i_puppet.py index 6cd119ad3..11da6a260 100644 --- a/monkey/infection_monkey/i_puppet.py +++ b/monkey/infection_monkey/i_puppet.py @@ -2,7 +2,7 @@ import abc import threading from collections import namedtuple from enum import Enum -from typing import Dict +from typing import Dict, Tuple from infection_monkey.puppet.plugin_type import PluginType @@ -105,7 +105,9 @@ class IPuppet(metaclass=abc.ABCMeta): """ @abc.abstractmethod - def run_payload(self, name: str, options: Dict, interrupt: threading.Event) -> None: + def run_payload( + self, name: str, options: Dict, interrupt: threading.Event + ) -> Tuple[None, bool, str]: """ Runs a payload :param str name: The name of the payload to run diff --git a/monkey/infection_monkey/puppet/puppet.py b/monkey/infection_monkey/puppet/puppet.py new file mode 100644 index 000000000..f932d84a4 --- /dev/null +++ b/monkey/infection_monkey/puppet/puppet.py @@ -0,0 +1,54 @@ +import logging +import threading +from typing import Dict, Tuple + +from infection_monkey.i_puppet import ( + ExploiterResultData, + FingerprintData, + IPuppet, + PingScanData, + PortScanData, + PostBreachData, +) +from infection_monkey.puppet.plugin_type import PluginType + +logger = logging.getLogger() + + +class Puppet(IPuppet): + def load_plugin(self, plugin: object, plugin_type: PluginType) -> None: + pass + + def run_sys_info_collector(self, name: str) -> Dict: + pass + + def run_pba(self, name: str, options: Dict) -> PostBreachData: + pass + + def ping(self, host: str, timeout: float = 1) -> PingScanData: + pass + + def scan_tcp_port(self, host: str, port: int, timeout: float = 3) -> PortScanData: + pass + + def fingerprint( + self, + name: str, + host: str, + ping_scan_data: PingScanData, + port_scan_data: Dict[int, PortScanData], + ) -> FingerprintData: + pass + + def exploit_host( + self, name: str, host: str, options: Dict, interrupt: threading.Event + ) -> ExploiterResultData: + pass + + def run_payload( + self, name: str, options: Dict, interrupt: threading.Event + ) -> Tuple[None, bool, str]: + pass + + def cleanup(self) -> None: + pass