What you'll learn
- Read Windows events and set an audit policy that records attacks
- Detect password spraying, malicious execution and persistence
- Detect LSASS dumping, Kerberoasting and DCSync
- Trace lateral movement and privileged changes in Active Directory
- Collect events centrally, respond to a domain compromise and harden AD
Each lesson is tagged Junior, Mid or Expert, so you can start where you are. Finish with the lab and the quiz; a score of 4 out of 5 marks the course complete in this browser.
The lessons below are in English for now, because they quote technical names, commands and log fields. An Arabic version is planned.
Course map
Each module moves from fundamentals to applied work to an expert challenge. Exercises have worked solutions: try first, then open the solution. 10 modules · 27 exercises · ~4 hours
- 0Start here: what Windows tells youJuniorMidExpert20 min · 2 exercises
- 1Event structure and audit policyJuniorMidExpert25 min · 3 exercises
- 2Logons and KerberosJuniorMidExpert25 min · 3 exercises
- 3Process execution and PowerShellJuniorMidExpert30 min · 3 exercises
- 4PersistenceJuniorMidExpert25 min · 3 exercises
- 5Credential access: LSASS, Kerberoasting and DCSyncJuniorMidExpert25 min · 3 exercises
- 6Lateral movement and tieringJuniorMidExpert25 min · 3 exercises
- 7Active Directory changes and defence evasionJuniorMidExpert25 min · 3 exercises
- 8Collection, SIEM queries and the timelineJuniorMidExpert20 min · 3 exercises
- 9Response, hardening and the enterprise; cheat sheet and assessmentJuniorMidExpert20 min · 1 exercises
No prior experience is needed. Module 0 covers the architecture, installation and configuration, and sets up the project you extend in every module. Each command is labelled with its impact (read-only, changes files, changes the system, uses the network). Work on a computer or virtual machine you control.
Start here: what Windows tells you
Goal: Understand the Windows event logs and Sysmon, how attacks on Active Directory usually unfold, ATT&CK for Windows, and the course investigation.
Event logs, channels and Active Directory
Windows records security activity in event logs. Each event has a provider, an event ID, a time, a computer and named data fields. The Security log records logons, Kerberos, process creation and account changes, but only for what the audit policy enables. Sysmon adds detailed process, network, registry and LSASS-access events, and since 2026 it ships with Windows 11 and Windows Server 2025 as an optional feature. In a domain, the domain controllers see every authentication, so their logs are the most valuable.
Most corporate breaches end in Active Directory: the attacker starts on one workstation (phishing, a stolen password), steals credentials, moves to servers and takes over the domain. Each step produces specific events on specific machines. Knowing which events, and making sure they are recorded and collected, is the difference between seeing an attack in minutes and finding it months later.
| Log (channel) | Key events | Needs |
|---|---|---|
| Security | 4624/4625 logons, 4672 admin logon, 4688 process, 4698 task, 4720/4728 accounts and groups, 4768/4769/4771 Kerberos, 4662 AD access, 1102 cleared | advanced audit policy (module 1) |
| System | 7045 service installed, 104 log cleared | on by default |
| Microsoft-Windows-PowerShell/Operational | 4104 script block (the decoded script) | script block logging |
| Microsoft-Windows-Sysmon/Operational | 1 process, 3 network, 10 process access, 11 file, 13 registry, 19-21 WMI, 22 DNS | Sysmon (built into Windows 11 and Server 2025, off by default) |
| Microsoft-Windows-Windows Defender/Operational | 1116 detection, 5001 real-time protection off | on by default |
| Directory Service (DCs) | replication, LDAP diagnostics | DC only |
The investigation in this course
On 3 December, a Rimal employee opened a malicious invoice. Sixty minutes later the attacker created a Domain Admin. You will follow the attack through 44 events from three machines (workstation WS-17, file server FS-01, domain controller DC-01) in the JSON shape that Get-WinEvent, Winlogbeat or the Azure Monitor Agent produce, plus one raw XML event, and write the detections that would have caught each step.
winmon/
├── event_4625.xml, readxml.py # module 1: the raw format
├── auditpol.txt, auditcheck.py # module 1: is auditing on?
├── events.jsonl, winlib.py # 44 events from WS-17, FS-01, DC-01
├── authn.py # module 2
├── process.py # module 3
├── persist.py # module 4
├── creds.py # module 5
├── lateral.py # module 6
├── evasion.py # module 7
└── timeline.py # module 8Dism /Online /Enable-Feature /FeatureName:Sysmon # built-in Sysmon (Windows 11, Server 2025)
sysmon -i C:\Config\sysmon-rimal.xml
Get-WinEvent -LogName Security -MaxEvents 20 | Format-Table TimeCreated, Id, Message -Wrap
auditpol /get /category:*Quick check: A workstation was compromised. Where do you look for the attacker's Kerberos ticket requests?
The KDC on the domain controller issues and logs Kerberos tickets.
Exercise 1Junior
Name the log and event ID for: (a) a new service installed, (b) a decoded PowerShell script, (c) a process opening LSASS.
Worked solution
(a) System 7045 (and Security 4697 if 'Security System Extension' auditing is on). (b) PowerShell/Operational 4104, script block logging. (c) Sysmon/Operational 10 (process access) with TargetImage lsass.exe.
Exercise 2Mid
Why are default Windows settings not enough for security monitoring?
Worked solution
Several key subcategories are off by default (process creation, directory service access, scheduled tasks), 4688 has no command line unless enabled, script block logging is off, Sysmon is off, and the default Security log size holds only hours on a busy server. Without changes, the most important steps of this attack would leave no trace.
Tools in this course
Security, System, PowerShell and Sysmon channels.
Use it for: endpoint and server telemetry
Integrates with: WEF, agents, SIEMs
Get-WinEvent, auditpol, AD cmdlets.
Use it for: hunting and response on hosts
Integrates with: WinRM, Defender
SIEM and XDR with Defender for Endpoint and for Identity.
Use it for: Microsoft-centric SOCs
Integrates with: KQL, AMA, WEF
SIEMs with Windows add-ons and agents.
Use it for: any SOC
Integrates with: Sysmon, WEF, Winlogbeat
Set up the investigation
Goal: ~/winmon holds the 44 events from 3 December and the tools to analyse them.
Event structure and audit policy
Goal: Read a raw Windows event, decode status codes and logon types, check the audit policy for gaps, and configure what is missing.
Logons and Kerberos
Goal: Understand NTLM and Kerberos authentication, detect password spraying, read logon types and sources, and spot service accounts used from workstations.
Process execution and PowerShell
Goal: Detect malicious execution: Office starting shells, encoded PowerShell, living-off-the-land binaries and discovery commands, with Sysmon, 4688 and script block logging.
Persistence
Goal: Detect the ways attackers make malware survive reboots: Run keys, scheduled tasks, services, WMI subscriptions and startup files.
Credential access: LSASS, Kerberoasting and DCSync
Goal: Detect credential dumping from LSASS memory, Kerberoasting with RC4 tickets, and DCSync replication from non-domain controllers.
Lateral movement and tiering
Goal: Map who logged on where, detect remote execution, and use the tiering model to see why one credential reached the domain controller.
Active Directory changes and defence evasion
Goal: Detect new privileged accounts and group changes, and attempts to disable Defender, change auditing or clear logs.
Collection, SIEM queries and the timeline
Goal: Collect events centrally with Windows Event Forwarding or agents, express detections in KQL, SPL and Sigma, and build the incident timeline.
Response, hardening and the enterprise; cheat sheet and assessment
Goal: Contain a domain compromise in the right order, reset krbtgt correctly, harden Windows and AD, and run Windows monitoring at enterprise scale.
Quick reference (the cheat-sheet lessons and the PDF content)
Windows telemetry sources
The Security log alone is not enough. Add Sysmon and PowerShell logging on every host.
Advanced Audit Policy: enable at minimum
Set by GPO: Computer Configuration › Policies › Windows Settings › Security Settings › Advanced Audit Policy.
| Category › subcategory | Setting | Gives you |
|---|---|---|
| Logon/Logoff › Logon, Special Logon | Success, Failure | 4624, 4625, 4672 |
| Account Logon › Kerberos Authentication / Service Ticket | Success, Failure | 4768, 4769, 4771 |
| Account Logon › Credential Validation | Success, Failure | 4776 (NTLM) |
| Account Management › User, Security Group | Success | 4720, 4722, 4728, 4732, 4756 |
| Detailed Tracking › Process Creation | Success + command line | 4688 with full command line |
| DS Access › Directory Service Changes / Access | Success | 5136, 4662 (DCSync, GPO edits) |
| Object Access › Detailed File Share | Success, Failure | 5145 (ADMIN$, C$ access) |
| Policy Change › Audit Policy Change | Success | 4719 (someone disabled auditing) |
Event ID reference by category
| ID | Logons and accounts |
|---|---|
| 4624 / 4625 | Logon success / failure (check logon type) |
| 4634 / 4647 | Logoff |
| 4648 | Logon with explicit credentials |
| 4672 | Admin privileges assigned at logon |
| 4720 / 4726 | User created / deleted |
| 4722 / 4725 | User enabled / disabled |
| 4724 | Password reset by an admin |
| 4728 / 4732 / 4756 | Added to global / local / universal group |
| 4740 | Account locked out |
| 4767 | Account unlocked |
| ID | Kerberos and NTLM |
|---|---|
| 4768 | TGT requested (pre-auth type 0 = AS-REP roastable) |
| 4769 | Service ticket (RC4 0x17 = Kerberoast signal) |
| 4771 | Pre-auth failed (password spray on DCs) |
| 4776 | NTLM credential validation |
| ID | Execution, persistence, evasion |
|---|---|
| 4688 | Process created |
| 4698 / 4702 | Scheduled task created / changed |
| 7045 / 4697 | Service installed |
| 4657 | Registry value changed (if audited) |
| 5136 | Directory object changed (GPO, AdminSDHolder) |
| 4662 | Directory object accessed (DCSync) |
| 1102 / 104 | Security / System log cleared |
| 4719 | Audit policy changed |
| 4104 | PowerShell script block |
| 1116 / 1117 | Defender detection / action |
| 5001 / 5007 | Defender real-time off / config changed |
| ID | Remote access |
|---|---|
| 4624 type 10 | RDP logon |
| 4778 / 4779 | Session reconnected / disconnected |
| 1149 | RDP user authenticated (TS-RemoteConnectionManager) |
| 5140 / 5145 | Network share accessed / checked |
Logon types (4624 / 4625)
Failure codes (4625 / 4771)
Detecting Active Directory attacks
| Attack | ATT&CK | What to look for |
|---|---|---|
| Password spray | T1110.003 | Many 4625 / 4771 across many users from one source in a short window |
| Kerberoasting | T1558.003 | One account requesting many 4769 tickets with encryption type 0x17 (RC4) |
| AS-REP roasting | T1558.004 | 4768 with pre-authentication type 0 |
| DCSync | T1003.006 | 4662 on the domain object with replication GUIDs 1131f6aa-… / 1131f6ad-… from a non-DC account |
| Pass-the-hash | T1550.002 | 4624 type 9 with logon process seclogo; NTLM 4776 from unusual hosts |
| Golden ticket | T1558.001 | 4769 with no matching 4768; odd ticket lifetimes; krbtgt not rotated |
| Privileged group change | T1098 | 4728 / 4732 / 4756 for Domain Admins, Enterprise Admins, Administrators |
| GPO or AdminSDHolder edit | T1484.001 | 5136 on groupPolicyContainer or AdminSDHolder |
| LSASS access | T1003.001 | Sysmon 10 with TargetImage lsass.exe from a non-security tool |
| Log cleared | T1070.001 | 1102 or 104, especially on a DC |
Lateral movement fingerprints
Each technique leaves evidence on both ends. Correlate source and destination by time and account.
SIEM queries
Field names depend on your connector and add-on. Test on 30 days of data before alerting.
SecurityEvent
| where EventID == 4769
| where TicketEncryptionType == "0x17"
| where ServiceName !endswith "$"
| summarize Tickets = dcount(ServiceName)
by Account, IpAddress, bin(TimeGenerated, 1h)
| where Tickets > 5SecurityEvent
| where EventID in (4728, 4732, 4756)
| where TargetUserName in ("Domain Admins",
"Enterprise Admins", "Administrators")
| project TimeGenerated, SubjectUserName,
MemberName, TargetUserName, Computerindex=wineventlog EventCode=7045
| table _time, host, Service_Name,
Service_File_Name, Service_Account
| where NOT match(Service_File_Name, "(?i)program files")index=wineventlog EventCode=4688
New_Process_Name="*powershell*"
(Process_Command_Line="*-enc*"
OR Process_Command_Line="*-EncodedCommand*")
| table _time, host, Account_Name, Process_Command_LineLOLBins worth a watchlist
Legitimate tools attackers abuse. Alert on unusual parents and command lines, not on the binary alone.
Sysmon event IDs
Suspicious parent → child processes
The fastest Tier 1 win on Windows: alert on these pairs from 4688 or Sysmon 1.
PowerShell red flags
Command-line patterns
-enc,-EncodedCommand,-w hidden,-nopIEX,Invoke-Expression,DownloadStringAdd-MpPreference -ExclusionPath(Defender exclusions)Set-MpPreference -DisableRealtimeMonitoring- PowerShell v2 started (
-Version 2) to dodge logging
Logging gaps to close
Check every host
- Command-line auditing on for 4688
- Sysmon deployed with a maintained config
- PowerShell script-block logging on; v2 removed
- Security log at least 1 GB, forwarded in near real time
- DC logs collected from every domain controller
Ransomware early-warning signals
Most ransomware crews spend days inside before encrypting. These signals are your chance to stop it.
| Signal | Where you see it | Typical lead time |
|---|---|---|
Shadow copies deleted (vssadmin delete shadows, wmic shadowcopy delete) | 4688 / Sysmon 1 | Minutes before encryption |
Recovery disabled (bcdedit /set recoveryenabled no, wbadmin delete catalog) | 4688 / Sysmon 1 | Minutes |
| Defender turned off or exclusions added | 5001, 5007, 4104 | Minutes to hours |
| Same service pushed to many hosts (PsExec, GPO) | 7045 on many hosts, 5145 ADMIN$ | Minutes to hours |
| Bulk data upload (rclone, MEGA, WinSCP) | Sysmon 1 / 3, proxy logs | Hours to days (double extortion) |
| New domain admin or GPO edit | 4728 / 4732 / 4756, 5136 | Hours to days |
| Network scanning and AD discovery tools | Sysmon 1 / 3 (AdFind, SharpHound, Advanced IP Scanner) | Days |
| Mass file renames or writes from one process | Sysmon 11, EDR | Encryption in progress |
Key terms
- Event ID
- The number that identifies the type of a Windows event, such as 4624 for a successful logon.
- Sysmon
- System Monitor: detailed process, network, registry and LSASS-access events; built into Windows 11 and Server 2025.
- Kerberoasting
- Requesting service tickets and cracking them offline to recover service account passwords.
- DCSync
- Abusing replication rights to ask a domain controller for password hashes.
- Tiering
- Separating identity systems, servers and workstations so credentials never cross upward.
- krbtgt
- The account whose key signs all Kerberos tickets; reset twice after a domain compromise.
Hands-on lab
Knowledge check
Answer all five questions, then check your answers. Each answer comes with a short explanation.
Further reading
- Microsoft: audit policy recommendations learn.microsoft.com
- Built-in Sysmon (Windows) learn.microsoft.com
- Kerberos RC4 changes (KB5073381) support.microsoft.com
- MITRE ATT&CK for Windows attack.mitre.org
- Windows Event Forwarding learn.microsoft.com
- Sigma github.com
Put it into practice
Use these ThreatAI tools to apply what you learned to your own environment.