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"]
  4maturity = "production"
  5updated_date = "2024/05/21"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Identifies attempts to clear or disable Windows event log stores using Windows wevetutil command. This is often done by
 11attackers in an attempt to evade detection or destroy forensic evidence on a system.
 12"""
 13from = "now-9m"
 14index = [
 15    "winlogbeat-*",
 16    "logs-endpoint.events.process-*",
 17    "logs-windows.*",
 18    "endgame-*",
 19    "logs-system.security*",
 20]
 21language = "eql"
 22license = "Elastic License v2"
 23name = "Clearing Windows Event Logs"
 24note = """## Triage and analysis
 25
 26### Investigating Clearing Windows Event Logs
 27
 28Windows 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.
 29
 30This rule looks for the execution of the `wevtutil.exe` utility or the `Clear-EventLog` cmdlet to clear event logs.
 31
 32#### Possible investigation steps
 33
 34- 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.
 35- Identify the user account that performed the action and whether it should perform this kind of action.
 36- Contact the account owner and confirm whether they are aware of this activity.
 37- Investigate other alerts associated with the user/host during the past 48 hours.
 38  - Verify if any other anti-forensics behaviors were observed.
 39- Investigate the event logs prior to the action for suspicious behaviors that an attacker may be trying to cover up.
 40
 41### False positive analysis
 42
 43- 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.
 44- 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.
 45
 46### Response and remediation
 47
 48- Initiate the incident response process based on the outcome of the triage.
 49  - 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.
 50- Isolate the involved host to prevent further post-compromise behavior.
 51- 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.
 52- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 53- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 54- 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).
 55"""
 56risk_score = 21
 57rule_id = "d331bbe2-6db4-4941-80a5-8270db72eb61"
 58setup = """## Setup
 59
 60If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
 61events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
 62Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
 63`event.ingested` to @timestamp.
 64For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
 65"""
 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]
 76timestamp_override = "event.ingested"
 77type = "eql"
 78
 79query = '''
 80process where host.os.type == "windows" and event.type == "start" and
 81(
 82  (
 83    (process.name : "wevtutil.exe" or ?process.pe.original_file_name == "wevtutil.exe") and
 84    process.args : ("/e:false", "cl", "clear-log")
 85  ) or
 86  (
 87    process.name : ("powershell.exe", "pwsh.exe", "powershell_ise.exe") and
 88    process.args : "Clear-EventLog"
 89  )
 90)
 91'''
 92
 93
 94[[rule.threat]]
 95framework = "MITRE ATT&CK"
 96[[rule.threat.technique]]
 97id = "T1070"
 98name = "Indicator Removal"
 99reference = "https://attack.mitre.org/techniques/T1070/"
100[[rule.threat.technique.subtechnique]]
101id = "T1070.001"
102name = "Clear Windows Event Logs"
103reference = "https://attack.mitre.org/techniques/T1070/001/"
104
105[[rule.threat.technique.subtechnique]]
106id = "T1562.002"
107name = "Disable Windows Event Logging"
108reference = "https://attack.mitre.org/techniques/T1562/002/"
109
110
111
112[rule.threat.tactic]
113id = "TA0005"
114name = "Defense Evasion"
115reference = "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).

Related rules

to-top