TExcelTAD
Home › Windows & Active Directory Security › The Key Event IDs and Sysmon

The Key Event IDs and Sysmon

Each lesson of the weaknesses section named a few events. This lesson puts them in one place, as the reference a detection engineer keeps open, and adds the second source most Windows defenders rely on: Sysmon, the free Sysinternals driver and service that records process, network, file and registry activity in far more detail than the Security log. The events tell you that something happened; the fields tell you whether it matters, so the table lists both.

Which audit settings produce each Security event is in Event Log Channels and the Audit Policy.

Security log: authentication (on DCs unless noted)

ID Event Fields that matter Used for
4768 TGT requested account, client address, ticket encryption type, pre-authentication type, result code (0x6 unknown user, 0x12 disabled/locked) AS-REP roasting (pre-auth 0), overpass-the-hash (RC4), PKINIT (type 16)
4769 service ticket requested account, service name, encryption type, transited services, failure code Kerberoasting, S4U delegation, golden-ticket correlation
4770 service ticket renewed long-lived sessions
4771 pre-authentication failed account, client address, failure code (0x18 wrong password, 0x25 clock skew) password spraying over Kerberos
4776 NTLM credential validation account, workstation, error (0xC000006A, 0xC0000064) NTLM inventory, spraying through servers
4624 / 4625 logon / failed logon (every machine) logon type, authentication package, workstation name, source address, elevated token, status/substatus lateral movement, pass-the-hash (type 3 NTLM, type 9 seclogo), relay (name/IP mismatch)
4648 logon with explicit credentials (runas, mapped drive with another user) credential use on the source machine
4672 special privileges assigned account admin logons where they shouldn't be

Security log: directory and account changes

ID Event Used for
4720 / 4722 / 4725 / 4726 user created / enabled / disabled / deleted persistence, re-enabled dormant accounts
4724 password reset attempt by another account ForceChangePassword abuse
4738 / 4742 user / computer account changed (UAC flags, SPNs, delegation) delegation changes, DCShadow SPNs
4741 computer account created machine-account-quota abuse before RBCD
4728 / 4732 / 4756 member added to global / local / universal group privileged group changes
4765 SID history added SID-history injection
4662 operation on a directory object (with SACL) DCSync (replication GUIDs), reads of honey objects
5136 / 5137 / 5141 directory object modified / created / deleted ACL changes, RBCD attribute, GPO changes, new nTDSDSA objects
4706 / 4707 / 4716 trust created / removed / changed trust tampering
4719 audit policy changed defence evasion
1102 (Security), 104 (System) log cleared defence evasion

Other channels

Source ID Meaning
System 7045 service installed
Security 4697, 4698 service installed, scheduled task created
PowerShell/Operational 4104 script block logged
Directory Service 2889, 1644 unsigned LDAP bind, expensive LDAP query
AD CS (Security on the CA) 4886, 4887, 4899, 4900 request received, issued, template updated, template security changed
Defender 1116, 1117 malware detected, action taken

Sysmon

Sysmon installs as a driver plus a service and writes to Microsoft-Windows-Sysmon/Operational. What it records is controlled by an XML configuration with include and exclude rules per event type. Community configurations (SwiftOnSecurity's and Olaf Hartong's sysmon-modular are the best known) are good starting points; Sysmon is now also a built-in optional feature of Windows 11 and Windows Server 2025, delivered through 2026 quality updates; the built-in and the standalone Sysmon can't run on the same machine. The event types most used in AD investigations:

ID Event AD-relevant use
1 process created (with hashes, parent, command line, user, integrity level) process trees: Office → PowerShell, services.exe → random service binaries
3 network connection workstations connecting to DCs on 445/135 for DRSUAPI, LDAP from unusual processes
7 image (DLL) loaded credential-access DLLs loaded into unusual processes
8 CreateRemoteThread code injection into LSASS or other processes
10 process access (source, target, granted access) LSASS access for credential dumping
11 file created dump files, dropped tools, files in SYSVOL
12 / 13 / 14 registry key create/delete, value set, rename UseLogonCredential, RunAsPPL, Run keys, service ImagePath
17 / 18 named pipe created / connected remote execution tools' pipes, coercion pipes
22 DNS query queries that fell through to LLMNR, tool downloads
25 process tampering process hollowing and similar

Checking a Sysmon configuration's coverage

A configuration can be valid and still blind to the events you need. The program parses a small synthetic configuration and reports, per event type the AD lessons rely on, whether anything is collected and whether LSASS access is covered.

python · try it yourself
import xml.etree.ElementTree as ET

