Skip to content

Commit

Permalink
Agent: Check for empty result in Modify shell files
Browse files Browse the repository at this point in the history
  • Loading branch information
ilija-lazoroski authored and mssalvatore committed Oct 5, 2021
1 parent 0a4973a commit dc1735e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ def __init__(self):

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):
Expand Down Expand Up @@ -61,6 +68,7 @@ def run(self):
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
Expand Down

0 comments on commit dc1735e

Please sign in to comment.