Event ID 104
Event ID 104: Event Log Cleared (System)
An event log file was cleared
- Log source
- System
- How to enable it
- On by default. Written by the Event Log service to the System log
- Category
- Defense Evasion
- Priority
- Critical
- Typical volume
- Rare
- MITRE ATT&CK
-
- T1685.005 Disable or Modify Tools: Clear Windows Event Logs
T1685.005 replaces T1070.001, which older guides still use.
What Event ID 104 means
104 is the companion of 1102 for every other log. When System, Application, Windows PowerShell or an operational channel is cleared, the Event Log service records the name of the channel and the account in the System log.
The channel tells you what the intruder wanted to hide. Clearing Microsoft-Windows-PowerShell/Operational points to script activity, TaskScheduler to persistence, TerminalServices to Remote Desktop use, and Windows Defender to detections. The choice is a free hint about what to look for elsewhere.
A common script enumerates all channels and clears each one, which produces hundreds of events in seconds. Because the System log is cleared somewhere in that loop, the events before it vanish and the ones after it remain, and the order shows where in the loop it happened.
Key fields to inspect
| Field | Meaning | Suspicious when |
|---|---|---|
Channel | Log that was cleared. | PowerShell, TaskScheduler, TerminalServices, Sysmon or Windows Defender operational logs. |
SubjectUserName | Account that cleared it. | Any account, in particular one that also appears in 1102. |
SubjectDomainName | Domain or computer of the account. | The local computer name. |
BackupPath | File the log was saved to before clearing, if any. | Empty, which means that no copy was kept. |
ClientProcessId | Process that asked for it, on newer builds. | Match it to a process creation event for wevtutil.exe. |
Detection queries
Alert on any cleared log, with more urgency when several channels are cleared together. Adjust names and thresholds to your environment. About these queries.
Splunk SPL
index=windows source="XmlWinEventLog:System" EventCode=104
| bin _time span=5m
| stats dc(Channel) AS channels values(Channel) AS names values(SubjectUserName) AS actor BY _time Computer
| eval severity=if(channels>=3, "critical", "high") Microsoft Sentinel KQL
Event
| where EventLog == "System" and EventID == 104
| extend Channel = extract(@"<Channel>([^<]+)", 1, EventData), Actor = extract(@"<SubjectUserName>([^<]+)", 1, EventData)
| summarize Channels = dcount(Channel), Names = make_set(Channel, 50), Actors = make_set(Actor) by Computer, bin(TimeGenerated, 5m)
| extend Severity = iff(Channels >= 3, "critical", "high") PowerShell
Get-WinEvent -FilterHashtable @{ LogName = 'System'; Id = 104; StartTime = (Get-Date).AddDays(-365) } |
ForEach-Object { $d = @{ Time = $_.TimeCreated }; ([xml]$_.ToXml()).Event.UserData.FirstChild.ChildNodes | ForEach-Object { $d[$_.LocalName] = $_.InnerText }; [pscustomobject]$d } |
Select-Object Time, Channel, SubjectUserName, BackupPath | Format-Table -AutoSize Attack scenarios
Scripted clearing of every channel
A loop over wevtutil el with wevtutil cl clears everything the system has. Hundreds of 104 events within seconds and a 1102 in the Security log leave no doubt.
Selective clearing
A careful operator clears only the channels that recorded them, such as TerminalServices-LocalSessionManager and RemoteConnectionManager after a Remote Desktop session.
Investigation checklist
- List every cleared channel and the order of clearing.
- Use the channel names to decide what kind of activity was hidden.
- Gather the same channels from your central log store.
- Check for artifacts outside event logs: prefetch, Amcache, SRUM, registry and the file system journal.
Common benign causes
- Troubleshooting of a single application log by an administrator.
- Products that clear their own debug channel.
- System preparation before imaging.
Event ID 104 FAQ
What is the difference between event 104 and 1102?
1102 is written to the Security log when that log is cleared. 104 is written to the System log when any other log is cleared, and it names the channel.
Why do I see only some of the 104 events I expect?
If the System log itself was cleared, earlier 104 events were removed with it. Compare with forwarded events, and look at the channels cleared afterwards.
Does disabling a log channel create event 104?
No. Disabling or shrinking a channel with wevtutil sl does not clear it. Watch process command lines and the registry under WINEVT\Channels for that kind of tampering.