From 91657373895a8c778fd417cc5ff2bee591877884 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Wed, 23 Jun 2021 09:40:14 -0400 Subject: [PATCH] agent: Use larger chunk size in RansomwarePayload The larger chunk size improves efficiency by reducing the number of reads. --- monkey/infection_monkey/ransomware/ransomware_payload.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monkey/infection_monkey/ransomware/ransomware_payload.py b/monkey/infection_monkey/ransomware/ransomware_payload.py index a1c9aceff..b25297d9c 100644 --- a/monkey/infection_monkey/ransomware/ransomware_payload.py +++ b/monkey/infection_monkey/ransomware/ransomware_payload.py @@ -15,6 +15,7 @@ from infection_monkey.utils.environment import is_windows_os LOG = logging.getLogger(__name__) EXTENSION = ".m0nk3y" +CHUNK_SIZE = 4096 * 24 class RansomewarePayload: @@ -25,7 +26,7 @@ class RansomewarePayload: self._target_dir = config["windows_dir"] if is_windows_os() else config["linux_dir"] self._valid_file_extensions_for_encryption = VALID_FILE_EXTENSIONS_FOR_ENCRYPTION.copy() self._valid_file_extensions_for_encryption.discard(EXTENSION) - self._encryptor = RansomwareBitflipEncryptor(EXTENSION) + self._encryptor = RansomwareBitflipEncryptor(EXTENSION, chunk_size=CHUNK_SIZE) def run_payload(self): file_list = self._find_files()