agent: Catch and log exceptions thrown by the ransomware payload

This commit is contained in:
Mike Salvatore 2021-06-28 09:28:43 -04:00
parent 33a6e72df5
commit 59efaabd50
1 changed files with 5 additions and 2 deletions

View File

@ -469,5 +469,8 @@ class InfectionMonkey(object):
@staticmethod
def run_ransomware():
telemetry_messenger = TelemetryMessengerWrapper()
RansomewarePayload(WormConfiguration.ransomware, telemetry_messenger).run_payload()
try:
telemetry_messenger = TelemetryMessengerWrapper()
RansomewarePayload(WormConfiguration.ransomware, telemetry_messenger).run_payload()
except Exception as ex:
LOG.error(f"An unexpected error occurred while running the ransomware payload: {ex}")