Skip to content
WETNav

Defense evasionHigh

Event log clearing

Also known as Log wiping, Indicator removal

Clearing or stopping the Windows event log to destroy evidence. 1102 and 104 record a clear; thread-killing tools leave only a gap.

Signals in the logs

  1. 01Security1102The audit log was clearedAny host

    The Security log was cleared; the account that did it is recorded in the event's UserData.

    SubjectUserName
    account that cleared the log (UserData/LogFileCleared)
    SubjectDomainName
    domain of that account
  2. 02System104Event log was clearedAny host

    Any event log channel was cleared (provider Microsoft-Windows-Eventlog).

    Channel
    name of the log that was cleared, e.g. System or Microsoft-Windows-Sysmon/Operational
    SubjectUserName
    account that cleared it
  3. 03Sysmon1Process CreateAny host

    wevtutil.exe, wmic.exe, or powershell.exe running a clear command immediately before the gap.

    Image
    C:\Windows\System32\wevtutil.exe
    CommandLine
    wevtutil cl ... / Clear-EventLog ... / cl Security
  4. 04System7036Service entered the running or stopped stateAny host

    The Windows Event Log service entered the stopped state, when the whole service was stopped rather than individual threads killed.

    param1
    Windows Event Log
    param2
    stopped

What happens

An intruder removes their traces by clearing event logs. The clean way is wevtutil cl, PowerShell Clear-EventLog, or the Event Viewer, each of which clears a log and writes a single record noting that it happened: Security 1102 for the Security log and System 104 for any channel. Both records survive because they are the first entry written to the freshly emptied log. Stealthier tools such as Invoke-Phant0m do not clear anything; they locate the Event Log service threads inside svchost.exe and kill them, so logging silently stops and no 1102 is produced. That approach leaves no clearing record, only an abrupt end to otherwise continuous logging and a gap in EventRecordID sequence.

Logging you need

  • 1102 (Security) and 104 (System) are written by default and need no audit policy.
  • Catching the tool that cleared the log needs process creation logging: Security 4688 with command-line auditing, or Sysmon 1.
  • Detecting thread-killing tools needs a baseline of normal logging volume and continuous EventRecordID sequence, since no clearing record is produced.

Hunt queries

Starting points. Tune thresholds and exclusions to your environment before alerting on them.

Get-WinEvent -FilterHashtable @{LogName='Security'; Id=1102}
Get-WinEvent -FilterHashtable @{LogName='System'; ProviderName='Microsoft-Windows-Eventlog'; Id=104}

Benign look-alikes

  • Administrators or backup tools clearing logs during decommissioning or troubleshooting.
  • Log rollover at the configured maximum size, which looks like a gap but is not a clear and writes no 1102/104.
  • Imaging or sysprep steps that reset event logs on a golden image.

Notes

  • Invoke-Phant0m and similar tools produce no 1102 or 104. Hunt them as a sudden, lasting drop to zero in events from a normally busy host, and as a break in the EventRecordID sequence within a channel.
  • A clean service stop writes System 6006 (Event Log stopped) then 6005 (started) on reboot; logging that stops without a 6006 and without a reboot is suspicious.
  • Sysmon has its own operational log, so clearing the Security log does not remove Sysmon 1 records of the tool that did it.

References