agent: Sort files in ransomware payload's `_find_files()` before returning

This commit is contained in:
Shreya 2021-07-13 13:41:02 +05:30
parent 3b80221c38
commit e5160a5fb4
1 changed files with 3 additions and 1 deletions

View File

@ -70,7 +70,9 @@ class RansomwarePayload:
def _find_files(self) -> List[Path]:
LOG.info(f"Collecting files in {self._target_dir}")
return select_production_safe_target_files(self._target_dir, self._targeted_file_extensions)
return sorted(
select_production_safe_target_files(self._target_dir, self._targeted_file_extensions)
)
def _encrypt_files(self, file_list: List[Path]) -> List[Tuple[Path, Optional[Exception]]]:
LOG.info(f"Encrypting files in {self._target_dir}")