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"]
  4maturity = "production"
  5updated_date = "2024/05/21"
  6
  7[rule]
  8author = ["Elastic", "Ivan Ninichuck", "Austin Songer"]
  9description = """
 10Identifies attempts to disable EventLog via the logman Windows utility, PowerShell, or auditpol. This is often done by
 11attackers in an attempt to evade detection 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 = "Disable Windows Event and Security Logs Using Built-in Tools"
 24note = """## Triage and analysis
 25
 26### Investigating Disable Windows Event and Security Logs Using Built-in Tools
 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 usage of different utilities to disable the EventLog service or specific 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 activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
 44
 45### Response and remediation
 46
 47- Initiate the incident response process based on the outcome of the triage.
 48- Isolate the involved host to prevent further post-compromise behavior.
 49- Re-enable affected logging components, services, and security monitoring.
 50- 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.
 51- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 52- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 53- 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).
 54"""
 55references = [
 56    "https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/logman",
 57    "https://medium.com/palantir/tampering-with-windows-event-tracing-background-offense-and-defense-4be7ac62ac63",
 58]
 59risk_score = 21
 60rule_id = "4de76544-f0e5-486a-8f84-eae0b6063cdc"
 61setup = """## Setup
 62
 63If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
 64events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
 65Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
 66`event.ingested` to @timestamp.
 67For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
 68"""
 69severity = "low"
 70tags = [
 71    "Domain: Endpoint",
 72    "OS: Windows",
 73    "Use Case: Threat Detection",
 74    "Tactic: Defense Evasion",
 75    "Resources: Investigation Guide",
 76    "Data Source: Elastic Endgame",
 77    "Data Source: Elastic Defend",
 78]
 79timestamp_override = "event.ingested"
 80type = "eql"
 81
 82query = '''
 83process where host.os.type == "windows" and event.type == "start" and
 84(
 85  ((process.name:"logman.exe" or ?process.pe.original_file_name == "Logman.exe") and
 86      process.args : "EventLog-*" and process.args : ("stop", "delete")) or
 87
 88  ((process.name : ("pwsh.exe", "powershell.exe", "powershell_ise.exe") or ?process.pe.original_file_name in
 89      ("pwsh.exe", "powershell.exe", "powershell_ise.exe")) and
 90	process.args : "Set-Service" and process.args: "EventLog" and process.args : "Disabled")  or
 91
 92  ((process.name:"auditpol.exe" or ?process.pe.original_file_name == "AUDITPOL.EXE") and process.args : "/success:disable")
 93)
 94'''
 95
 96
 97[[rule.threat]]
 98framework = "MITRE ATT&CK"
 99[[rule.threat.technique]]
100id = "T1070"
101name = "Indicator Removal"
102reference = "https://attack.mitre.org/techniques/T1070/"
103[[rule.threat.technique.subtechnique]]
104id = "T1070.001"
105name = "Clear Windows Event Logs"
106reference = "https://attack.mitre.org/techniques/T1070/001/"
107
108
109[[rule.threat.technique]]
110id = "T1562"
111name = "Impair Defenses"
112reference = "https://attack.mitre.org/techniques/T1562/"
113[[rule.threat.technique.subtechnique]]
114id = "T1562.002"
115name = "Disable Windows Event Logging"
116reference = "https://attack.mitre.org/techniques/T1562/002/"
117
118[[rule.threat.technique.subtechnique]]
119id = "T1562.006"
120name = "Indicator Blocking"
121reference = "https://attack.mitre.org/techniques/T1562/006/"
122
123
124
125[rule.threat.tactic]
126id = "TA0005"
127name = "Defense Evasion"
128reference = "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

to-top