agent: Fix typo RansomewarePayload -> RansomwarePayload

This commit is contained in:
Mike Salvatore 2021-06-29 12:00:49 -04:00
parent 32a0a41c21
commit d87b8ae4a7
3 changed files with 7 additions and 11 deletions

View File

@ -19,7 +19,7 @@ from infection_monkey.network.HostFinger import HostFinger
from infection_monkey.network.network_scanner import NetworkScanner
from infection_monkey.network.tools import get_interface_to_target, is_running_on_island
from infection_monkey.post_breach.post_breach_handler import PostBreach
from infection_monkey.ransomware.ransomware_payload import RansomewarePayload
from infection_monkey.ransomware.ransomware_payload import RansomwarePayload
from infection_monkey.system_info import SystemInfoCollector
from infection_monkey.system_singleton import SystemSingleton
from infection_monkey.telemetry.attack.t1106_telem import T1106Telem
@ -476,7 +476,7 @@ class InfectionMonkey(object):
batching_telemetry_messenger = BatchingTelemetryMessenger(telemetry_messenger)
try:
RansomewarePayload(
RansomwarePayload(
WormConfiguration.ransomware, batching_telemetry_messenger
).run_payload()
except Exception as ex:

View File

@ -19,7 +19,7 @@ README_SRC = Path(__file__).parent / "ransomware_readme.txt"
README_DEST = "README.txt"
class RansomewarePayload:
class RansomwarePayload:
def __init__(self, config: dict, telemetry_messenger: ITelemetryMessenger):
target_directories = config["directories"]
LOG.info(

View File

@ -22,11 +22,7 @@ from tests.unit_tests.infection_monkey.ransomware.ransomware_target_files import
from tests.utils import hash_file, is_user_admin
from infection_monkey.ransomware import ransomware_payload as ransomware_payload_module
from infection_monkey.ransomware.ransomware_payload import (
EXTENSION,
README_DEST,
RansomewarePayload,
)
from infection_monkey.ransomware.ransomware_payload import EXTENSION, README_DEST, RansomwarePayload
def with_extension(filename):
@ -43,7 +39,7 @@ def ransomware_payload_config(ransomware_target):
@pytest.fixture
def ransomware_payload(ransomware_payload_config, telemetry_messenger_spy):
return RansomewarePayload(ransomware_payload_config, telemetry_messenger_spy)
return RansomwarePayload(ransomware_payload_config, telemetry_messenger_spy)
def test_file_with_excluded_extension_not_encrypted(ransomware_target, ransomware_payload):
@ -163,7 +159,7 @@ def test_telemetry_failure(monkeypatch, ransomware_payload, telemetry_messenger_
def test_readme_false(ransomware_payload_config, ransomware_target, telemetry_messenger_spy):
ransomware_payload_config["other_behaviors"]["readme"] = False
ransomware_payload = RansomewarePayload(ransomware_payload_config, telemetry_messenger_spy)
ransomware_payload = RansomwarePayload(ransomware_payload_config, telemetry_messenger_spy)
ransomware_payload.run_payload()
assert not Path(ransomware_target / README_DEST).exists()
@ -171,7 +167,7 @@ def test_readme_false(ransomware_payload_config, ransomware_target, telemetry_me
def test_readme_true(ransomware_payload_config, ransomware_target, telemetry_messenger_spy):
ransomware_payload_config["other_behaviors"]["readme"] = True
ransomware_payload = RansomewarePayload(ransomware_payload_config, telemetry_messenger_spy)
ransomware_payload = RansomwarePayload(ransomware_payload_config, telemetry_messenger_spy)
ransomware_payload.run_payload()
assert Path(ransomware_target / README_DEST).exists()