Windows Event ID Reference
The Windows events that matter in an investigation, with the log each is written to, the audit setting it needs, what it records and what to look for, plus the audit baseline, a map from attack technique to events, and Get-WinEvent and KQL to find them. Filter by ID or keyword, or jump to a section.
211 Windows event IDs for investigation and detection, from the Security log, the System log, the Operational channels for Task Scheduler, Remote Desktop, WinRM, WMI, BITS, the firewall, AppLocker and App Control, and from Sysmon, PowerShell and Microsoft Defender Antivirus. Each entry gives the log or channel it is written to, what has to be switched on for it to exist, what it records and what to look for. Every event name, log and audit subcategory is checked against Microsoft's documentation or the event manifests Windows ships.
Before you read the events
Which log is which
Windows writes to a handful of classic logs and to hundreds of per-component channels under Applications and Services Logs. Where an event lives decides who can read it, how long it is kept and whether your collection picks it up.
| Log or channel | What writes to it | Needs |
|---|---|---|
| Security | The audit subsystem (LSASS): logons, Kerberos, accounts, processes, objects, policy changes | Advanced Audit Policy subcategories, and SACLs for object access |
| System | Windows components and drivers: Service Control Manager, the kernel, the event log service | Nothing; it is on by default |
| Application | Applications and some Windows services | Nothing; on by default |
| Applications and Services Logs (Operational channels) | One channel per component: Task Scheduler, Remote Desktop, WinRM, WMI, BITS, the firewall, AppLocker, Code Integrity, PowerShell, Defender, Sysmon | Most are on by default. Some (PrintService, DNS Client) are off until you enable them |
| Windows PowerShell | The Windows PowerShell 5.1 engine: engine start (400) and module logging (800) | Module logging policy for 800 |
Audit policy: the baseline this page needs
Advanced Audit Policy splits auditing into more than 40 subcategories. The table lists every subcategory an event on this page depends on, built from the entries below, with a starting setting. Success and Failure is suggested where failures are themselves evidence (logons, Kerberos, account changes); Success alone where failures are rare or noisy. Object access subcategories also need SACLs on the objects you care about, and Directory Service Changes needs SACLs in Active Directory.
| Category | Subcategory | Events on this page | Turn on |
|---|---|---|---|
| Account Logon | Credential Validation | 4776 | Success and Failure |
| Account Logon | Kerberos Authentication Service | 4768, 4771 | Success and Failure |
| Account Logon | Kerberos Service Ticket Operations | 4769, 4770, 4773 | Success and Failure |
| Account Management | Computer Account Management | 4741, 4742, 4743 | Success and Failure |
| Account Management | Other Account Management Events | 4782 | Success |
| Account Management | Security Group Management | 4728, 4731, 4732, 4733, 4735, 4756, 4799 | Success and Failure |
| Account Management | User Account Management | 4720, 4722, 4723, 4724, 4725, 4726, 4738, 4740, 4765, 4766, 4767, 4780, 4781, 4794, 4798, 5376, 5377 | Success and Failure |
| DS Access | Directory Service Access | 4661, 4662 | Success and Failure |
| DS Access | Directory Service Changes | 5136, 5137, 5139, 5141 | Success and Failure |
| Detailed Tracking | DPAPI Activity | 4692, 4693 | Success |
| Detailed Tracking | PNP Activity | 6416 | Success |
| Detailed Tracking | Process Creation | 4688 | Success and Failure |
| Detailed Tracking | Process Termination | 4689 | Success |
| Logon/Logoff | Account Lockout | 4625 | Success and Failure |
| Logon/Logoff | Logoff | 4634, 4647 | Success |
| Logon/Logoff | Logon | 4624, 4625, 4648, 4675 | Success and Failure |
| Logon/Logoff | Other Logon/Logoff Events | 4649, 4778, 4779, 4800, 4801, 4802, 4803 | Success |
| Logon/Logoff | Special Logon | 4672, 4964 | Success |
| Object Access | Certification Services | 4886, 4887, 4888, 4898, 4899, 4900 | Success and Failure |
| Object Access | Detailed File Share | 5145 | Success and Failure |
| Object Access | File Share | 5140, 5142, 5143, 5144 | Success and Failure |
| Object Access | File System | 4656, 4658, 4660, 4663, 4670 | Success |
| Object Access | Filtering Platform Connection | 5156, 5157 | Success |
| Object Access | Handle Manipulation | 4658 | Success |
| Object Access | Kernel Object | 4656, 4658, 4660, 4663 | Success |
| Object Access | Other Object Access Events | 4698, 4699, 4702 | Success |
| Object Access | Registry | 4656, 4657, 4658, 4660, 4663, 4670 | Success |
| Object Access | Removable Storage | 4656, 4663 | Success |
| Object Access | SAM | 4661 | Success |
| Policy Change | Authentication Policy Change | 4670, 4706, 4707, 4713, 4716, 4717, 4718, 4739 | Success |
| Policy Change | MPSSVC Rule-Level Policy Change | 4946, 4947, 4948, 4949, 4950 | Success |
| Policy Change | Other Policy Change Events | 4826 | Success |
| Policy Change | Policy Change | 4715, 4719, 4904, 4905, 4906, 4907, 4912 | Success |
| Privilege Use | Non Sensitive Privilege Use | 4673, 4674 | Success |
| Privilege Use | Sensitive Privilege Use | 4673, 4674 | Success and Failure |
| System | Security State Change | 4608, 4616 | Success |
| System | Security System Extension | 4697 | Success and Failure |
| System | System Integrity | 5038 | Success and Failure |
Set it in Group Policy under Advanced Audit Policy Configuration, or test on one machine with auditpol:
:: What is actually audited on this machine, every subcategory (run elevated)
auditpol /get /category:*
:: Turn subcategories on by name
auditpol /set /subcategory:"Process Creation" /success:enable /failure:enable
auditpol /set /subcategory:"Kerberos Service Ticket Operations" /success:enable /failure:enable
auditpol /set /subcategory:"Directory Service Changes" /success:enableCollection and log size
An event that rolled off the end of a full log is as gone as one never written. Size the logs for days of activity, not hours, and forward them. Windows Event Forwarding sends events to a collector with no agent; Microsoft's own guidance describes a Baseline subscription for every device and a Suspect subscription that collects more from the devices you add to it, and notes that the local log's maximum size is the buffer when the collector cannot be reached. An agent (Azure Monitor Agent for Sentinel, or your SIEM's) does the same job with more filtering.
:: Size, retention and enabled state of a log
wevtutil gl Security
:: Raise the Security log to 1 GB: /ms takes bytes
wevtutil sl Security /ms:1073741824
:: Turn on a channel that is off by default, then confirm
wevtutil sl Microsoft-Windows-PrintService/Operational /e:true
wevtutil gl Microsoft-Windows-PrintService/OperationalKerberos result codes in 4768 and 4771
The Result Code field on a failed Kerberos request, from Microsoft's description of 4768. 4768 also carries a Pre-Authentication Type; a value of 0 means the ticket was issued without pre-authentication.
| Code | Name | Meaning |
|---|---|---|
| 0x6 | KDC_ERR_C_PRINCIPAL_UNKNOWN | The account name does not exist |
| 0x12 | KDC_ERR_CLIENT_REVOKED | Account disabled, expired or locked out |
| 0x17 | KDC_ERR_KEY_EXPIRED | The password has expired |
| 0x18 | KDC_ERR_PREAUTH_FAILED | Wrong password (logged as 4771) |
| 0x19 | KDC_ERR_PREAUTH_REQUIRED | Pre-authentication required |
| 0xE | KDC_ERR_ETYPE_NOTSUPP | No supported encryption type |
| 0x25 | KRB_AP_ERR_SKEW | Clock skew too great |
Logon and logoff 15
Logon types, from Microsoft's description of 4624:
| Type | Name | What produces it |
|---|---|---|
| 2 | Interactive | At the keyboard |
| 3 | Network | SMB, mapped drives, most remote administration |
| 4 | Batch | Scheduled tasks |
| 5 | Service | A service starting |
| 7 | Unlock | Workstation unlocked |
| 8 | NetworkCleartext | Password sent to the authentication package unhashed, such as IIS basic authentication |
| 9 | NewCredentials | runas /netonly: new credentials for outbound connections only |
| 10 | RemoteInteractive | Remote Desktop |
| 11 | CachedInteractive | Logon with cached credentials, no domain controller contacted |
4625 Status and Sub Status codes:
| Code | Meaning |
|---|---|
| 0xC0000064 | The account name does not exist |
| 0xC000006A | Wrong password |
| 0xC000006D | Bad user name or authentication information |
| 0xC000006F | Outside permitted logon hours |
| 0xC0000070 | From a workstation the account may not use |
| 0xC0000072 | Account disabled |
| 0xC0000193 | Account expired |
| 0xC0000234 | Account locked out |
| 0xC000015B | Logon type not granted on this machine |
Records. A logon session was created on the machine that logged it. The Logon Type says how (table below), and the event carries the account, the workstation name and source network address, the logon process and authentication package, and a Logon ID that later events on the same host share.
Look for. Type 10 from an address that never uses RDP, and one account producing Type 3 logons across many hosts in a short window. Type 9 (NewCredentials) comes from runas /netonly and from tools that start a process with other credentials, so read the process that created it. Follow the Logon ID to the processes the session started.
Records. A logon attempt failed. Status and Sub Status give the reason (table below); the event carries the target account, the logon type and the source address.
Look for. Many 0xC000006A failures for one account from one address is guessing a password; one or two failures each across many accounts from one address is a spray. A run of 0xC0000064 is someone trying names that do not exist. The finding that matters is a 4624 from the same address afterward.
Records. A logon session ended and no longer exists. It shares the Logon ID of the 4624 that opened it.
Look for. Pair it with its 4624 by Logon ID to get the session's length. Network sessions often end without one.
Records. A logoff was started by the account itself. Microsoft notes it is typical of Interactive and RemoteInteractive sessions, where it often appears in place of 4634.
Look for. For an RDP or console session, 4647 is the end you will usually find.
Records. A process tried to log on by naming an account's credentials: RUNAS, scheduled tasks and routine operating system activity all produce it. It is logged on the machine where the process ran, with the target server name.
Look for. A user's process naming an administrator account against another server: that is how credential reuse looks from the machine it starts on. Read the process name and the target server together.
Records. A new logon was given one or more sensitive privileges, such as SeDebugPrivilege, SeBackupPrivilege or SeTcbPrivilege. SYSTEM and service logons produce it constantly.
Look for. Filter out the machine and service accounts, then look for user accounts you did not expect to hold these rights.
Records. A user reconnected to an existing Remote Desktop session, or switched to one with Fast User Switching. It carries the client name and address.
Look for. An RDP session picked up from a new client address, which a 4624 Type 10 alone will not show because no new logon happens.
Records. A Remote Desktop session was disconnected without being logged off.
Look for. Pairs with 4778 to bound RDP activity that never produced a new logon.
Records. A member of a group you have defined as special logged on. It only fires once you list the groups to watch.
Look for. Define your administrator groups and you get a logon event for exactly the accounts that matter.
Records. A domain controller or server saw a Kerberos request that repeated one it had already processed. Microsoft notes that misconfigured networks can produce it as well as real replay attempts.
Look for. Rare enough that each one is worth a look. Read the account and the workstation, then check the time sync between that client and the server.
Records. SIDs from a trusted domain were removed from a logon by SID filtering at a trust boundary.
Look for. An account crossing a trust carrying SIDs that the trust is set to reject, which is what a forged SID History looks like from the trusting side.
Records. The workstation was locked, with the account and its Logon ID.
Look for. With 4801, the hours someone was actually at the machine. Useful against an alibi or a claim that an account was in use.
Records. The workstation was unlocked. An unlock also produces a 4624 with Logon Type 7.
Look for. An unlock at an hour the user was not working, or on a machine they do not use.
Records. The screen saver started for a session.
Look for. Another marker of when a session sat idle.
Records. The screen saver was dismissed for a session.
Look for. The end of an idle period: someone came back to the machine.
Credential validation and Kerberos 6
Ticket encryption types in 4768 and 4769:
| Value | Suite |
|---|---|
| 0x11 | AES128-CTS-HMAC-SHA1-96 |
| 0x12 | AES256-CTS-HMAC-SHA1-96 |
| 0x17 | RC4-HMAC |
Records. An NTLM credential check. It is logged on the machine that holds the account: a domain controller for domain accounts, the local machine for local ones. It names the source workstation and an error code.
Look for. NTLM failures against many accounts from one workstation, and successful NTLM where your estate should be using Kerberos.
Records. A domain controller issued, or refused, a ticket-granting ticket. It carries the account, client address, result code and encryption types. Failures with codes 0x10 and 0x18 are logged as 4771 instead.
Look for. A TGT for an account that does not require pre-authentication is what AS-REP roasting asks for. RC4 (0x17) where your domain uses AES is worth explaining.
Records. A domain controller issued, or refused, a service ticket. It carries the requesting account, the service name, the client address and the ticket encryption type. Failure code 0x20 is an expired ticket and is routine.
Look for. One account asking for tickets to many user-account services with RC4 (0x17) encryption in a short window is the shape of Kerberoasting. Service names ending in $ are computer accounts and are normally AES.
Records. A domain controller refused a TGT at pre-authentication. Code 0x18 is a wrong password; 0x17 is an expired one.
Look for. The Kerberos side of a password spray: many accounts, one or two 0x18 failures each, one client address.
Records. A domain controller renewed a service ticket, with the account, the service and the client address.
Look for. Renewals that keep a service ticket alive far longer than the work that needed it.
Records. A service ticket request failed. Microsoft notes that failed requests are normally logged as 4769 failures instead, so this one is seldom seen.
Look for. If it appears, read it as a 4769 failure.
Accounts and groups 28
Records. A user object was created. It is logged on domain controllers for domain accounts and on member servers and workstations for local accounts, with who created it.
Look for. Accounts created during the window of a compromise, and local accounts created on servers at all.
Records. A user or computer object was enabled.
Look for. An account you disabled during containment coming back. Find who enabled it.
Records. One account tried to reset another account's password. For domain accounts a failure is logged only when the new password breaks policy; an access-denied reset logs nothing.
Look for. Resets of privileged accounts by anyone outside your identity team.
Records. A user object was deleted.
Look for. An account created and deleted inside a short window is someone cleaning up.
Records. A user object changed. Each change is its own event, and attributes that changed appear with their new values.
Look for. User Account Control changes such as "Don't require preauth" or "Password not required", and a changed SID History.
Records. An account was locked out. The Caller Computer Name is the machine the failing attempts came from.
Look for. Several accounts locked from one caller is a spray that tripped the threshold. Pull that machine's 4625 or 4771.
Records. A member was added to a domain global security group. Domain groups only; the event carries the group, the member and who added it.
Look for. Any addition to Domain Admins or another privileged group that has no change behind it.
Records. A member was added to a security-enabled local group, one event per member added.
Look for. Additions to the local Administrators group on servers, and to Remote Desktop Users.
Records. A member was added to a domain universal security group. Enterprise Admins and Schema Admins are universal groups.
Look for. Additions to Enterprise Admins or Schema Admins, which should almost never happen.
Records. An account tried to change its own password, as opposed to 4724, where one account resets another's.
Look for. A password changed right after a suspicious logon: the attacker locking the owner out.
Records. A user account was disabled, with who disabled it.
Look for. Administrator or security tooling accounts disabled outside a change: an attacker removing the people who could stop them.
Records. A locked-out account was unlocked, with who unlocked it.
Look for. Lockouts that are unlocked again and again during a spray, so the guessing can continue.
Records. An account's SAM account name changed, with the old and new names.
Look for. A computer account renamed to look like a domain controller is part of the noPac attack path. Any rename of a privileged account deserves a reason.
Records. A SID was added to an account's SID History attribute, which grants the access that SID has.
Look for. Outside a domain migration, any occurrence. A privileged SID in a normal user's SID History is a backdoor.
Records. An attempt to add SID History failed.
Look for. Someone tried. Find who and from where.
Records. Someone tried to set the DSRM administrator password on a domain controller.
Look for. Outside a recovery or a planned change, an attacker giving themselves a local administrator account on the domain controller.
Records. A process listed the local groups an account belongs to, with the process name.
Look for. Enumeration from a process that is not an administrative tool you use, across many hosts: reconnaissance.
Records. A process listed the members of a local security group, such as Administrators, with the process name.
Look for. net.exe, PowerShell or an unknown process listing local Administrators across many hosts.
Records. A member was removed from a local security group.
Look for. An account added to Administrators and removed again within an hour: temporary elevation to do one thing.
Records. A local security group was created.
Look for. New local groups on servers are rare; ask why.
Records. A local security group's properties changed.
Look for. Changes to the built-in groups that hold administrative rights.
Records. A computer object was created in the domain, with who created it. It is logged only on domain controllers. By default ordinary users can add a small number of computers to the domain.
Look for. A computer account created by a user account rather than your provisioning process: the first step of several Kerberos delegation and certificate attacks.
Records. A computer object changed, with the attributes that changed.
Look for. Changes to delegation settings, service principal names or the DNS host name of a computer account.
Records. A computer object was deleted.
Look for. A computer account created and deleted in a short window.
Records. Each hour the domain controller holding the PDC emulator role compares the permissions on protected accounts (members of administrative groups) with AdminSDHolder and resets any that differ; this event records it.
Look for. A change to AdminSDHolder itself (see 5136), because whatever is on it is copied to every protected account.
Records. A domain controller recorded that an account's password hash was read, which happens during password migration.
Look for. Outside an Active Directory Migration Tool job, any occurrence.
Records. An account's saved Credential Manager credentials were backed up.
Look for. Backups of stored credentials that the user did not start.
Records. Credential Manager credentials were restored from a backup.
Look for. Restores onto an account or machine you did not expect.
Directory services 6
The replication rights that DCSync uses, as they appear in the Properties field of 4662. Each GUID is checked against Microsoft's Active Directory schema documentation.
| Right | GUID |
|---|---|
| DS-Replication-Get-Changes | 1131f6aa-9c07-11d1-f79f-00c04fc2dcd2 |
| DS-Replication-Get-Changes-All | 1131f6ad-9c07-11d1-f79f-00c04fc2dcd2 |
| DS-Replication-Get-Changes-In-Filtered-Set | 89e95b76-444d-4c62-991a-0facbeda640c |
Records. An operation on an Active Directory object, logged where the object's SACL asks for it. The Properties field holds the GUIDs of the rights or attributes involved.
Look for. DCSync: a replication right (table below) exercised by an account that is not a domain controller. Domain controllers replicate with each other all day, so filter out machine accounts first.
Records. A handle was requested to an Active Directory or SAM object.
Look for. High volumes of SAM handle requests from one workstation: user and group enumeration.
Records. An attribute of an Active Directory object changed, with the old and new values in separate events. It needs a SACL on the objects.
Look for. Changes to group policy objects, AdminSDHolder, msDS-AllowedToActOnBehalfOfOtherIdentity (resource-based delegation), servicePrincipalName on user accounts, and nTSecurityDescriptor on the domain object.
Records. An Active Directory object was created.
Look for. New group policy containers, new certificate templates, and objects created in the domain root or under Configuration.
Records. An Active Directory object moved, with the old and new paths.
Look for. An account moved out of an organizational unit with tighter policy, or into one that delegates control to someone else.
Records. An Active Directory object was deleted.
Look for. Deleted group policy links and deleted accounts during the incident window.
Domain policy and trusts 7
Records. The domain's password, lockout or Kerberos policy changed.
Look for. A lockout threshold raised or removed before a password spray.
Records. The domain Kerberos policy changed, such as maximum ticket lifetimes.
Look for. Longer ticket lifetimes extend how long a stolen ticket stays useful.
Records. A trust to another domain was created.
Look for. Any trust you did not plan: a path into the domain from outside.
Records. A trust to another domain was removed.
Look for. Confirm it was planned.
Records. The settings of an existing trust changed, such as its direction or SID filtering.
Look for. SID filtering turned off on a trust, which makes SID History attacks across it work.
Records. An account was granted a logon right, such as the right to log on through Remote Desktop or as a service.
Look for. A logon right granted to a user account on a server, especially "Log on as a service" or Remote Desktop.
Records. A logon right was removed from an account.
Look for. Rights removed from the people or tools that would respond.
Certificate Services 6
Records. A certification authority received a certificate request, with the request ID, the requester and the attributes. It is logged on the CA.
Look for. Requests where the subject or subject alternative name differs from the requester: that is how ESC1-style template abuse asks for a certificate as someone else.
Records. The CA approved a request and issued a certificate.
Look for. Certificates issued to an account for another identity, or from a template that allows the requester to supply the subject.
Records. The CA denied a request.
Look for. A run of denials from one requester probing which templates they can use.
Records. The CA loaded a certificate template.
Look for. A template that has not been published before.
Records. A certificate template was updated.
Look for. Template changes that allow the requester to supply the subject, or that add client authentication.
Records. A certificate template's permissions changed.
Look for. Enroll or write rights granted to a broad group: the template is now usable by an attacker.
Privilege use 2
Records. A process tried to use a privileged service, such as calling a function that needs SeTcbPrivilege, with the privilege, the process and the result.
Look for. SeTcbPrivilege or SeDebugPrivilege used by a process that has no reason to hold them. Volume is high; filter known processes first.
Records. A process tried an operation on a protected object that needs a privilege, with the object and privilege.
Look for. SeTakeOwnershipPrivilege or SeSecurityPrivilege used on files or keys by an unexpected process.
Processes, services and tasks 9
Records. A process started, with its image path, its creator process and the account. The command line is empty unless the policy "Include command line in process creation events" is enabled.
Look for. Office applications starting a shell, binaries running from user-writable folders, and encoded or download command lines. Turn on command line capture first: most of the value is in it.
Records. A process exited, with its process ID and exit status.
Look for. Pair with 4688 by process ID and host to find how long something ran.
Records. A service was installed, with its name, file name, type, start type and account.
Look for. Services whose file name is in a temporary or user folder, runs cmd or PowerShell, or has a random name. Remote execution tools install a service on the target.
Records. The Service Control Manager's record of a new service. It is in the System log, so it is there on hosts with no Security auditing configured.
Look for. The same reading as 4697. Where both exist they should agree; where only 7045 exists, it is your record.
Records. A scheduled task was created. The event carries the task's full XML: its actions, triggers and the account it runs as.
Look for. Read the action in the XML: PowerShell with an encoded command, a binary in a user folder, or a task created remotely from another host.
Records. A scheduled task was deleted.
Look for. A task created and deleted within minutes was used to run something once and then removed.
Records. A scheduled task was changed, with its new XML.
Look for. An existing, trusted task whose action now points somewhere new.
Records. A DPAPI master key backup was attempted. On a domain member, DPAPI backs a new master key up to a domain controller when the key is generated.
Look for. Outside those moments, master key backups can accompany tools that extract DPAPI-protected secrets.
Records. Recovery of a DPAPI master key was attempted, with the recovery server.
Look for. Recovery requests from a workstation to a domain controller for an account that is not the logged-on user.
Objects, shares and the firewall 18
Records. An operation was performed on a file, kernel, registry or removable storage object. It is logged only where the object's SACL asks for that access right, so you choose the objects in advance. Directory objects are 4662.
Look for. Put SACLs on the few things that matter (credential stores, sensitive shares) and read who touched them.
Records. A registry value was set, with old and new values. It needs "Set Value" auditing in the key's SACL.
Look for. SACLs on autostart keys give you who changed a Run value and what it now says.
Records. The permissions of a file system, registry or security token object changed. It does not fire for changes to the SACL itself. Permission changes on directory objects are 5136.
Look for. Permissions loosened on a sensitive folder or key, especially by an account that does not administer it.
Records. A share was accessed, once per session at the first access, with the share name and the client address.
Look for. Administrative shares (C$, ADMIN$) opened from workstations: that is how files are copied for remote execution.
Records. Each file or folder accessed through a share, with the relative path. Failures are logged only for share-level denials. It is high volume.
Look for. Enable it on servers you care about to see which files came across a share, such as a binary dropped in ADMIN$.
Records. A connection was permitted, with the process, addresses, ports and direction. It is high volume.
Look for. Useful on servers where you want process-to-connection records and do not run Sysmon event 3.
Records. A connection was blocked, with the same fields as 5156.
Look for. One source blocked on 445, 3389 or 5985 across many hosts is something looking for a way in.
Records. A process asked for a handle to an object with a set of access rights. It is logged where the SACL asks for it, and failures show up here.
Look for. Failed handle requests to sensitive files: someone without access trying anyway.
Records. A handle to an object was closed. It shares the Handle ID of the 4656 that opened it.
Look for. Pairs with 4656 by Handle ID to bound how long an object was held open.
Records. An object was deleted. It carries the Handle ID but not the name; the name is in the matching 4656 or 4663.
Look for. Deleted files on audited folders. Join on Handle ID to get the path.
Records. A share was created, with its name and local path.
Look for. A new share on a workstation, or one pointing at the root of a drive: data being staged for collection.
Records. A share's settings or permissions changed.
Look for. A share opened up to Everyone.
Records. A share was removed.
Look for. A share created and removed within the incident window.
Records. A Windows Firewall rule was added, with the rule name and the profile.
Look for. Inbound rules for 3389, 445 or 5985, or an allow rule for a single unknown binary.
Records. A Windows Firewall rule was changed.
Look for. An existing rule widened to allow any address.
Records. A Windows Firewall rule was deleted.
Look for. Block rules removed, especially ones protecting management ports.
Records. Windows Firewall settings were reset to their defaults.
Look for. A reset you did not do throws away your rules.
Records. A firewall setting changed, such as a profile being turned off.
Look for. A profile switched off on a server.
System state and integrity 7
Records. Windows started. Microsoft notes it is logged when LSASS starts.
Look for. Unexpected reboots during an incident, often after a driver or a ransomware payload was installed.
Records. The system time changed, with the old and new times and the process that changed it. Microsoft notes it is logged whatever the Audit Security State Change setting, and that LOCAL SERVICE changes are normal time correction.
Look for. Changes made by anything other than the time service: moving the clock to confuse a timeline or a ticket lifetime.
Records. Boot Configuration Data was loaded at startup, with settings such as whether test signing and kernel debugging are on.
Look for. Test signing, kernel debugging or integrity checks turned off: the machine will now load unsigned drivers.
Records. Code Integrity found a file whose image hash is not valid, which can mean it was changed on disk.
Look for. A system binary or driver that fails its hash: tampering, or corruption worth ruling out.
Records. A new device was recognized, with its device ID, class and vendor.
Look for. USB storage on machines where it should not appear, close in time to sensitive file access.
Records. The event log service shut down. A normal system shutdown stops it too, so read it against the startup and shutdown events around it.
Look for. A shutdown of the logging service with no matching system shutdown: the log stopped recording while the machine kept running.
Records. The Security log is full and, depending on its settings, has stopped recording or is overwriting.
Look for. Evidence you cannot get back. Size the log (wevtutil sl, below) so it holds days, not hours.
Audit and log tampering 8
Records. The Security log was cleared, with the account that cleared it. It is logged whatever the audit policy says.
Look for. Treat it as an event in the incident, then look at what happened just before the earliest surviving record.
Records. The machine's audit policy changed, naming the subcategory and the change. Microsoft notes it is logged regardless of the Audit Policy Change setting.
Look for. Success or failure auditing removed from a subcategory: switching off the evidence before using it.
Records. A new security event source was registered.
Look for. Rare outside software installs. Read the process.
Records. A security event source was unregistered.
Look for. A source removed so its events stop.
Records. The CrashOnAuditFail setting changed.
Look for. Any change outside policy deployment.
Records. The SACL on an object changed, so what is audited on it changed.
Look for. SACLs removed from the objects you rely on, such as credential stores or AdminSDHolder.
Records. A per-user audit policy changed, which can exclude one account from auditing.
Look for. An account excluded from auditing. Per-user policy is seldom used, so any change is worth explaining.
Records. The SACL on the local security policy object changed.
Look for. As 4907, for the policy object itself.
System log 9
Channel events below are checked against the event manifests Windows ships (as extracted in the EVTX-ETW-Resources project), since Microsoft publishes no per-event pages for these channels. Several Operational channels are off by default; wevtutil gl shows whether one is enabled.
Records. A log other than Security was cleared, with the channel name and the account. The Security log's equivalent is 1102.
Look for. System, Windows PowerShell or Sysmon logs cleared: an attacker removing what 1102 does not cover.
Records. A service stopped unexpectedly, with how many times it has done so.
Look for. Security agents, backup services or the event log crashing repeatedly: tampering or a failing payload.
Records. A service entered the running or stopped state.
Look for. Security and backup services stopped shortly before encryption, and remote execution services that start and stop within seconds.
Records. A service's start type changed, such as from automatic to disabled.
Look for. Defender, the firewall, Volume Shadow Copy or backup agents set to disabled.
Records. The system time changed, with the old and new times.
Look for. The same reading as Security 4616, on hosts without that subcategory on.
Records. The operating system started, with the start time.
Look for. Boundaries for each period the machine was running.
Records. The operating system began a clean shutdown.
Look for. Pair with 12. A start with no shutdown before it was a crash or a power loss.
Records. The machine restarted without a clean shutdown first, because it stopped responding, crashed or lost power.
Look for. Crashes after a driver loaded, and machines rebooted by pulling power to interrupt a response.
Records. A process started a restart or shutdown on behalf of a user, with the process, the account and the reason.
Look for. Reboots started by unexpected processes, which ransomware and some wipers use to finish their work.
Task Scheduler 6
Records. A user registered a scheduled task, with the account and the task name.
Look for. The same moment as Security 4698, on hosts without that subcategory on. The task's action is not in this event; read the task file or 4698 for it.
Records. A task's registration was updated.
Look for. A trusted task changed during the incident window.
Records. A task was deleted.
Look for. A task registered, run once and deleted.
Records. Task Scheduler launched a task's process, with its process ID.
Look for. The process ID ties the task to a process creation event.
Records. Task Scheduler started a task's action, with the action name.
Look for. When a persistence task actually ran. The action name is often the program path.
Records. A task's action completed.
Look for. Bounds the run with 200.
Remote Desktop 7
Records. Remote Desktop Services recorded a successful user authentication, with the user, domain and source address. It is logged on the machine being connected to.
Look for. Every RDP source address for an account, kept apart from the Security log. It does not mean a session started; read LocalSessionManager 21 or 25 for that.
Records. A session logon succeeded, with the user, session ID and source address.
Look for. A new RDP session. A source address of LOCAL is a console logon.
Records. The shell started in a session.
Look for. The session reached a desktop.
Records. A session logged off.
Look for. The end of a session started by 21.
Records. A session was disconnected without logging off, with the source address.
Look for. Sessions left disconnected keep running processes, and keep their credentials in memory.
Records. A disconnected session was reconnected, with the source address.
Look for. Pairs with Security 4778. A reconnect from a new address is someone else picking up the session.
Records. The Remote Desktop client on this machine tried to connect to a server, with the server name or address. It is logged on the machine the connection came from.
Look for. The outbound side of lateral movement: which servers an account connected to from this workstation.
WinRM and WMI 7
Records. A WinRM client created a session, with the connection string naming the target. It is logged on the client.
Look for. PowerShell remoting and WinRM tools reaching out from a workstation to servers.
Records. A WinRM shell was created on this machine for a remote client, with the resource URI.
Look for. Inbound remoting. Pair with Security 4624 Type 3 and with the process wsmprovhost.exe.
Records. WinRM returned an HTTP 401 to a client and dropped the connection.
Look for. Repeated 401s from one source: guessing credentials over WinRM.
Records. A WMI provider loaded, with the host process and the provider DLL path.
Look for. A provider DLL outside System32 or a known product folder.
Records. A WMI operation returned an error, with the client machine, the user, the client process ID and the operation.
Look for. Remote WMI queries from an unexpected machine, visible here even when they failed.
Records. A temporary event subscription was registered, with the namespace, the query, the user and the client process.
Look for. Temporary subscriptions last until the process ends. Read the query for what it waits for.
Records. A permanent event subscription was bound, with the filter and the consumer.
Look for. WMI persistence: the same subscription Sysmon 19 to 21 records, on hosts without Sysmon.
BITS and the firewall log 7
Records. A Background Intelligent Transfer Service job was created, with its name and owner.
Look for. Jobs created by script hosts or by users on servers. BITS downloads survive reboots and use the machine's proxy.
Records. A BITS job started transferring, with the URL.
Look for. The URL is the finding: a download from an address nothing else on the estate uses.
Records. A BITS job stopped, with the URL and a status code.
Look for. Pairs with 59.
Records. A rule was added to Windows Defender Firewall, with the rule name, the application, the ports and who added it.
Look for. The same reading as Security 4946, with more detail and no audit policy needed.
Records. A firewall rule was changed.
Look for. As Security 4947.
Records. A firewall rule was deleted, with who deleted it.
Look for. As Security 4948.
Records. Every rule was deleted from the firewall configuration, with who did it.
Look for. Any occurrence outside a rebuild.
AppLocker and App Control 9
Records. An executable or DLL was allowed by AppLocker policy, with its path and hash.
Look for. A record of what ran even where you have no other process logging.
Records. A file ran that the policy would have blocked if enforced.
Look for. What enforcement would stop, and what an attacker ran from a user-writable path.
Records. A file was blocked from running.
Look for. Something tried. Find what dropped it.
Records. A script or installer was allowed.
Look for. As 8002, for scripts.
Records. A script or installer ran that enforcement would have blocked.
Look for. As 8003, for scripts.
Records. A script or installer was blocked.
Look for. As 8004, for scripts.
Records. A process tried to load a file that did not meet the signing level required. Microsoft notes it can occur with or without an App Control policy, and often means a revoked signature.
Look for. Unsigned or revoked DLLs loaded into protected processes.
Records. The file would have been blocked if the App Control policy were enforced.
Look for. What enforcement would stop: the list to read before turning enforcement on, and the record of what an attacker ran meanwhile.
Records. App Control blocked a file.
Look for. Something tried to run outside policy.
Other useful channels 6
Records. A document was printed, with its name, owner, printer, size and page count.
Look for. Printing as a data theft channel, in insider cases. The channel is often off; check before relying on it.
Records. A printer driver was added or updated, with its files.
Look for. Driver installs outside your print management: the PrintNightmare family of attacks installs a driver to run code.
Records. A client connected to this server over SMB1, with its address.
Look for. Which clients still need SMB1 before you turn it off.
Records. The server denied an anonymous session, with the client name and address.
Look for. Anonymous enumeration attempts against file servers.
Records. This machine failed to authenticate to an SMB server, with the server name and the account.
Look for. The client side of failed lateral movement: which servers an account tried to reach and could not.
Records. The DNS client completed a query, with the name, type, status and results.
Look for. Names resolved on a host with no Sysmon 22. It does not say which process asked.
Sysmon 30
Records. A process started, with the full command line, the parent process, the hashes the configuration asks for and a ProcessGuid that is unique across the domain.
Look for. The same questions as 4688, plus hashes to look up and a ProcessGuid that ties every other Sysmon event to the process.
Records. A process explicitly set a file's creation time. Microsoft notes many processes do this legitimately.
Look for. Timestomping: an executable in a user folder whose creation time was moved back to look like part of Windows.
Records. A TCP or UDP connection, tied to the process by ProcessGuid, with addresses, ports and host names. Disabled by default.
Look for. Script hosts and built-in binaries talking to the internet, and connections at a steady interval.
Records. A process ended, with its ProcessGuid.
Look for. Bounds a process's lifetime with event 1.
Records. A driver loaded, with hashes and signature information.
Look for. Unsigned drivers, or signed drivers known to be vulnerable, loaded before security tools stop working.
Records. A module loaded into a process, with hashes and signature. Disabled by default and noisy if enabled broadly.
Look for. A signed program loading an unsigned DLL from its own folder is DLL side-loading.
Records. A process created a thread in another process, with StartAddress and, where it can be inferred, StartModule and StartFunction.
Look for. A remote thread whose start is outside any loaded module, or into lsass.exe or a browser.
Records. A process opened another, with the access rights granted. Microsoft names reading lsass.exe memory as what it is for, and warns it is noisy without filters.
Look for. TargetImage lsass.exe from a SourceImage that is not a security product or Windows component.
Records. A file was created or overwritten, with the process that did it.
Look for. Executables written to temporary, download and startup folders.
Records. A registry key or value was created or deleted.
Look for. Keys created under autostart locations and services.
Records. A registry value was set. The value written is recorded for DWORD and QWORD types.
Look for. Run and RunOnce values, service ImagePath, and Defender exclusion keys.
Records. A named stream was created, with hashes, including the Zone.Identifier mark of the web.
Look for. Where a file came from: the Zone.Identifier stream records the download source.
Records. A named pipe was created.
Look for. Pipe names used by known command-and-control frameworks.
Records. A client connected to a named pipe.
Look for. Pairs with 17 to show which process talked to the pipe.
Records. A WMI event filter was registered, with namespace, name and query.
Look for. With 20 and 21, a WMI event subscription: persistence that survives reboots with no file in an autostart folder.
Records. A WMI consumer was registered, with its name and destination.
Look for. A CommandLineEventConsumer or ActiveScriptEventConsumer: the part that runs code.
Records. A consumer was bound to a filter.
Look for. The binding completes the subscription. Read 19 and 20 for what it runs and when.
Records. A process made a DNS query, successful or not.
Look for. The process behind a suspicious domain, which DNS server logs cannot tell you.
Records. A file was deleted and a copy was saved to the archive directory (C:\Sysmon by default).
Look for. Recover a tool an attacker deleted. Watch the archive's size.
Records. Process hiding such as hollowing or herpaderping was detected.
Look for. Any occurrence deserves a look.
Records. A file was deleted, without keeping a copy.
Look for. Tools and output deleted after use.
Records. The Sysmon service started or stopped.
Look for. Sysmon stopped outside maintenance: someone turning off the sensor.
Records. A process read a drive directly with the \\.\ notation. Microsoft notes malware uses it to read locked files and to avoid file auditing.
Look for. Raw reads by anything other than backup and disk tools: reading NTDS.dit or the SAM hive from under Windows.
Records. A registry key or value was renamed, with the new name.
Look for. Renames that move a value into an autostart location.
Records. The Sysmon configuration changed, such as its filtering rules.
Look for. A configuration change you did not deploy: someone blinding the sensor without stopping it.
Records. The clipboard contents changed.
Look for. In RDP sessions, data copied in or out of a server.
Records. Sysmon blocked an executable file from being created.
Look for. An attempt to drop a binary where your rules forbid one.
Records. Sysmon blocked file shredding by a tool such as SDelete.
Look for. Someone trying to destroy files beyond recovery.
Records. Sysmon detected a new executable file being created.
Look for. Executables written to user folders and shares.
Records. Sysmon hit an error, which can happen under heavy load or when integrity conditions are not met.
Look for. Errors in a run on one host can mean someone is interfering with the driver.
PowerShell 4
Records. The text of each script block PowerShell processed. Long blocks are split across several events. The policy is Turn on PowerShell Script Block Logging.
Look for. Decoded download cradles, FromBase64String, Invoke-Expression and AMSI tampering. The logged block is what PowerShell compiled, after an encoded command was decoded.
Records. Pipeline execution details for the modules module logging is turned on for: the commands and their parameter values.
Look for. Cmdlets and parameters actually run, which can survive where script text was obfuscated.
Records. A PowerShell engine started. The event data includes the host application's command line and the engine version.
Look for. A HostApplication with -EncodedCommand, and an engine version of 2, which has no script block logging.
Records. Pipeline execution details written to the Windows PowerShell log, which is where Microsoft's Group Policy documentation places module logging.
Look for. The same reading as 4103.
Microsoft Defender Antivirus 14
Records. Defender Antivirus detected malware or potentially unwanted software, with the threat name, severity and path.
Look for. Read the next event for the same threat to see what was done about it.
Records. Defender Antivirus took action to protect the system.
Look for. The same threat detected and removed again and again means something keeps putting it back.
Records. Defender Antivirus tried to act on a threat and failed.
Look for. The threat may still be there. Treat it as live.
Records. Defender Antivirus hit a critical error acting on a threat.
Look for. As 1118.
Records. An attack surface reduction rule fired in block mode, with the path and the rule.
Look for. Office applications creating child processes or writing executables, blocked: something tried.
Records. Real-time protection was disabled.
Look for. Who or what disabled it, and what ran in the minutes after.
Records. Defender Antivirus configuration changed, with old and new values.
Look for. Exclusions added for a path, process or extension: the folder an attacker is about to use.
Records. Scanning for malware and potentially unwanted software was disabled.
Look for. As 5001.
Records. Scanning for viruses was disabled.
Look for. As 5001.
Records. Tamper protection blocked a change to Defender Antivirus settings.
Look for. Something tried to turn Defender off and failed. Find the process.
Records. The antimalware engine found malware or potentially unwanted software.
Look for. Read with 1116; older tooling and some scans report through this ID.
Records. The antimalware platform took action against malware.
Look for. Read with 1117.
Records. The antimalware platform detected suspicious behavior.
Look for. Behavior detections catch tools that a file scan did not.
Records. The security intelligence update failed.
Look for. Updates failing on a host that updates fine elsewhere: blocked update servers or a tampered configuration.
From technique to events
The same technique leaves different events on the machine it came from and the machine it reached. Read both sides when you have both, and treat each row as where to look, not a detection on its own: every one of these events also happens for ordinary reasons.
| Technique | On the machine it came from | On the target or domain controller | What it does not prove |
|---|---|---|---|
| Remote service (PsExec and similar) | 4648 if other credentials were supplied; Sysmon 1 and 3 for the tool | 4624 Type 3; 5140 for ADMIN$ and 5145 for the file copied; 7045 and 4697 for the service; 4688 or Sysmon 1 for the service binary under services.exe | Which tool did it. Any remote service creation leaves the same shape; the service name and binary are the clues. |
| WMI remote execution | 4648 if other credentials were supplied; Sysmon 1 for wmic or PowerShell | 4624 Type 3; 4688 or Sysmon 1 with WmiPrvSE.exe as the parent; WMI-Activity 5857 for the provider host | What the command did after it started. Read the child process and what it touched. |
| PowerShell remoting and WinRM | WinRM 6 with the target in the connection string; PowerShell 4104 on the client | 4624 Type 3; WinRM 91; wsmprovhost.exe in 4688 or Sysmon 1; PowerShell 4104 and 4103 for what ran | Intent. Administrators use remoting all day; the script blocks are the evidence. |
| Remote Desktop | RDPClient 1024 naming the server; 4648 if credentials were typed for another account | RemoteConnectionManager 1149; 4624 Type 10; LocalSessionManager 21, 22, 24, 25 and 23; 4778 and 4779 for reconnects | What was done inside the session. Pair it with process and file events in the same Logon ID. |
| Remote scheduled task | 4648 if other credentials were supplied | 4624 Type 3; 4698 with the task XML; Task Scheduler 106, then 200 and 201 when it ran; 4699 or 141 if it was removed | Who wrote the task XML. The registering account can be a stolen one. |
| Password spraying | Nothing useful on the attacker's machine | On domain controllers: 4771 code 0x18 and 4776 failures across many accounts from one address; on member servers: 4625 Sub Status 0xC000006A; 4740 lockouts; then a 4624 from the same address | That the success is the attacker. Confirm with what the account did next. |
| Kerberoasting | Nothing on the domain controller from the cracking, which happens offline | 4769 for many user-account services in a short window, often with encryption type 0x17 (RC4) | That a password was cracked. It proves the tickets were requested. |
| AS-REP roasting | Nothing; the hash is cracked offline | 4768 with Pre-Authentication Type 0 for an account that does not require pre-authentication; 4738 if someone turned that setting on | That the password was cracked. |
| DCSync | Sysmon 3 from the tool to a domain controller on the RPC ports | 4662 on the domain controller with a replication right GUID in Properties, by an account that is not a domain controller | Which accounts were pulled. Assume all of them, krbtgt included. |
| LSASS memory access | Sysmon 10 with TargetImage lsass.exe; Defender 1116 or 1015 if it was caught | Not applicable: this is local | That credentials were taken off the machine. Look for the dump file (Sysmon 11) and an outbound copy. |
| Persistence | Not applicable | Services 7045 and 4697; tasks 4698 and 106; Run keys in Sysmon 13 or 4657; WMI in Sysmon 19 to 21 and WMI-Activity 5861; new accounts 4720 with 4732 to local Administrators; 4741 for new computer accounts | That it ever ran. Check for the matching execution events. |
| Defense evasion | Not applicable | Logs cleared: 1102 and System 104; the log service stopped: 1100; audit policy: 4719, 4912, 4907; Defender: 5001, 5007, 5013; the firewall: 4946 to 4950 and 2004 to 2033; the clock: 4616 and Kernel-General 1; Sysmon: 4 and 16 | What was hidden. The gap before the earliest surviving record is the question. |
Query a host with Get-WinEvent
On a live host, or against exported .evtx files, Get-WinEvent with -FilterHashtable filters in the event log service and is far faster than piping everything through Where-Object. Event data fields are in the XML, which the first example turns into properties. Every cmdlet and parameter below is checked against its Microsoft reference page.
Network and RDP logons in the last day, by account and source
$since = (Get-Date).AddDays(-1)
Get-WinEvent -FilterHashtable @{ LogName = 'Security'; Id = 4624; StartTime = $since } |
ForEach-Object {
$d = @{}
([xml]$_.ToXml()).Event.EventData.Data | ForEach-Object { $d[$_.Name] = $_.'#text' }
[pscustomobject]@{ User = $d.TargetUserName; Type = $d.LogonType; From = $d.IpAddress }
} |
Where-Object { $_.Type -in '3', '10' } |
Group-Object User, Type, From | Sort-Object Count -Descending |
Select-Object Count, Name -First 25Services and scheduled tasks created in the last week
$since = (Get-Date).AddDays(-7)
Get-WinEvent -FilterHashtable @{ LogName = 'System'; Id = 7045; StartTime = $since } |
Select-Object TimeCreated, Message
Get-WinEvent -FilterHashtable @{ LogName = 'Security'; Id = 4698; StartTime = $since } |
Select-Object TimeCreated, MessageRemote Desktop sessions: logons, disconnects and reconnects
$lsm = 'Microsoft-Windows-TerminalServices-LocalSessionManager/Operational'
Get-WinEvent -FilterHashtable @{ LogName = $lsm; Id = 21, 24, 25 } -MaxEvents 200 |
Select-Object TimeCreated, Id, MessageEvidence of tampering: logs cleared, audit policy changed, Defender changed
Get-WinEvent -FilterHashtable @{ LogName = 'Security'; Id = 1102, 4719 } -ErrorAction SilentlyContinue |
Select-Object TimeCreated, Id, Message
Get-WinEvent -FilterHashtable @{ LogName = 'System'; Id = 104 } -ErrorAction SilentlyContinue |
Select-Object TimeCreated, Message
$def = 'Microsoft-Windows-Windows Defender/Operational'
Get-WinEvent -FilterHashtable @{ LogName = $def; Id = 5001, 5007, 5013 } -ErrorAction SilentlyContinue |
Select-Object TimeCreated, Id, MessageRead an exported .evtx file instead of the live log
Get-WinEvent -Path .\Security.evtx -FilterXPath '*[System[(EventID=4624 or EventID=4625)]]' |
Select-Object TimeCreated, Id, Message -First 50Find them in Microsoft Sentinel
Security events land in the SecurityEvent table; System, Sysmon, PowerShell and the other channels collected as Windows event logs land in Event. Every query below ran without error on practice data and uses only columns in Microsoft's schema for its table. Thresholds are starting points.
Who logged on over the network or RDP, and to how many hosts
SecurityEvent
| where TimeGenerated > ago(7d)
| where EventID == 4624 and LogonType in (3, 10)
| summarize Logons = count(), Hosts = dcount(Computer)
by TargetUserName, LogonType, IpAddress
| order by Hosts descWhy logons are failing
SecurityEvent
| where TimeGenerated > ago(1d)
| where EventID == 4625
| summarize Failures = count(), Accounts = dcount(TargetUserName)
by IpAddress, Status, SubStatus
| order by Accounts descA spray that worked: many accounts failed, then one succeeded
let fails = SecurityEvent
| where TimeGenerated > ago(1d)
| where EventID == 4625
| summarize Accounts = dcount(TargetUserName), LastFail = max(TimeGenerated)
by IpAddress;
SecurityEvent
| where TimeGenerated > ago(1d)
| where EventID == 4624 and LogonType in (3, 10)
| join kind=inner fails on IpAddress
| where Accounts >= 10 and TimeGenerated > LastFail
| project TimeGenerated, IpAddress, TargetUserName, Computer, AccountsKerberos service tickets with RC4, by requester
SecurityEvent
| where TimeGenerated > ago(1d)
| where EventID == 4769
| parse EventData with * 'TicketEncryptionType">' Enc '<' *
| parse EventData with * 'ServiceName">' Svc '<' *
| where Enc == "0x17" and not(Svc endswith "$")
| summarize Services = dcount(Svc) by TargetUserName, IpAddress
| where Services >= 5Members added to privileged groups
SecurityEvent
| where TimeGenerated > ago(7d)
| where EventID in (4728, 4732, 4756)
| project TimeGenerated, Computer, EventID, Group = TargetUserName,
Member = MemberName, AddedBy = SubjectUserName
| order by TimeGenerated descServices installed, from either log
union
(SecurityEvent
| where EventID == 4697
| project TimeGenerated, Computer, Detail = ServiceFileName),
(Event
| where EventLog == "System" and EventID == 7045
| project TimeGenerated, Computer, Detail = RenderedDescription)
| where TimeGenerated > ago(7d)
| order by TimeGenerated descLogs cleared or audit policy changed
SecurityEvent
| where TimeGenerated > ago(30d)
| where EventID in (1102, 4719)
| project TimeGenerated, Computer, Activity, SubjectUserNameSysmon: something opened lsass.exe
Event
| where TimeGenerated > ago(1d)
| where Source == "Microsoft-Windows-Sysmon" and EventID == 10
| where EventData has "lsass.exe"
| parse EventData with * 'SourceImage">' SourceImage '<' *
| summarize Opens = count(), Hosts = dcount(Computer) by SourceImagePowerShell script blocks with download or decode patterns
Event
| where TimeGenerated > ago(7d)
| where Source == "Microsoft-Windows-PowerShell" and EventID == 4104
| where RenderedDescription has_any ("FromBase64String",
"DownloadString", "Net.WebClient", "Invoke-Expression")
| project TimeGenerated, Computer, RenderedDescriptionDCSync: replication rights used by an account that is not a domain controller
let repl = dynamic(["1131f6aa-9c07-11d1-f79f-00c04fc2dcd2",
"1131f6ad-9c07-11d1-f79f-00c04fc2dcd2",
"89e95b76-444d-4c62-991a-0facbeda640c"]);
SecurityEvent
| where TimeGenerated > ago(7d)
| where EventID == 4662
| where Properties has_any (repl)
| where not(SubjectUserName endswith "$")
| project TimeGenerated, Computer, SubjectUserName, SubjectDomainNameAS-REP roasting: TGTs issued without pre-authentication
SecurityEvent
| where TimeGenerated > ago(7d)
| where EventID == 4768
| parse EventData with * 'PreAuthType">' PreAuth '<' *
| where PreAuth == "0"
| summarize Tickets = count() by TargetUserName, IpAddressComputer accounts created by users
SecurityEvent
| where TimeGenerated > ago(30d)
| where EventID == 4741
| where not(SubjectUserName endswith "$")
| project TimeGenerated, Computer, NewComputer = TargetUserName,
CreatedBy = SubjectUserNameSID History added, and trusts created or changed
SecurityEvent
| where TimeGenerated > ago(30d)
| where EventID in (4765, 4766, 4706, 4716)
| project TimeGenerated, Computer, Activity, SubjectUserName,
TargetUserNameCertificates requested, by requester
SecurityEvent
| where TimeGenerated > ago(7d)
| where EventID in (4886, 4887)
| summarize Requests = countif(EventID == 4886),
Issued = countif(EventID == 4887) by Requester
| order by Requests descSystem time changed by something other than the time service
SecurityEvent
| where TimeGenerated > ago(30d)
| where EventID == 4616
| where SubjectUserSid != "S-1-5-19" // LOCAL SERVICE corrects the clock
| project TimeGenerated, Computer, SubjectUserName, ProcessNameRemote Desktop authentications, by account and source
Event
| where TimeGenerated > ago(7d)
| where Source == "Microsoft-Windows-TerminalServices-RemoteConnectionManager"
| where EventID == 1149
| extend Params = extract_all(@"<Param>([^<]*)</Param>", ParameterXml)
| extend User = tostring(Params[0]), Address = tostring(Params[2])
| summarize Sessions = count(), Hosts = dcount(Computer) by User, AddressLogs other than Security cleared, and services set to disabled
Event
| where TimeGenerated > ago(30d)
| where EventLog == "System"
| where (EventID == 104 and Source == "Microsoft-Windows-Eventlog")
or (EventID == 7040 and RenderedDescription has "disabled")
| project TimeGenerated, Computer, EventID, RenderedDescriptionDefender exclusions added
Event
| where TimeGenerated > ago(30d)
| where Source == "Microsoft-Windows-Windows Defender" and EventID == 5007
| where RenderedDescription has "Exclusions"
| project TimeGenerated, Computer, RenderedDescriptionQuick lookup
| Question | Events |
|---|---|
| Who logged on, and how? | 4624, Logon Type |
| Why did a logon fail? | 4625 Sub Status, 4771 and 4768 result codes, 4776 |
| Was a password sprayed? | 4625, 4771 and 4776 across many accounts, 4740, then 4624 |
| Who came in over RDP? | 4624 Type 10, RemoteConnectionManager 1149, LocalSessionManager 21 and 25 |
| Where did this machine RDP to? | RDPClient 1024 |
| Was an RDP session picked up? | 4778, 4779, LocalSessionManager 24 and 25 |
| Was PowerShell remoting used? | WinRM 6 (client), WinRM 91 (server), 4104 |
| Was Kerberos abused? | 4769 encryption type, 4768 Pre-Authentication Type, 4770 |
| Was the directory replicated (DCSync)? | 4662 with a replication right GUID |
| Were certificates abused? | 4886, 4887, 4899, 4900 |
| Was an account created or promoted? | 4720, 4741, 4738, 4728, 4732, 4756, 4765 |
| Was a trust or domain policy changed? | 4706, 4716, 4739, 4713 |
| What ran? | 4688 with command line, Sysmon 1, 4104, AppLocker 8002, App Control 3076 |
| What persists? | 4697, 7045, 4698, Task Scheduler 106, Sysmon 13, 19 to 21, WMI-Activity 5861 |
| What touched lsass.exe? | Sysmon 10, Defender 1116 and 1015 |
| What came across a share? | 5140, 5145, 5142 |
| What did it download? | BITS 59, Sysmon 3 and 22, DNS Client 3008 |
| Was a USB device used? | 6416 |
| When was the machine on? | 4608, Kernel-General 12 and 13, Kernel-Power 41, User32 1074 |
| Was the evidence tampered with? | 1102, 104, 1100, 4719, 4907, 4912, 4616, Sysmon 4 and 16, Defender 5001, 5007, 5013 |
From reading one event to reconstructing what happened
Windows Endpoint Investigation teaches the method these events serve: correlating logons, processes, services and artifacts on a host into a timeline you can defend, and proving each step.
Read the first module free →Weekly security engineering insights
Detection techniques, architecture patterns, and operational judgment, every Tuesday.
No spam. Unsubscribe anytime.