Defensive Security

Windows Event Logs: The Handful of IDs That Answer Most Investigations

The first time an analyst opens Event Viewer during an investigation, the volume is overwhelming. It should not be. A small set of event IDs answers the majority of questions that come up, and knowing them turns an unreadable log into a timeline.

Windows Event Logs: The Handful of IDs That Answer Most Investigations

Who logged in, from where

4624 is a successful logon and it is the single most useful event in the Windows security log. The field that makes it useful is the logon type:

  • Type 2 — interactive, somebody at the keyboard.
  • Type 3 — network, such as accessing a file share. By far the most common and the noisiest.
  • Type 10 — remote interactive, meaning RDP. Always worth attention on a workstation.
  • Type 5 — a service starting.
  • Type 4 — a scheduled task.

4625 is a failed logon. The substatus code distinguishes a wrong password from a disabled account from a non-existent username — and a run of failures against usernames that do not exist is enumeration rather than a forgetful user.

4648 records a logon using explicit credentials and is an underrated signal. It fires when a process authenticates as a different user, which is exactly what happens during lateral movement with stolen credentials.

What was executed

4688 is process creation, and it is the event that makes host investigations possible. It is not enabled by default, and command line auditing within it is a separate setting that is also off by default.

Turn both on. Without the command line, you learn that powershell.exe ran; with it, you learn what it ran, which is the entire question.

If you can deploy Sysmon, its event 1 provides richer process creation data including hashes and parent process, and its event 3 covers network connections per process. Sysmon is free and transforms what is possible on an endpoint.

Persistence and privilege

  • 4720 — a user account was created. On a server at 3am, this is the investigation.
  • 4728, 4732, 4756 — a member was added to a security-enabled group. These are how you catch privilege escalation after the fact.
  • 7045 (System log) — a service was installed. A classic persistence mechanism and a classic indicator of remote execution tooling.
  • 4698 — a scheduled task was created.
  • 4672 — special privileges assigned at logon, which effectively marks administrative sessions.

Signs somebody is covering up

1102 means the security log was cleared. There are very few innocent explanations, and it should be a high-severity alert everywhere.

4719 means audit policy was changed. An attacker who disables auditing before acting leaves this behind.

Both are more valuable than most of what sits in a default alert set, and both are cheap to monitor because they are rare.

PowerShell deserves its own attention

Script block logging, event 4104 in the PowerShell operational log, records the actual script content executed — including content that was obfuscated, because it logs after deobfuscation. It is off by default and it is one of the highest-value logging changes available on Windows.

Retention is where investigations die

Default log sizes are small and they roll over quickly on a busy server, often within days. An intrusion discovered three weeks later is frequently uninvestigable for this reason alone.

Increase the maximum log size, and forward events centrally so a compromised host's logs survive the compromise. Logs that exist only on the attacked machine are logs the attacker controls.

Build the timeline, not the list

The skill is correlation. A 4624 type 10 from an unusual address, followed by 4672, followed by 4688 running reconnaissance commands, followed by 7045 installing a service is not four alerts. It is one intrusion, and reading it that way is the difference between closing tickets and understanding what happened.

Frequently asked questions

Which event ID shows what command was run?
4688 with command line auditing enabled, or Sysmon event 1. Both are off by default on Windows and need to be switched on deliberately.
Why do I see thousands of 4624 events?
Most are logon type 3, network logons generated by routine file and service access. Filter those out first and the remaining interactive and remote logons become readable.
How long should Windows logs be kept?
Longer than your likely detection delay, which commonly means months rather than days. Default log sizes roll over quickly, so increase them and forward events to central storage.

Related reading

0 comments

Leave a comment

Comments are moderated before appearing.