From 67083fe3367b30be089a286cc9779865bfd2f154 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Wed, 23 Feb 2022 16:52:15 +0100 Subject: [PATCH] Agent: Use ITelemetryMessenger to send telemetries in WebRCE --- monkey/infection_monkey/exploit/web_rce.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/monkey/infection_monkey/exploit/web_rce.py b/monkey/infection_monkey/exploit/web_rce.py index ef13fd345..f5ff4a246 100644 --- a/monkey/infection_monkey/exploit/web_rce.py +++ b/monkey/infection_monkey/exploit/web_rce.py @@ -275,7 +275,9 @@ class WebRCE(HostExploiter): "monkey_path": dest_path, "http_path": http_path, } - T1197Telem(ScanStatus.USED, self.host, BITS_UPLOAD_STRING).send() + self.telemetry_messenger.send_telemtry( + T1197Telem(ScanStatus.USED, self.host, BITS_UPLOAD_STRING) + ) resp = self.exploit(url, backup_command) return resp @@ -333,10 +335,10 @@ class WebRCE(HostExploiter): command = CHMOD_MONKEY % {"monkey_path": path} try: resp = self.exploit(url, command) - T1222Telem(ScanStatus.USED, command, self.host).send() + self.telemetry_messenger.send_telemtry(T1222Telem(ScanStatus.USED, command, self.host)) except Exception as e: logger.error("Something went wrong while trying to change permission: %s" % e) - T1222Telem(ScanStatus.SCANNED, "", self.host).send() + self.telemetry_messenger.send_telemtry(T1222Telem(ScanStatus.SCANNED, "", self.host)) return False # If exploiter returns True / False if isinstance(resp, bool):