Agent: Use ITelemetryMessenger to send telemetries in WebRCE

This commit is contained in:
Ilija Lazoroski 2022-02-23 16:52:15 +01:00 committed by Shreya Malviya
parent 57eca553a7
commit 67083fe336
1 changed files with 5 additions and 3 deletions

View File

@ -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):