From 2543e5b2a514648827e99bc5f5ce1a0e1c132930 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 30 Jul 2021 04:32:50 -0400 Subject: [PATCH] Agent: Only run ransomware payload once --- monkey/infection_monkey/monkey.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monkey/infection_monkey/monkey.py b/monkey/infection_monkey/monkey.py index 0c0cca9cc..c720fe46a 100644 --- a/monkey/infection_monkey/monkey.py +++ b/monkey/infection_monkey/monkey.py @@ -237,13 +237,13 @@ class InfectionMonkey(object): if not self._keep_running: break - InfectionMonkey.run_ransomware() - if (not is_empty) and (WormConfiguration.max_iterations > iteration_index + 1): time_to_sleep = WormConfiguration.timeout_between_iterations LOG.info("Sleeping %d seconds before next life cycle iteration", time_to_sleep) time.sleep(time_to_sleep) + InfectionMonkey.run_ransomware() + if self._keep_running and WormConfiguration.alive: LOG.info("Reached max iterations (%d)", WormConfiguration.max_iterations) elif not WormConfiguration.alive: