Disable Windows Event and Security Logs Using Built-in Tools
Identifies attempts to disable EventLog via the logman Windows utility, PowerShell, or auditpol. This is often done by attackers in an attempt to evade detection on a system.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2021/05/06"
3integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel"]
4maturity = "production"
5updated_date = "2024/10/15"
6min_stack_version = "8.14.0"
7min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
8
9[rule]
10author = ["Elastic", "Ivan Ninichuck", "Austin Songer"]
11description = """
12Identifies attempts to disable EventLog via the logman Windows utility, PowerShell, or auditpol. This is often done by
13attackers in an attempt to evade detection on a system.
14"""
15from = "now-9m"
16index = [
17 "winlogbeat-*",
18 "logs-endpoint.events.process-*",
19 "logs-windows.forwarded*",
20 "logs-windows.sysmon_operational-*",
21 "endgame-*",
22 "logs-system.security*",
23 "logs-m365_defender.event-*",
24 "logs-sentinel_one_cloud_funnel.*",
25]
26language = "eql"
27license = "Elastic License v2"
28name = "Disable Windows Event and Security Logs Using Built-in Tools"
29note = """## Triage and analysis
30
31### Investigating Disable Windows Event and Security Logs Using Built-in Tools
32
33Windows event logs are a fundamental data source for security monitoring, forensics, and incident response. Adversaries can tamper, clear, and delete this data to break SIEM detections, cover their tracks, and slow down incident response.
34
35This rule looks for the usage of different utilities to disable the EventLog service or specific event logs.
36
37#### Possible investigation steps
38
39- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
40- Identify the user account that performed the action and whether it should perform this kind of action.
41- Contact the account owner and confirm whether they are aware of this activity.
42- Investigate other alerts associated with the user/host during the past 48 hours.
43 - Verify if any other anti-forensics behaviors were observed.
44- Investigate the event logs prior to the action for suspicious behaviors that an attacker may be trying to cover up.
45
46### False positive analysis
47
48- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
49
50### Response and remediation
51
52- Initiate the incident response process based on the outcome of the triage.
53- Isolate the involved host to prevent further post-compromise behavior.
54- Re-enable affected logging components, services, and security monitoring.
55- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
56- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
57- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
58- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
59"""
60references = [
61 "https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/logman",
62 "https://medium.com/palantir/tampering-with-windows-event-tracing-background-offense-and-defense-4be7ac62ac63",
63]
64risk_score = 21
65rule_id = "4de76544-f0e5-486a-8f84-eae0b6063cdc"
66severity = "low"
67tags = [
68 "Domain: Endpoint",
69 "OS: Windows",
70 "Use Case: Threat Detection",
71 "Tactic: Defense Evasion",
72 "Resources: Investigation Guide",
73 "Data Source: Elastic Endgame",
74 "Data Source: Elastic Defend",
75 "Data Source: System",
76 "Data Source: Microsoft Defender for Endpoint",
77 "Data Source: Sysmon",
78 "Data Source: SentinelOne",
79]
80timestamp_override = "event.ingested"
81type = "eql"
82
83query = '''
84process where host.os.type == "windows" and event.type == "start" and
85(
86 ((process.name:"logman.exe" or ?process.pe.original_file_name == "Logman.exe") and
87 process.args : "EventLog-*" and process.args : ("stop", "delete")) or
88
89 ((process.name : ("pwsh.exe", "powershell.exe", "powershell_ise.exe") or ?process.pe.original_file_name in
90 ("pwsh.exe", "powershell.exe", "powershell_ise.exe")) and
91 process.args : "Set-Service" and process.args: "EventLog" and process.args : "Disabled") or
92
93 ((process.name:"auditpol.exe" or ?process.pe.original_file_name == "AUDITPOL.EXE") and process.args : "/success:disable")
94)
95'''
96
97
98[[rule.threat]]
99framework = "MITRE ATT&CK"
100[[rule.threat.technique]]
101id = "T1070"
102name = "Indicator Removal"
103reference = "https://attack.mitre.org/techniques/T1070/"
104[[rule.threat.technique.subtechnique]]
105id = "T1070.001"
106name = "Clear Windows Event Logs"
107reference = "https://attack.mitre.org/techniques/T1070/001/"
108
109
110[[rule.threat.technique]]
111id = "T1562"
112name = "Impair Defenses"
113reference = "https://attack.mitre.org/techniques/T1562/"
114[[rule.threat.technique.subtechnique]]
115id = "T1562.002"
116name = "Disable Windows Event Logging"
117reference = "https://attack.mitre.org/techniques/T1562/002/"
118
119[[rule.threat.technique.subtechnique]]
120id = "T1562.006"
121name = "Indicator Blocking"
122reference = "https://attack.mitre.org/techniques/T1562/006/"
123
124
125
126[rule.threat.tactic]
127id = "TA0005"
128name = "Defense Evasion"
129reference = "https://attack.mitre.org/tactics/TA0005/"
Triage and analysis
Investigating Disable Windows Event and Security Logs Using Built-in Tools
Windows event logs are a fundamental data source for security monitoring, forensics, and incident response. Adversaries can tamper, clear, and delete this data to break SIEM detections, cover their tracks, and slow down incident response.
This rule looks for the usage of different utilities to disable the EventLog service or specific event logs.
Possible investigation steps
- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
- Identify the user account that performed the action and whether it should perform this kind of action.
- Contact the account owner and confirm whether they are aware of this activity.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Verify if any other anti-forensics behaviors were observed.
- Investigate the event logs prior to the action for suspicious behaviors that an attacker may be trying to cover up.
False positive analysis
- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved host to prevent further post-compromise behavior.
- Re-enable affected logging components, services, and security monitoring.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
References
Related rules
- Adding Hidden File Attribute via Attrib
- Bypass UAC via Event Viewer
- Clearing Windows Console History
- Clearing Windows Event Logs
- Code Signing Policy Modification Through Built-in tools