Agent: Handle pypykatz permission error

This commit is contained in:
vakarisz 2022-03-31 12:18:44 +03:00 committed by Mike Salvatore
parent 32a9fe7bf9
commit eae96c19b1
1 changed files with 5 additions and 1 deletions

View File

@ -29,7 +29,11 @@ def get_windows_creds() -> List[WindowsCredentials]:
logger.debug("Skipping pypykatz because the operating system is not Windows") logger.debug("Skipping pypykatz because the operating system is not Windows")
return [] return []
pypy_handle = pypykatz.go_live() try:
pypy_handle = pypykatz.go_live()
except Exception as err:
logger.info(f"Credential gathering with pypykatz failed: {err}")
return []
logon_data = pypy_handle.to_dict() logon_data = pypy_handle.to_dict()
windows_creds = _parse_pypykatz_results(logon_data) windows_creds = _parse_pypykatz_results(logon_data)
return windows_creds return windows_creds