From 33e3a31030a0340a299ef9a6099cde9c052cc9bb Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 17 Dec 2021 08:22:17 -0500 Subject: [PATCH] Agent: Move ransomware/ to payload/ransomware/ --- .gitattributes | 2 +- .../infection_monkey/{ => payload}/ransomware/__init__.py | 0 monkey/infection_monkey/{ => payload}/ransomware/consts.py | 0 .../{ => payload}/ransomware/file_selectors.py | 0 .../{ => payload}/ransomware/in_place_file_encryptor.py | 0 .../{ => payload}/ransomware/ransomware_config.py | 0 .../{ => payload}/ransomware/ransomware_payload.py | 0 .../{ => payload}/ransomware/ransomware_payload_builder.py | 0 .../{ => payload}/ransomware/ransomware_readme.txt | 0 .../{ => payload}/ransomware/readme_dropper.py | 0 .../{ => payload}/ransomware/targeted_file_extensions.py | 0 .../infection_monkey/ransomware/test_file_selectors.py | 4 ++-- .../ransomware/test_in_place_file_encryptor.py | 2 +- .../infection_monkey/ransomware/test_ransomware_config.py | 4 ++-- .../infection_monkey/ransomware/test_ransomware_payload.py | 6 +++--- .../infection_monkey/ransomware/test_readme_dropper.py | 2 +- 16 files changed, 10 insertions(+), 10 deletions(-) rename monkey/infection_monkey/{ => payload}/ransomware/__init__.py (100%) rename monkey/infection_monkey/{ => payload}/ransomware/consts.py (100%) rename monkey/infection_monkey/{ => payload}/ransomware/file_selectors.py (100%) rename monkey/infection_monkey/{ => payload}/ransomware/in_place_file_encryptor.py (100%) rename monkey/infection_monkey/{ => payload}/ransomware/ransomware_config.py (100%) rename monkey/infection_monkey/{ => payload}/ransomware/ransomware_payload.py (100%) rename monkey/infection_monkey/{ => payload}/ransomware/ransomware_payload_builder.py (100%) rename monkey/infection_monkey/{ => payload}/ransomware/ransomware_readme.txt (100%) rename monkey/infection_monkey/{ => payload}/ransomware/readme_dropper.py (100%) rename monkey/infection_monkey/{ => payload}/ransomware/targeted_file_extensions.py (100%) diff --git a/.gitattributes b/.gitattributes index 807ae6822..74db1b2f8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ monkey/tests/data_for_tests/ransomware_targets/** -text monkey/tests/data_for_tests/test_readme.txt -text monkey/tests/data_for_tests/stable_file.txt -text -monkey/infection_monkey/ransomware/ransomware_readme.txt -text +monkey/infection_monkey/payload/ransomware/ransomware_readme.txt -text diff --git a/monkey/infection_monkey/ransomware/__init__.py b/monkey/infection_monkey/payload/ransomware/__init__.py similarity index 100% rename from monkey/infection_monkey/ransomware/__init__.py rename to monkey/infection_monkey/payload/ransomware/__init__.py diff --git a/monkey/infection_monkey/ransomware/consts.py b/monkey/infection_monkey/payload/ransomware/consts.py similarity index 100% rename from monkey/infection_monkey/ransomware/consts.py rename to monkey/infection_monkey/payload/ransomware/consts.py diff --git a/monkey/infection_monkey/ransomware/file_selectors.py b/monkey/infection_monkey/payload/ransomware/file_selectors.py similarity index 100% rename from monkey/infection_monkey/ransomware/file_selectors.py rename to monkey/infection_monkey/payload/ransomware/file_selectors.py diff --git a/monkey/infection_monkey/ransomware/in_place_file_encryptor.py b/monkey/infection_monkey/payload/ransomware/in_place_file_encryptor.py similarity index 100% rename from monkey/infection_monkey/ransomware/in_place_file_encryptor.py rename to monkey/infection_monkey/payload/ransomware/in_place_file_encryptor.py diff --git a/monkey/infection_monkey/ransomware/ransomware_config.py b/monkey/infection_monkey/payload/ransomware/ransomware_config.py similarity index 100% rename from monkey/infection_monkey/ransomware/ransomware_config.py rename to monkey/infection_monkey/payload/ransomware/ransomware_config.py diff --git a/monkey/infection_monkey/ransomware/ransomware_payload.py b/monkey/infection_monkey/payload/ransomware/ransomware_payload.py similarity index 100% rename from monkey/infection_monkey/ransomware/ransomware_payload.py rename to monkey/infection_monkey/payload/ransomware/ransomware_payload.py diff --git a/monkey/infection_monkey/ransomware/ransomware_payload_builder.py b/monkey/infection_monkey/payload/ransomware/ransomware_payload_builder.py similarity index 100% rename from monkey/infection_monkey/ransomware/ransomware_payload_builder.py rename to monkey/infection_monkey/payload/ransomware/ransomware_payload_builder.py diff --git a/monkey/infection_monkey/ransomware/ransomware_readme.txt b/monkey/infection_monkey/payload/ransomware/ransomware_readme.txt similarity index 100% rename from monkey/infection_monkey/ransomware/ransomware_readme.txt rename to monkey/infection_monkey/payload/ransomware/ransomware_readme.txt diff --git a/monkey/infection_monkey/ransomware/readme_dropper.py b/monkey/infection_monkey/payload/ransomware/readme_dropper.py similarity index 100% rename from monkey/infection_monkey/ransomware/readme_dropper.py rename to monkey/infection_monkey/payload/ransomware/readme_dropper.py diff --git a/monkey/infection_monkey/ransomware/targeted_file_extensions.py b/monkey/infection_monkey/payload/ransomware/targeted_file_extensions.py similarity index 100% rename from monkey/infection_monkey/ransomware/targeted_file_extensions.py rename to monkey/infection_monkey/payload/ransomware/targeted_file_extensions.py diff --git a/monkey/tests/unit_tests/infection_monkey/ransomware/test_file_selectors.py b/monkey/tests/unit_tests/infection_monkey/ransomware/test_file_selectors.py index 42e852b95..23c723f0e 100644 --- a/monkey/tests/unit_tests/infection_monkey/ransomware/test_file_selectors.py +++ b/monkey/tests/unit_tests/infection_monkey/ransomware/test_file_selectors.py @@ -12,8 +12,8 @@ from tests.unit_tests.infection_monkey.ransomware.ransomware_target_files import ) from tests.utils import is_user_admin -from infection_monkey.ransomware.file_selectors import ProductionSafeTargetFileSelector -from infection_monkey.ransomware.ransomware_payload import README_SRC +from infection_monkey.payload.ransomware.file_selectors import ProductionSafeTargetFileSelector +from infection_monkey.payload.ransomware.ransomware_payload import README_SRC TARGETED_FILE_EXTENSIONS = [".pdf", ".txt"] diff --git a/monkey/tests/unit_tests/infection_monkey/ransomware/test_in_place_file_encryptor.py b/monkey/tests/unit_tests/infection_monkey/ransomware/test_in_place_file_encryptor.py index eb2633226..318536de9 100644 --- a/monkey/tests/unit_tests/infection_monkey/ransomware/test_in_place_file_encryptor.py +++ b/monkey/tests/unit_tests/infection_monkey/ransomware/test_in_place_file_encryptor.py @@ -11,7 +11,7 @@ from tests.unit_tests.infection_monkey.ransomware.ransomware_target_files import ) from common.utils.file_utils import get_file_sha256_hash -from infection_monkey.ransomware.in_place_file_encryptor import InPlaceFileEncryptor +from infection_monkey.payload.ransomware.in_place_file_encryptor import InPlaceFileEncryptor from infection_monkey.utils.bit_manipulators import flip_bits EXTENSION = ".m0nk3y" diff --git a/monkey/tests/unit_tests/infection_monkey/ransomware/test_ransomware_config.py b/monkey/tests/unit_tests/infection_monkey/ransomware/test_ransomware_config.py index 141186f18..3d016f80c 100644 --- a/monkey/tests/unit_tests/infection_monkey/ransomware/test_ransomware_config.py +++ b/monkey/tests/unit_tests/infection_monkey/ransomware/test_ransomware_config.py @@ -4,8 +4,8 @@ import pytest from tests.utils import raise_ from common.utils.file_utils import InvalidPath -from infection_monkey.ransomware import ransomware_config -from infection_monkey.ransomware.ransomware_config import RansomwareConfig +from infection_monkey.payload.ransomware import ransomware_config +from infection_monkey.payload.ransomware.ransomware_config import RansomwareConfig LINUX_DIR = "/tmp/test" WINDOWS_DIR = "C:\\tmp\\test" diff --git a/monkey/tests/unit_tests/infection_monkey/ransomware/test_ransomware_payload.py b/monkey/tests/unit_tests/infection_monkey/ransomware/test_ransomware_payload.py index 24eb8443d..a2b5babdb 100644 --- a/monkey/tests/unit_tests/infection_monkey/ransomware/test_ransomware_payload.py +++ b/monkey/tests/unit_tests/infection_monkey/ransomware/test_ransomware_payload.py @@ -7,9 +7,9 @@ from tests.unit_tests.infection_monkey.ransomware.ransomware_target_files import TEST_KEYBOARD_TXT, ) -from infection_monkey.ransomware.consts import README_FILE_NAME, README_SRC -from infection_monkey.ransomware.ransomware_config import RansomwareConfig -from infection_monkey.ransomware.ransomware_payload import RansomwarePayload +from infection_monkey.payload.ransomware.consts import README_FILE_NAME, README_SRC +from infection_monkey.payload.ransomware.ransomware_config import RansomwareConfig +from infection_monkey.payload.ransomware.ransomware_payload import RansomwarePayload @pytest.fixture diff --git a/monkey/tests/unit_tests/infection_monkey/ransomware/test_readme_dropper.py b/monkey/tests/unit_tests/infection_monkey/ransomware/test_readme_dropper.py index 516e03935..8736e7c0d 100644 --- a/monkey/tests/unit_tests/infection_monkey/ransomware/test_readme_dropper.py +++ b/monkey/tests/unit_tests/infection_monkey/ransomware/test_readme_dropper.py @@ -1,7 +1,7 @@ import pytest from common.utils.file_utils import get_file_sha256_hash -from infection_monkey.ransomware.readme_dropper import leave_readme +from infection_monkey.payload.ransomware.readme_dropper import leave_readme DEST_FILE = "README.TXT" README_HASH = "c98c24b677eff44860afea6f493bbaec5bb1c4cbb209c6fc2bbb47f66ff2ad31"