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", "crowdstrike"]
4maturity = "production"
5updated_date = "2024/11/02"
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 "logs-crowdstrike.fdr*",
26]
27language = "eql"
28license = "Elastic License v2"
29name = "Disable Windows Event and Security Logs Using Built-in Tools"
30note = """## Triage and analysis
31
32### Investigating Disable Windows Event and Security Logs Using Built-in Tools
33
34Windows 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.
35
36This rule looks for the usage of different utilities to disable the EventLog service or specific event logs.
37
38#### Possible investigation steps
39
40- 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.
41- Identify the user account that performed the action and whether it should perform this kind of action.
42- Contact the account owner and confirm whether they are aware of this activity.
43- Investigate other alerts associated with the user/host during the past 48 hours.
44 - Verify if any other anti-forensics behaviors were observed.
45- Investigate the event logs prior to the action for suspicious behaviors that an attacker may be trying to cover up.
46
47### False positive analysis
48
49- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
50
51### Response and remediation
52
53- Initiate the incident response process based on the outcome of the triage.
54- Isolate the involved host to prevent further post-compromise behavior.
55- Re-enable affected logging components, services, and security monitoring.
56- 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.
57- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
58- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
59- 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).
60"""
61references = [
62 "https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/logman",
63 "https://medium.com/palantir/tampering-with-windows-event-tracing-background-offense-and-defense-4be7ac62ac63",
64]
65risk_score = 21
66rule_id = "4de76544-f0e5-486a-8f84-eae0b6063cdc"
67severity = "low"
68tags = [
69 "Domain: Endpoint",
70 "OS: Windows",
71 "Use Case: Threat Detection",
72 "Tactic: Defense Evasion",
73 "Resources: Investigation Guide",
74 "Data Source: Elastic Endgame",
75 "Data Source: Elastic Defend",
76 "Data Source: System",
77 "Data Source: Microsoft Defender for Endpoint",
78 "Data Source: Sysmon",
79 "Data Source: SentinelOne",
80 "Data Source: Crowdstrike",
81]
82timestamp_override = "event.ingested"
83type = "eql"
84
85query = '''
86process where host.os.type == "windows" and event.type == "start" and
87(
88 (
89 (process.name:"logman.exe" or ?process.pe.original_file_name == "Logman.exe") and
90 process.args : "EventLog-*" and process.args : ("stop", "delete")
91 ) or
92 (
93 (
94 process.name : ("pwsh.exe", "powershell.exe", "powershell_ise.exe") or
95 ?process.pe.original_file_name in ("pwsh.exe", "powershell.exe", "powershell_ise.exe")
96 ) and
97 process.args : "Set-Service" and process.args: "EventLog" and process.args : "Disabled"
98 ) or
99 (
100 (process.name:"auditpol.exe" or ?process.pe.original_file_name == "AUDITPOL.EXE") and process.args : "/success:disable"
101 )
102)
103'''
104
105
106[[rule.threat]]
107framework = "MITRE ATT&CK"
108[[rule.threat.technique]]
109id = "T1070"
110name = "Indicator Removal"
111reference = "https://attack.mitre.org/techniques/T1070/"
112[[rule.threat.technique.subtechnique]]
113id = "T1070.001"
114name = "Clear Windows Event Logs"
115reference = "https://attack.mitre.org/techniques/T1070/001/"
116
117
118[[rule.threat.technique]]
119id = "T1562"
120name = "Impair Defenses"
121reference = "https://attack.mitre.org/techniques/T1562/"
122[[rule.threat.technique.subtechnique]]
123id = "T1562.002"
124name = "Disable Windows Event Logging"
125reference = "https://attack.mitre.org/techniques/T1562/002/"
126
127[[rule.threat.technique.subtechnique]]
128id = "T1562.006"
129name = "Indicator Blocking"
130reference = "https://attack.mitre.org/techniques/T1562/006/"
131
132
133
134[rule.threat.tactic]
135id = "TA0005"
136name = "Defense Evasion"
137reference = "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
- Clearing Windows Console History
- Clearing Windows Event Logs
- Code Signing Policy Modification Through Built-in tools
- Delete Volume USN Journal with Fsutil