Agent: Only run ransomware payload once

This commit is contained in:
Mike Salvatore 2021-07-30 04:32:50 -04:00
parent ce492d25f4
commit 2543e5b2a5
1 changed files with 2 additions and 2 deletions

View File

@ -237,13 +237,13 @@ class InfectionMonkey(object):
if not self._keep_running: if not self._keep_running:
break break
InfectionMonkey.run_ransomware()
if (not is_empty) and (WormConfiguration.max_iterations > iteration_index + 1): if (not is_empty) and (WormConfiguration.max_iterations > iteration_index + 1):
time_to_sleep = WormConfiguration.timeout_between_iterations time_to_sleep = WormConfiguration.timeout_between_iterations
LOG.info("Sleeping %d seconds before next life cycle iteration", time_to_sleep) LOG.info("Sleeping %d seconds before next life cycle iteration", time_to_sleep)
time.sleep(time_to_sleep) time.sleep(time_to_sleep)
InfectionMonkey.run_ransomware()
if self._keep_running and WormConfiguration.alive: if self._keep_running and WormConfiguration.alive:
LOG.info("Reached max iterations (%d)", WormConfiguration.max_iterations) LOG.info("Reached max iterations (%d)", WormConfiguration.max_iterations)
elif not WormConfiguration.alive: elif not WormConfiguration.alive: