Defensive Security Lab

Security Operations
Center

Wazuh runs inside a pre-built virtual machine (OVA) on VirtualBox. A Windows agent ships Security Event Logs to it automatically. Kali (WSL2) is the attacker. You detect everything in the Wazuh dashboard โ€” free, open source, no licence required.

๐Ÿ›ก๏ธ Wazuh OVA โ€” VirtualBox ๐Ÿ“ก Wazuh Agent โ€” Windows ๐Ÿ‰ Kali WSL2 โ€” Attacker Only
Section 01

01 Lab Overview

The Wazuh server runs inside a pre-built virtual machine (OVA) on VirtualBox โ€” no Linux setup, no installation commands, just import and start. A Wazuh Agent installed on Windows automatically ships Security Event Logs to it. Kali (WSL2) runs attacks against Windows. You detect everything in the Wazuh web dashboard.

๐Ÿ–ฅ๏ธ
Windows Host
Wazuh Agent installed
monitored endpoint
VirtualBox runs here
โ‡… agent
:1514
๐Ÿ›ก๏ธ
Wazuh VM
VirtualBox OVA
Manager + Indexer
Dashboard :443
โ† attacks
๐Ÿ‰
Kali Linux
WSL2 โ€” attacker only
nmap ยท hydra
no Wazuh here
Kali runs attacks โ†’ Windows generates Security Events โ†’ Agent ships to Wazuh VM :1514 โ†’ Detect in dashboard :443
๐ŸŽฏ
What we are monitoring

We monitor the Windows machine โ€” specifically its Windows Security Event Logs. The Wazuh Agent reads these automatically and ships them to the Wazuh VM. Wazuh has hundreds of built-in detection rules so alerts fire without writing any rule logic.

ComponentWhere it runsWhat it does
Wazuh OVA (VM)VirtualBox on WindowsThe SIEM โ€” Manager + Indexer + Dashboard all pre-installed. Access dashboard at https://<VM-IP>
Wazuh AgentWindows (native service)Collects Security, System, and App event logs automatically and ships them to the VM on port 1514
Kali Linux (WSL2)WSL2 onlyThe attacker โ€” runs nmap and hydra only. Nothing else installed here.
โš™๏ธ
System Requirements

RAM: 8 GB minimum โ€” 4 GB allocated to Wazuh VM, rest for Windows + WSL2  ยท  Disk: 50 GB free (OVA is ~4 GB, expands to ~20 GB)  ยท  OS: Windows 10/11 64-bit  ยท  CPU: Hardware virtualisation enabled in BIOS (Intel VT-x or AMD-V)  ยท  WSL2 with Kali installed

Section 02

02 Required Tools

Everything is free. No accounts or licences required.

VirtualBoxWindows installer ยท free
Virtualisation platform that runs the Wazuh OVA. Free and open source by Oracle. Required before importing the OVA.
WINDOWS โ€” INSTALL FIRST
Wazuh OVA~4 GB ยท pre-built VM image
Pre-built virtual machine containing Wazuh Manager, Indexer, and Dashboard โ€” all configured and ready. Import into VirtualBox and start. No Linux setup required.
VIRTUALBOX โ€” IMPORT
Wazuh AgentWindows .msi installer
Windows service that automatically collects Security, System, and Application event logs and ships them to the Wazuh VM. No manual log configuration required. Download the wazuh-agent-4.9.2-1.msi file from the link in Section 02.
WINDOWS โ€” INSTALL
nmapapt ยท Kali only
Port scanner โ€” used to simulate reconnaissance against the Windows machine.
KALI (WSL2)
hydraapt ยท Kali only
Login brute-force tool โ€” hammers Windows login services with wrong passwords, generating EventID 4625 bursts that Wazuh detects automatically.
KALI (WSL2)
๐Ÿ“ฅ
Download Links โ€” direct links, click or paste into browser

Wazuh OVA  โ†’  wazuh-4.14.4.ova (~4 GB)

VirtualBox โ€” Windows  โ†’  VirtualBox-7.2.6a-Win.exe

VirtualBox โ€” macOS Intel  โ†’  VirtualBox-7.2.6-OSX.dmg

VirtualBox โ€” macOS Apple Silicon  โ†’  VirtualBox-7.2.6-macOSArm64.dmg

Wazuh Agent (Windows)  โ†’  wazuh-agent-4.9.2-1.msi

nmap and hydra  โ†’  installed via apt on Kali, no download needed

Section 03

03 Installation Instructions

Part A โ€” Wazuh Server (VirtualBox OVA)
1Install VirtualBox

Download and run the VirtualBox installer for Windows hosts. Accept all defaults during installation. Restart Windows if prompted.

โš ๏ธ
Enable hardware virtualisation first

If VirtualBox shows an error about virtualisation not being enabled, restart your PC, enter BIOS/UEFI settings, and enable Intel VT-x or AMD-V. The option is usually under Advanced CPU settings.

2Download and Import the Wazuh OVA

Download the OVA file from the link in Section 02. It is approximately 4 GB โ€” this will take a few minutes.

Once downloaded, import it into VirtualBox:

๐Ÿ–ฑ๏ธ
Import steps in VirtualBox

File โ†’ Import Appliance โ†’ browse to the downloaded wazuh-4.14.4.ova file โ†’ Next โ†’ Import

The import takes 2โ€“5 minutes. Leave all settings at their defaults during import.

โš ๏ธ
Critical VirtualBox setting โ€” set this before starting the VM

After import, select the VM โ†’ Settings โ†’ Display โ†’ Graphics Controller โ†’ change to VMSVGA. Using any other controller will freeze the VM window.

3Configure VM Network โ€” Bridged Adapter

The Wazuh VM must be on the same network as your Windows machine so the agent can reach it. Set the network adapter to Bridged:

๐Ÿ–ฑ๏ธ
In VirtualBox

Select the Wazuh VM โ†’ Settings โ†’ Network โ†’ Adapter 1 โ†’ Attached to: Bridged Adapter โ†’ Name: select your active Windows network adapter โ†’ OK

4Start the VM and Get Its IP Address

Click Start in VirtualBox to boot the Wazuh VM. Wait for the boot to complete (1โ€“2 minutes) until you see the login prompt.

Log in to the VM console with these credentials:

Wazuh VM โ€” console login credentials
Username: wazuh-user
Password: wazuh

Once logged in, get the VM's IP address โ€” you need this for the agent and the dashboard:

Wazuh VM โ€” console
ip addr show | grep "inet " | grep -v 127.0.0.1

Note the IP shown (e.g. 192.168.x.x). This is your Wazuh Server IP โ€” write it down. You will use it in the agent installation and to access the dashboard.

5Open the Wazuh Dashboard

On your Windows machine, open a browser and navigate to the Wazuh VM's IP address:

Browser โ€” replace with your Wazuh VM IP
https://192.168.x.x

Your browser will show a certificate warning โ€” click Advanced โ†’ Proceed. This is expected for the self-signed lab certificate.

Wazuh Dashboard โ€” default login credentials
Username: admin
Password: admin
โœ…
Wazuh dashboard is working when

You see the Wazuh home screen with the Overview panel. It will show 0 agents connected โ€” that is correct at this stage. The agent comes next.

Part B โ€” Wazuh Agent (Windows)
6Install the Wazuh Agent on Windows

Open PowerShell as Administrator and run the silent install. Replace 192.168.x.x with your Wazuh VM IP from Step 4:

PowerShell โ€” Run as Administrator
# Install the agent โ€” replace 192.168.x.x with your Wazuh VM IP
msiexec.exe /i wazuh-agent-4.9.2-1.msi /q `
  WAZUH_MANAGER="192.168.x.x" `
  WAZUH_AGENT_NAME="Windows-Lab"

Start the agent service:

PowerShell โ€” Run as Administrator
NET START WazuhSvc

Verify it is running:

PowerShell โ€” Verify
Get-Service WazuhSvc
โœ…
Verify the agent appears in the dashboard

Go to Wazuh Dashboard โ†’ Agents. You should see Windows-Lab listed with status Active within 1โ€“2 minutes. Windows Security Events will begin flowing immediately once the agent connects.

Part C โ€” Attacker Machine (Kali WSL2)
7Install Attack Tools on Kali

Open your Kali WSL2 terminal. This is the only thing installed on Kali for this lab:

Kali Linux โ€” WSL2 Terminal
sudo apt update && sudo apt install -y nmap hydra
8Find Your Windows Host IP from Kali

Every attack command targets the Windows machine IP. Get it from Kali:

Kali Linux โ€” WSL2 Terminal
cat /etc/resolv.conf | grep nameserver

The IP shown (usually 172.x.x.x) is your Windows host. Write it down โ€” every attack command uses this IP.

๐Ÿ“
Two different IPs in this lab

Wazuh VM IP (Step 4, e.g. 192.168.x.x) โ€” used when installing the agent and accessing the dashboard.

Windows host IP (Step 8, e.g. 172.x.x.x) โ€” used as the attack target in hydra and nmap commands.

Section 04

04 Attack & Detect

This lab simulates real attacker behaviour instead of brute force noise. Each exercise represents a stage of an attack lifecycle.

