diff --git a/pandora_agents/plugins/windows/pandora_security_win/src/pandora_security_win.py b/pandora_agents/plugins/windows/pandora_security_win/src/pandora_security_win.py index 1e78c5f815..b8e3fb850d 100644 --- a/pandora_agents/plugins/windows/pandora_security_win/src/pandora_security_win.py +++ b/pandora_agents/plugins/windows/pandora_security_win/src/pandora_security_win.py @@ -340,7 +340,7 @@ def check_login_audit_policy(auditpol_logon_category, auditpol_logon_success_con try: # Run the auditpol command to check the audit policy for Logon/Logoff cmd_command = f'auditpol /get /subcategory:"{auditpol_logon_category}"' - result = subprocess.run(cmd_command, shell=True, capture_output=True, text=True, check=True) + result = subprocess.run(cmd_command, shell=True, capture_output=True, text=True, check=True, encoding=sys.getdefaultencoding()) last_line = result.stdout.strip().split('\n')[-1].strip() last_line_parts = re.split(r'\s\s+', last_line) cleaned_line = re.sub(' +', ' ', last_line)