Agent: Check for empty result in Modify shell files

This commit is contained in:
Ilija Lazoroski 2021-10-04 17:43:55 +02:00 committed by Mike Salvatore
parent 0a4973a66e
commit e80662f7f8
2 changed files with 9 additions and 0 deletions

View File

@ -47,6 +47,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/).
- Encryptor breaking with UTF-8 characters. (Passwords in different languages can be submitted in
the config successfully now.) #1490
- Mimikatz collector no longer fails if Azure credential collector is disabled. #1512 #1493
- Unhandled error when "modify shell startup files PBA" is unable to find regular users. #1507
### Security

View File

@ -20,6 +20,13 @@ class ModifyShellStartupFiles(PBA):
def run(self):
results = [pba.run() for pba in self.modify_shell_startup_PBA_list()]
if not results:
results = [
(
"Modify shell startup files PBA failed: Unable to find any regular users",
False,
)
]
PostBreachTelem(self, results).send()
def modify_shell_startup_PBA_list(self):
@ -61,6 +68,7 @@ class ModifyShellStartupFiles(PBA):
output = subprocess.check_output( # noqa: DUO116
self.command, stderr=subprocess.STDOUT, shell=True
).decode()
return output, True
except subprocess.CalledProcessError as e:
# Return error output of the command