Refactor ransomware payload __init__.py into ransomware_payload.py with a stubbed ransomware payload class

This commit is contained in:
VakarisZ 2021-06-22 16:37:44 +03:00
parent d7f4035884
commit 63901bcd26
2 changed files with 27 additions and 10 deletions

View File

@ -1,10 +0,0 @@
import logging
from infection_monkey.config import WormConfiguration
LOG = logging.getLogger(__name__)
def start_ransomware():
LOG.info(f"Windows dir configured for encryption is {WormConfiguration.windows_dir_ransom}")
LOG.info(f"Linux dir configured for encryption is {WormConfiguration.linux_dir_ransom}")

View File

@ -0,0 +1,27 @@
import logging
LOG = logging.getLogger(__name__)
class RansomewarePayload:
def __init__(self, config: dict):
self.config = config
def run_payload(self):
LOG.info(
f"Windows dir configured for encryption is " f"{self.config['windows_dir_ransom']}"
)
LOG.info(f"Linux dir configured for encryption is " f"{self.config['linux_dir_ransom']}")
file_list = self._find_files()
self._encrypt_files(file_list)
def _find_files(self):
return []
def _encrypt_files(self, file_list):
for file in file_list:
self._encrypt_file(file)
def _encrypt_file(self, file):
pass