Debugging

This commit is contained in:
Enrique Martin 2024-04-08 13:06:25 +02:00
parent 120c5ae7f9
commit 96199c0558
1 changed files with 2 additions and 2 deletions

View File

@ -340,8 +340,8 @@ def check_login_audit_policy(auditpol_logon_category, auditpol_logon_success_con
try: try:
# Run the auditpol command to check the audit policy for Logon/Logoff # Run the auditpol command to check the audit policy for Logon/Logoff
cmd_command = f'auditpol /get /subcategory:"{auditpol_logon_category}"' cmd_command = f'auditpol /get /subcategory:"{auditpol_logon_category}"'
result = subprocess.run(cmd_command, shell=True, capture_output=True, text=True, check=True, encoding='latin-1') result = subprocess.run(cmd_command, shell=True, capture_output=True, text=True, check=True)
last_line = result.stdout.encode('latin-1').decode('utf-8').strip().split('\n')[-1].strip() last_line = result.stdout.encode(sys.getdefaultencoding()).decode('utf-8').strip().split('\n')[-1].strip()
cleaned_line = re.sub(' +', ' ', last_line) cleaned_line = re.sub(' +', ' ', last_line)
# Interpret the result # Interpret the result