From 6301ec9d14b89261d30f17f42a373b0ed8d48908 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 29 Jun 2021 13:39:00 -0400 Subject: [PATCH] agent: Add a log message when ransomware leaves a README.txt --- monkey/infection_monkey/ransomware/ransomware_payload.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/monkey/infection_monkey/ransomware/ransomware_payload.py b/monkey/infection_monkey/ransomware/ransomware_payload.py index 9d85a48ea..698da80d4 100644 --- a/monkey/infection_monkey/ransomware/ransomware_payload.py +++ b/monkey/infection_monkey/ransomware/ransomware_payload.py @@ -81,7 +81,10 @@ class RansomwarePayload: def _leave_readme(self): if self._readme_enabled: + readme_dest_path = Path(self._target_dir) / README_DEST + LOG.info(f"Leaving a ransomware README file at {readme_dest_path}") + try: - shutil.copyfile(README_SRC, Path(self._target_dir) / README_DEST) + shutil.copyfile(README_SRC, readme_dest_path) except Exception as ex: LOG.warning(f"An error occurred while attempting to leave a README.txt file: {ex}")