config = """
<Sysmon schemaversion="4.90">
  <HashAlgorithms>SHA256</HashAlgorithms>
  <EventFiltering>
    <RuleGroup groupRelation="or">
      <ProcessCreate onmatch="exclude"/>
      <NetworkConnect onmatch="include"><DestinationPort>445</DestinationPort><DestinationPort>389</DestinationPort></NetworkConnect>
      <ProcessAccess onmatch="include"><TargetImage condition="end with">\\winlogon.exe</TargetImage></ProcessAccess>
      <RegistryEvent onmatch="include"><TargetObject condition="contains">\\CurrentVersion\\Run</TargetObject></RegistryEvent>
      <FileCreate onmatch="include"><TargetFilename condition="end with">.ps1</TargetFilename></FileCreate>
    </RuleGroup>
  </EventFiltering>
</Sysmon>
"""
NEEDED = {"ProcessCreate": 1, "NetworkConnect": 3, "ProcessAccess": 10, "FileCreate": 11,
          "RegistryEvent": 13, "PipeEvent": 17, "DnsQuery": 22}

root = ET.fromstring(config)
rules = {el.tag: el for el in root.iter() if el.get("onmatch")}
for name, eid in NEEDED.items():
    el = rules.get(name)
    if el is None:
        state = "NOT CONFIGURED (nothing collected)"
    elif el.get("onmatch") == "exclude":
        state = f"all events, minus {len(el)} exclusion rule(s)"
    else:
        state = f"only {len(el)} include rule(s): " + ", ".join(f"{c.tag} {c.get('condition', 'is')} {c.text}" for c in el)
    print(f"{eid:>2} {name:15} {state}")

pa = rules.get("ProcessAccess")
lsass = pa is not None and any("lsass" in (c.text or "").lower() for c in pa)
print("LSASS access covered:", lsass)
reg = rules.get("RegistryEvent")
print("WDigest / LSA settings covered:", reg is not None and any(k in (c.text or "") for c in reg for k in ("WDigest", "Lsa")))
 1 ProcessCreate   all events, minus 0 exclusion rule(s)
 3 NetworkConnect  only 2 include rule(s): DestinationPort is 445, DestinationPort is 389
10 ProcessAccess   only 1 include rule(s): TargetImage end with \winlogon.exe
11 FileCreate      only 1 include rule(s): TargetFilename end with .ps1
13 RegistryEvent   only 1 include rule(s): TargetObject contains \CurrentVersion\Run
17 PipeEvent       NOT CONFIGURED (nothing collected)
22 DnsQuery        NOT CONFIGURED (nothing collected)
LSASS access covered: False
WDigest / LSA settings covered: False

The configuration logs every process (an empty exclude rule means "exclude nothing"), but watches winlogon instead of LSASS, misses the registry values attackers change to harvest credentials, and collects no pipe or DNS events. Each gap maps to a detection in this course that would stay silent. Fix the config, then test it: run the benign action in the lab (open LSASS with a diagnostic tool, change a test registry value) and check that the event arrives.

Pitfalls

  • Collecting without a question. Sysmon with a "log everything" config overwhelms storage; with a minimal config, it misses what you need. Start from a maintained community config and add what your detections use.
  • Relying on one DC's log. Kerberos and NTLM events are written by the DC that handled the request; collect from all DCs.
  • Ignoring field semantics: 4625's Status vs SubStatus, 4624's Workstation Name (from the NTLM message, attacker-controlled) vs Source Network Address.
  • Event IDs change meaning across products. 4104 is PowerShell only in its own channel; always filter on provider and channel too.

Practice

1. Fix the configuration so that LSASS access is collected. What do you add, and what exclusions will you probably need?

Add <TargetImage condition="end with">\lsass.exe</TargetImage> to the ProcessAccess include rule. Exclude known security and management agents (EDR, antivirus, backup, the Windows Defender process) by SourceImage, after checking their paths and signatures, or the volume will be high.

2. Which event pair reveals pass-the-hash on the source and the target machine?

Source: 4624 with logon type 9 (NewCredentials, logon process seclogo) or 4648. Target: 4624 logon type 3 with authentication package NTLM for an account that normally uses Kerberos.

3. Which three events would you put on a "single event is an incident" list for a domain?

For example 1102 (Security log cleared), 4765 (SID history added outside a migration) and 4662 with the Get-Changes-All GUID by a non-DC account. Others: 4706 (new trust) and 5136 on AdminSDHolder.

Test yourself

Which Sysmon event ID records one process opening another, for example access to LSASS?

  1. 1
  2. 3
  3. 10
  4. 22

Which Security event shows a password reset by another account?

  1. 4723
  2. 4724
  3. 4740
  4. 4771

In a 4624 event, which field is set by the client and can be forged?

  1. Source Network Address
  2. Workstation Name
  3. Logon ID
  4. Event time

Which event shows a computer account being created, often the first step of RBCD abuse?

  1. 4741
  2. 4742
  3. 4720
  4. 7045