diff --git a/monkey/infection_monkey/puppet/puppet.py b/monkey/infection_monkey/puppet/puppet.py index 64a8028e3..3e2ad0f5f 100644 --- a/monkey/infection_monkey/puppet/puppet.py +++ b/monkey/infection_monkey/puppet/puppet.py @@ -13,27 +13,30 @@ from infection_monkey.i_puppet import ( ) from infection_monkey.puppet.plugin_registry import PluginRegistry +from .mock_puppet import MockPuppet + logger = logging.getLogger() class Puppet(IPuppet): def __init__(self) -> None: + self._mock_puppet = MockPuppet() self._plugin_registry = PluginRegistry() def load_plugin(self, plugin_name: str, plugin: object, plugin_type: PluginType) -> None: self._plugin_registry.load_plugin(plugin_name, plugin, plugin_type) def run_sys_info_collector(self, name: str) -> Dict: - pass + return self._mock_puppet.run_sys_info_collector(name) def run_pba(self, name: str, options: Dict) -> PostBreachData: - pass + return self._mock_puppet.run_pba(name, options) def ping(self, host: str, timeout: float = 1) -> PingScanData: - pass + return self._mock_puppet.ping(host, timeout) def scan_tcp_port(self, host: str, port: int, timeout: float = 3) -> PortScanData: - pass + return self._mock_puppet.scan_tcp_port(host, port, timeout) def fingerprint( self, @@ -42,12 +45,12 @@ class Puppet(IPuppet): ping_scan_data: PingScanData, port_scan_data: Dict[int, PortScanData], ) -> FingerprintData: - pass + return self._mock_puppet.fingerprint(name, host, ping_scan_data, port_scan_data) def exploit_host( self, name: str, host: str, options: Dict, interrupt: threading.Event ) -> ExploiterResultData: - pass + return self._mock_puppet.exploit_host(name, host, options, interrupt) def run_payload(self, name: str, options: Dict, interrupt: threading.Event): payload = self._plugin_registry.get_plugin(name, PluginType.PAYLOAD)