Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for empty result in Modify shell files #1510

Merged
merged 1 commit into from
Oct 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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