forked from p15670423/monkey
agent: Modify ransomware payload to work with modified ransomware config schema
This commit is contained in:
parent
13a94804b4
commit
4035d9d213
|
@ -21,7 +21,10 @@ README_DEST = "README.txt"
|
||||||
|
|
||||||
class RansomwarePayload:
|
class RansomwarePayload:
|
||||||
def __init__(self, config: dict, telemetry_messenger: ITelemetryMessenger):
|
def __init__(self, config: dict, telemetry_messenger: ITelemetryMessenger):
|
||||||
target_directories = config["directories"]
|
self.should_encrypt = config["encryption"]["should_encrypt"]
|
||||||
|
LOG.info(f"Encryption routine for ransomware simulation enabled: {self.should_encrypt}")
|
||||||
|
|
||||||
|
target_directories = config["encryption"]["directories"]
|
||||||
LOG.info(
|
LOG.info(
|
||||||
f"Windows dir configured for encryption is \"{target_directories['windows_dir']}\""
|
f"Windows dir configured for encryption is \"{target_directories['windows_dir']}\""
|
||||||
)
|
)
|
||||||
|
@ -44,9 +47,11 @@ class RansomwarePayload:
|
||||||
self._telemetry_messenger = telemetry_messenger
|
self._telemetry_messenger = telemetry_messenger
|
||||||
|
|
||||||
def run_payload(self):
|
def run_payload(self):
|
||||||
LOG.info("Running ransomware payload")
|
if self.should_encrypt:
|
||||||
file_list = self._find_files()
|
LOG.info("Running ransomware payload")
|
||||||
self._encrypt_files(file_list)
|
file_list = self._find_files()
|
||||||
|
self._encrypt_files(file_list)
|
||||||
|
|
||||||
self._leave_readme()
|
self._leave_readme()
|
||||||
|
|
||||||
def _find_files(self) -> List[Path]:
|
def _find_files(self) -> List[Path]:
|
||||||
|
|
Loading…
Reference in New Issue