killchain-compendium/Forensics/Windows Event Logs.md

166 lines
5.2 KiB
Markdown
Raw Permalink Normal View History

2023-02-26 21:45:17 +01:00
# Windows Event Log
## Dump Logfile
2025-06-25 23:03:52 +02:00
Windows event logs can be found under `C:\Windows\System32\winevt\Logs`.
Windows Event Logfiles can also be dumped via
2023-11-07 19:02:14 +01:00
2023-02-26 21:45:17 +01:00
```sh
evtx_dump $EVENT_LOG > event.log
evtx_dump -o json $EVENT_LOG > event.log
```
2023-11-07 19:02:14 +01:00
2024-04-03 15:41:21 +02:00
## Query Windows Events
One method is to use the GUI Tool `Event Viewer`, another method is to use Powershell.
Use `Win-Event` to filter categories like Security or System (same categories
like in `Event Viewer`) and Event IDs throught the following line.
```sh
Get-WinEvent -FilterHashTable @{LogName='<Category>';ID='<Event IDs>'} | fl
```
2023-11-07 19:02:14 +01:00
## Event IDs
### Process
2025-06-25 23:03:52 +02:00
* **1**: Process Creation (Applications & Services -> Microsoft -> Windows ->
Sysmon -> Operational)
2026-04-03 21:56:33 +02:00
* **10**: ProcessAccess, Sysmon event where one process opens a handle to another process
2025-06-25 23:03:52 +02:00
* **4688**: Process Creation (Windows Logs -> Security)
2023-11-07 19:02:14 +01:00
### Files
2026-04-09 01:33:03 +02:00
* **11**: File opened/created (Applications & Services -> Microsoft -> Windows ->
2025-06-25 23:03:52 +02:00
Sysmon -> Operational)
* **4656**: File changed (Windows Logs -> Security)
* **13**: Registry value set (Applications & Services -> Microsoft -> Windows ->
Sysmon -> Operational)
* **4657**: Registry value set (Windows Logs -> Security)
### Network
* **3** Network connection (Sysmon, path shown above)
* **22** DNS query (Sysmon, path shown above)
2023-11-07 19:02:14 +01:00
### Account Management
2025-06-25 23:03:52 +02:00
The `subject` is the account doing an action on an `object`.
2023-11-14 20:36:49 +01:00
* **4719**: Attempt to change a policy
2023-11-07 19:02:14 +01:00
* **4720**: User account creation
* **4722**: User account enabled
2025-06-25 23:03:52 +02:00
* **4723**: Attempt to change an account password. The user attempts to change
their password
* **4724**: Attempt to reset the account password. The user attempts to reset
the password of another account
2026-04-07 16:50:43 +02:00
* **4725**: Account disabled
* **4726**: Account removed from systemved from system
2026-04-07 16:50:43 +02:00
* **4728**: Attempt to add an account to a global security group (logged domain wide)
2023-11-14 20:36:49 +01:00
* **4729**: Attempt to remove an account from a global security group
2026-04-07 16:50:43 +02:00
* **4732**: User was added to a security group (like Administrators, logged on local or DC)
2025-06-25 23:03:52 +02:00
* **4733**: User was removed from a security group (like Administrators)
* **4738**: User account properties were changed
* **4740**: User account was locked after repeated attempt of access
2026-04-07 16:50:43 +02:00
* **4756**: Attempt to add an account to a universal security group (logged on entire ad forest)
2023-11-14 20:36:49 +01:00
* **4757**: Attempt to remove an account from a universal security group
* **4768**: Kerberos TGT request
2026-04-03 21:17:36 +02:00
* **4769**: Kerberos TGS request
* **4771**: Kerberos pre-auth failure
2026-04-07 16:50:43 +02:00
* **4776**: Validate NTLM credentials at DC. This happens when the resource is
accessed via IP address, for legacy applications without Kerberos support or
auth between untrusted DC domains
2023-11-07 19:02:14 +01:00
### Account Logon
2025-06-25 23:03:52 +02:00
These can be found via `Event Viewer` under `Windows Logs` -> `Security`.
The `Logon ID` is the session identifier.
2026-04-07 16:50:43 +02:00
* **4624**: Successful logon/login, Session created on target resource
2025-06-25 23:03:52 +02:00
* **4625**: Failed logon/login
2023-11-07 19:02:14 +01:00
* **4634** and **4647**: Logoff
2026-04-10 02:14:03 +02:00
* **4648**: Login Using Explicit Credentials (e.g. from another user through
`net use /user:`)
2023-11-07 19:02:14 +01:00
* **4779**: Session disconnect
2026-04-11 16:47:10 +02:00
### AD & Entra ID
* **50126**: Invalide username or password
* **50053**: Account locked, because too many attempts were failed
* **50074**: MFA required but not provided
* **50055**: Password expired
2026-04-07 16:50:43 +02:00
### Active Directory Objects
* **5136**: Attribute-level modification on AD object (e.g. Group Policy Objects)
2026-04-09 01:33:03 +02:00
* **5137**: Directory service object was created
2026-04-07 16:50:43 +02:00
* **5140**: Object Access
2026-04-09 01:33:03 +02:00
* **5145**: Shared Access
2026-04-07 16:50:43 +02:00
2026-04-11 16:47:10 +02:00
#### Network Policy Server
RADIUS connection via VPN.
* **6272**: Network Policy Server granted access (e.g. VPN login)
* **6273**: Network Policy Server denied access (e.g. VPN login failed)
* **6274**: Network Policy Server discarded the request (e.g. incorrect request)
2025-06-25 23:03:52 +02:00
### Logon Types
2026-04-07 16:50:43 +02:00
* **2**: Interactive
2026-04-10 02:14:03 +02:00
* **3**: Network (e.g. SMB, PsExec)
2026-04-07 16:50:43 +02:00
* **4**: Batch
* **5**: Service
2026-04-10 02:14:03 +02:00
* **7**: Unlock, when Session is already established in some other way
2026-04-07 16:50:43 +02:00
* **10**: RDP
2025-06-25 23:03:52 +02:00
2023-11-07 19:02:14 +01:00
### Scheduled Tasks
* **4698**: Scheduled task creation
* **4702**: Scheduled task updated
* **4699**: Scheduled task deletion
2025-05-02 00:38:15 +02:00
* **106** Task registered
* **100** Task started
* **129** Created Task Process
2026-10-17 00:02:29 +02:00
* **200** Task launched action
* **201** Task completed
2025-05-02 00:38:15 +02:00
2024-04-03 15:41:21 +02:00
### System
* **7045**: Service installation
2026-04-10 02:14:03 +02:00
* **17**: Service creates named pipes for stdin, stdout and stderr
2024-04-03 15:41:21 +02:00
2023-11-07 19:02:14 +01:00
### Security
2025-06-25 23:03:52 +02:00
These can be found via `Event Viewer` under `Windows Logs` -> `Security`
2023-11-07 19:02:14 +01:00
* **1100**: Logging service disabled
* **1102**: Log deletion
2025-05-02 00:38:15 +02:00
* **1116**: Windows Defender Malware detection
* **1117**: Windows Defender Malware quarantined
2024-04-03 15:41:21 +02:00
* **4697**: Service installation (subsection of **7045**)
2025-05-02 00:38:15 +02:00
* **5001**: Windows Defender disabled
* **5007**: Windows Defender configuration changed
### Powershell
Applications and Services Logs -> Windows Powershell and Apps and Services Logs
-> Microsoft -> Windows -> Powershell -> Operational
* **600**: Opening Powershell
* **4104**: Powershell command executed
2025-06-25 23:03:52 +02:00
In addition check Powershell's history file on path
`C:\Users\%USER%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt`
2025-05-02 00:38:15 +02:00
## RDP
Applications and Services Logs -> Microsoft -> Windows ->
TerminalServices-LocalSessionManager -> Operational
* **21**: RDP Connect
* **24**: RDP Disconnect
* **25**: RDP Reconnect