agent: Fix incorrect config in ransomware payload

This commit is contained in:
Mike Salvatore 2021-06-25 10:18:14 -04:00
parent 1294e38f6e
commit 3d403a92e8
2 changed files with 13 additions and 4 deletions

View File

@ -17,10 +17,17 @@ CHUNK_SIZE = 4096 * 24
class RansomewarePayload:
def __init__(self, config: dict, telemetry_messenger: ITelemetryMessenger):
LOG.info(f"Windows dir configured for encryption is \"{config['windows_dir']}\"")
LOG.info(f"Linux dir configured for encryption is \"{config['linux_dir']}\"")
target_directories = config["directories"]
LOG.info(
f"Windows dir configured for encryption is \"{target_directories['windows_dir']}\""
)
LOG.info(f"Linux dir configured for encryption is \"{target_directories['linux_dir']}\"")
self._target_dir = config["windows_dir"] if is_windows_os() else config["linux_dir"]
self._target_dir = (
target_directories["windows_dir"]
if is_windows_os()
else target_directories["linux_dir"]
)
self._new_file_extension = EXTENSION
self._valid_file_extensions_for_encryption = VALID_FILE_EXTENSIONS_FOR_ENCRYPTION.copy()

View File

@ -41,7 +41,9 @@ def with_extension(filename):
@pytest.fixture
def ransomware_payload_config(ransomware_target):
return {"linux_dir": str(ransomware_target), "windows_dir": str(ransomware_target)}
return {
"directories": {"linux_dir": str(ransomware_target), "windows_dir": str(ransomware_target)}
}
@pytest.fixture