From cef3bd618d49deda9c8f19f1f54a8a4441cb9bc8 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 22 Jun 2021 21:44:24 -0400 Subject: [PATCH] agent: Test that ransomware payload does not encrypt recursively --- .../infection_monkey/ransomware/test_ransomware_payload.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 e7dbe8964..4cc3e8c96 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 @@ -91,6 +91,12 @@ def test_symlink_not_encrypted(tmp_path, ransomware_payload): assert hash_file(tmp_path / SYMLINK) == TEST_LIB_DLL_CLEARTEXT_SHA256 +def test_encryption_not_recursive(tmp_path, ransomware_payload): + ransomware_payload.run_payload() + + assert hash_file(tmp_path / SUBDIR / HELLO_TXT) == HELLO_TXT_CLEARTEXT_SHA256 + + def test_file_with_included_extension_encrypted(tmp_path, ransomware_payload): assert hash_file(tmp_path / ALL_ZEROS_PDF) == ALL_ZEROS_PDF_CLEARTEXT_SHA256 assert hash_file(tmp_path / TEST_KEYBOARD_TXT) == TEST_KEYBOARD_TXT_CLEARTEXT_SHA256