Clearing Windows Event Logs

Identifies attempts to clear or disable Windows event log stores using Windows wevetutil command. This is often done by attackers in an attempt to evade detection or destroy forensic evidence on a system.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2020/02/18"
  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"]
 11description = """
 12Identifies attempts to clear or disable Windows event log stores using Windows wevetutil command. This is often done by
 13attackers in an attempt to evade detection or destroy forensic evidence 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 = "Clearing Windows Event Logs"
 30note = """## Triage and analysis
 31
 32### Investigating Clearing Windows Event Logs
 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 execution of the `wevtutil.exe` utility or the `Clear-EventLog` cmdlet to clear 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 mechanism can be used legitimately. Analysts can dismiss the alert if the administrator is aware of the activity and there are justifications for this action.
 50- Analyze whether the cleared event log is pertinent to security and general monitoring. Administrators can clear non-relevant event logs using this mechanism. If this activity is expected and noisy in your environment, consider adding exceptions — preferably with a combination of user and command line conditions.
 51
 52### Response and remediation
 53
 54- Initiate the incident response process based on the outcome of the triage.
 55  - This activity is potentially done after the adversary achieves its objectives on the host. Ensure that previous actions, if any, are investigated accordingly with their response playbooks.
 56- Isolate the involved host to prevent further post-compromise behavior.
 57- 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.
 58- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 59- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 60- 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).
 61"""
 62references = ["https://www.elastic.co/security-labs/invisible-miners-unveiling-ghostengine"]
 63risk_score = 21
 64rule_id = "d331bbe2-6db4-4941-80a5-8270db72eb61"
 65severity = "low"
 66tags = [
 67    "Domain: Endpoint",
 68    "OS: Windows",
 69    "Use Case: Threat Detection",
 70    "Tactic: Defense Evasion",
 71    "Resources: Investigation Guide",
 72    "Data Source: Elastic Endgame",
 73    "Data Source: Elastic Defend",
 74    "Data Source: System",
 75    "Data Source: Microsoft Defender for Endpoint",
 76    "Data Source: Sysmon",
 77    "Data Source: SentinelOne",
 78    "Data Source: Crowdstrike",
 79]
 80timestamp_override = "event.ingested"
 81type = "eql"
 82
 83query = '''
 84process where host.os.type == "windows" and event.type == "start" and
 85(
 86  (
 87    (process.name : "wevtutil.exe" or ?process.pe.original_file_name == "wevtutil.exe") and
 88    process.args : ("/e:false", "cl", "clear-log")
 89  ) or
 90  (
 91    (
 92      process.name : ("powershell.exe", "pwsh.exe", "powershell_ise.exe") or
 93      ?process.pe.original_file_name in ("powershell.exe", "pwsh.dll", "powershell_ise.exe")
 94    ) and
 95    process.args : "Clear-EventLog"
 96  )
 97)
 98'''
 99
100
101[[rule.threat]]
102framework = "MITRE ATT&CK"
103[[rule.threat.technique]]
104id = "T1070"
105name = "Indicator Removal"
106reference = "https://attack.mitre.org/techniques/T1070/"
107[[rule.threat.technique.subtechnique]]
108id = "T1070.001"
109name = "Clear Windows Event Logs"
110reference = "https://attack.mitre.org/techniques/T1070/001/"
111
112[[rule.threat.technique.subtechnique]]
113id = "T1562.002"
114name = "Disable Windows Event Logging"
115reference = "https://attack.mitre.org/techniques/T1562/002/"
116
117
118
119[rule.threat.tactic]
120id = "TA0005"
121name = "Defense Evasion"
122reference = "https://attack.mitre.org/tactics/TA0005/"

Triage and analysis

Investigating Clearing Windows Event Logs

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 execution of the wevtutil.exe utility or the Clear-EventLog cmdlet to clear 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 mechanism can be used legitimately. Analysts can dismiss the alert if the administrator is aware of the activity and there are justifications for this action.
  • Analyze whether the cleared event log is pertinent to security and general monitoring. Administrators can clear non-relevant event logs using this mechanism. If this activity is expected and noisy in your environment, consider adding exceptions — preferably with a combination of user and command line conditions.

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
    • This activity is potentially done after the adversary achieves its objectives on the host. Ensure that previous actions, if any, are investigated accordingly with their response playbooks.
  • Isolate the involved host to prevent further post-compromise behavior.
  • 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

to-top