From 7966703f63b4f6b9c5b7021a826ec84b4cfc3b95 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Thu, 15 Jul 2021 11:35:05 -0400 Subject: [PATCH] Agent: Rename readme_utils to readme_dropper --- .../ransomware/ransomware_payload_builder.py | 9 +++++++-- .../ransomware/{readme_utils.py => readme_dropper.py} | 0 .../{test_readme_utils.py => test_readme_dropper.py} | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) rename monkey/infection_monkey/ransomware/{readme_utils.py => readme_dropper.py} (100%) rename monkey/tests/unit_tests/infection_monkey/ransomware/{test_readme_utils.py => test_readme_dropper.py} (91%) diff --git a/monkey/infection_monkey/ransomware/ransomware_payload_builder.py b/monkey/infection_monkey/ransomware/ransomware_payload_builder.py index 4b13b4082..187f1e412 100644 --- a/monkey/infection_monkey/ransomware/ransomware_payload_builder.py +++ b/monkey/infection_monkey/ransomware/ransomware_payload_builder.py @@ -1,7 +1,7 @@ import logging from pprint import pformat -from infection_monkey.ransomware import ransomware_payload, readme_utils +from infection_monkey.ransomware import ransomware_payload, readme_dropper from infection_monkey.ransomware.file_selectors import ProductionSafeTargetFileSelector from infection_monkey.ransomware.in_place_file_encryptor import InPlaceFileEncryptor from infection_monkey.ransomware.ransomware_config import RansomwareConfig @@ -27,13 +27,14 @@ def build_ransomware_payload(config: dict): file_encryptor = _build_file_encryptor() file_selector = _build_file_selector() + leave_readme = _build_leave_readme() telemetry_messenger = _build_telemetry_messenger() return RansomwarePayload( ransomware_config, file_encryptor, file_selector, - readme_utils.leave_readme, + leave_readme, telemetry_messenger, ) @@ -51,6 +52,10 @@ def _build_file_selector(): return ProductionSafeTargetFileSelector(targeted_file_extensions) +def _build_leave_readme(): + return readme_dropper.leave_readme + + def _build_telemetry_messenger(): telemetry_messenger = LegacyTelemetryMessengerAdapter() diff --git a/monkey/infection_monkey/ransomware/readme_utils.py b/monkey/infection_monkey/ransomware/readme_dropper.py similarity index 100% rename from monkey/infection_monkey/ransomware/readme_utils.py rename to monkey/infection_monkey/ransomware/readme_dropper.py diff --git a/monkey/tests/unit_tests/infection_monkey/ransomware/test_readme_utils.py b/monkey/tests/unit_tests/infection_monkey/ransomware/test_readme_dropper.py similarity index 91% rename from monkey/tests/unit_tests/infection_monkey/ransomware/test_readme_utils.py rename to monkey/tests/unit_tests/infection_monkey/ransomware/test_readme_dropper.py index a1edf8424..17d0d953c 100644 --- a/monkey/tests/unit_tests/infection_monkey/ransomware/test_readme_utils.py +++ b/monkey/tests/unit_tests/infection_monkey/ransomware/test_readme_dropper.py @@ -1,7 +1,7 @@ import pytest from tests.utils import hash_file -from infection_monkey.ransomware.readme_utils import leave_readme +from infection_monkey.ransomware.readme_dropper import leave_readme DEST_FILE = "README.TXT" README_HASH = "c98c24b677eff44860afea6f493bbaec5bb1c4cbb209c6fc2bbb47f66ff2ad31"