EX-01Suspicious Process Execution
Detect PowerShell abuse (EventID 4688)
ATTACK
powershell -ExecutionPolicy Bypass -Command "Start-Process cmd"
DETECT
data.win.system.eventID: 4688
EX-02Scheduled Task Persistence
Detect scheduled task creation (EventID 4698)
ATTACK
schtasks /create /tn "Updater" /tr "cmd.exe" /sc minute /mo 5
DETECT
data.win.system.eventID: 4698
EX-03User Creation + Privilege Escalation
Detect account creation (4720) and admin escalation (4732)
ATTACK
net user backdoor P@ssword123 /add
net localgroup administrators backdoor /add
DETECT
data.win.system.eventID: 4720 OR data.win.system.eventID: 4732
EX-04Service Persistence
Detect malicious service creation (EventID 7045)
ATTACK
sc.exe create "WindowsUpdateHelper" binPath= "C:\Windows\Temp\update.exe" start= auto
DETECT
data.win.system.eventID: 7045
EX-05Log Clearing
Detect log tampering (EventID 1102)
ATTACK
wevtutil cl Security
DETECT
data.win.system.eventID: 1102
Section 05

05 Complete Uninstall

Run through these steps after your test run to get back to a clean slate. Once done, the machine will be in exactly the same state as before โ€” ready to redo the lab in class.

โš ๏ธ
Run in order

Stop the agent before uninstalling it, and power off the VM before deleting it. Skipping the stop steps can leave orphaned processes.

Step 1 โ€” Stop and Uninstall the Wazuh Agent (Windows)
PowerShell โ€” Run as Administrator
# Stop the agent service
NET STOP WazuhSvc

# Uninstall the agent via MSI โ€” finds and removes it automatically
$agent = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -like "*Wazuh Agent*" }
if ($agent) {
    msiexec.exe /x $agent.IdentifyingNumber /qn /norestart
    Write-Host "Wazuh Agent removed."
} else {
    Write-Host "Wazuh Agent not found."
}

Or uninstall manually: Settings โ†’ Apps โ†’ search "Wazuh" โ†’ Wazuh Agent โ†’ Uninstall

Step 2 โ€” Delete Leftover Agent Files (Windows)
PowerShell โ€” Run as Administrator
# Remove agent installation folder
Remove-Item -Path "C:\Program Files (x86)\ossec-agent" -Recurse -Force -ErrorAction SilentlyContinue

# Confirm it is gone
Test-Path "C:\Program Files (x86)\ossec-agent"
# Should return: False
Step 3 โ€” Remove the Wazuh VM (VirtualBox)
๐Ÿ–ฑ๏ธ
In VirtualBox

1. Right-click the Wazuh VM in the list โ†’ Close โ†’ Power Off (if it is running)

2. Right-click the VM โ†’ Remove โ†’ Delete all files

This deletes the VM and all its disk files. The OVA download file itself is kept โ€” you can reimport it for the next session without re-downloading.

Step 4 โ€” Verify Clean State (Windows)
PowerShell โ€” Run as Administrator
# Check agent service is gone โ€” should return an error
Get-Service WazuhSvc -ErrorAction SilentlyContinue

# Check agent folder is gone โ€” should return False
Test-Path "C:\Program Files (x86)\ossec-agent"
โœ…
Clean state confirmed when

Get-Service returns nothing (or "not found") and Test-Path returns False. The VM is deleted in VirtualBox. The machine is back to its original state.

Step 5 โ€” Kali Cleanup (Optional)
Kali Linux โ€” WSL2 Terminal
# Remove attack tools if you want a fully clean attacker machine
sudo apt remove -y nmap hydra && sudo apt autoremove -y
Uninstall Checklist
#ActionHowDone?
1Stop Wazuh Agent serviceNET STOP WazuhSvcโ˜
2Uninstall Wazuh AgentMSI script or Settings โ†’ Appsโ˜
3Delete agent folderRemove-Item C:\Program Files (x86)\ossec-agentโ˜
4Power off Wazuh VMVirtualBox โ†’ Close โ†’ Power Offโ˜
5Delete Wazuh VMVirtualBox โ†’ Remove โ†’ Delete all filesโ˜
6Verify clean stateGet-Service + Test-Path return empty / Falseโ˜
7Remove Kali tools (optional)sudo apt remove nmap hydraโ˜
๐Ÿ”
Ready to run again for class

The OVA file is still on your disk. For the next session: re-import it into VirtualBox (Step 2โ€“5 of Installation), reinstall the agent pointing to the new VM IP, and you are back to a fresh lab in under 10 minutes.