Alerts to Answers
Lab 4 — SIEM Ransomware Investigation
Ransomware is fast, loud, and unforgiving — which makes it a perfect teacher. In this lab you configure File Integrity Monitoring (FIM), trigger a completely benign ransomware simulation on WIN11, and watch a storm of file changes become an early-warning signal. The analyst bias here shifts: when ransomware indicators appear, you lean toward fast containment.
Introduction
Objective
Detect the signature behavior of ransomware — rapid, mass file modification — using Wazuh File Integrity Monitoring, then run the full analyst workflow (discovery, qualification, investigation, response, recovery) against a controlled, harmless simulation.
Overview
Ransomware encrypts a victim's files and demands payment. Operationally it does something very detectable first: it accesses many files in quick succession, rewrites them, renames them to an unusual extension, and often drops a ransom note. That burst of file-system activity is exactly what FIM is built to see.
Key indicators an analyst hunts for:
Rapid file-modification spikes (FIM alerts clustering in seconds).
Unusual process execution (an unexpected binary touching many files).
New files with suspicious extensions (.locked, .crypt, random strings).
A ransom note (README/HELP/RESTORE in .txt or .html).
A sudden rise in alert severity and frequency.
CAUTION — This simulation is safe — and stays in one folder
The generator in this lab does not encrypt anything. It creates decoy files in a single dedicated folder, rewrites and renames them to .locked, and drops a fake note. Nothing outside C:\LabData\Vault is touched, and every change is reversible. Never point a real encryption tool at a lab machine.
Learning Outcomes
By the end of this lab you will be able to:
Configure Wazuh FIM (syscheck) to monitor a directory in real time.
Recognize the FIM alert pattern that ransomware produces.
Qualify ransomware indicators using an explicit triage decision framework.
Correlate file changes with the responsible user, host, and (if available) process.
Choose containment-first response actions appropriate to a high-impact threat.
Recommend recovery and detection improvements.
Lab Environment
| System | Hostname | Agent Name | IP Address | Role |
|---|---|---|---|---|
| Wazuh Server 4.14.5 | WAZUH-SRV | — | 192.168.1.30 | SIEM — Manager, Indexer, Dashboard |
| Windows 11 Pro | WIN11 | win11 | 192.168.1.40 | Ransomware target — Sysmon + FIM + Wazuh Agent |
Key Terms
| Key Term | Description |
|---|---|
| File Integrity Monitoring (FIM) | Wazuh's syscheck capability: watches directories and alerts when files are added, modified, or deleted. |
| Realtime Monitoring | FIM mode that reports changes immediately rather than on a scheduled scan. |
| Ransom Note | A file (often README/RESTORE) left by ransomware with payment instructions — a high-confidence indicator. |
| Indicator of Compromise (IOC) | An observable tied to malicious activity (extension, filename, path, hash). |
| Containment | Stopping spread — network isolation, disabling accounts, killing processes. |
| Forensic Preservation | Capturing evidence (logs, memory, disk) before remediation destroys it. |
| syscheck | The Wazuh module that implements FIM; its alerts carry the syscheck rule group. |
MITRE ATT&CK Context
| Lab Activity | ATT&CK Technique | Analyst Signal |
|---|---|---|
| Mass file rewrite + rename to .locked | T1486 — Data Encrypted for Impact | FIM modification/creation spike |
| Ransom note dropped in the target folder | T1486 (associated) | New file matching a note pattern |
| Files deleted / replaced | T1485 — Data Destruction (behavioral overlap) | FIM deletion events |
Activity 1 — Configure File Integrity Monitoring
WHY THIS MATTERS
FIM is off for most paths by default because watching everything is noisy. You deliberately scope it to a folder that matters and put it in realtime mode so ransomware's speed works against it — the faster it changes files, the louder the signal.
Step 1 — Create the monitored folder on WIN11
::: {custom-style="CodeLabel"} WIN11 · PowerShell :::
New-Item -ItemType Directory -Force -Path "C:\LabData\Vault" | Out-Null
Write-Host "Created C:\LabData\Vault"Step 2 — Tell the Wazuh agent to watch it in realtime
On WIN11, edit the agent config at C:\Program Files (x86)\ossec-agent\ossec.conf. Inside the
::: {custom-style="CodeLabel"} WIN11 · PowerShell :::
<directories realtime="yes" report_changes="yes" check_all="yes">C:\LabData\Vault</directories>COMMAND BREAKDOWN — What each attribute does
realtime="yes" — report changes the instant they happen, not on the next scheduled scan.
report_changes="yes" — include what changed inside the file, not just that it changed.
check_all="yes" — track size, permissions, owner, and content hashes (MD5/SHA1/SHA256).
The element value is the folder to watch.
Step 3 — Restart the agent so the change takes effect
::: {custom-style="CodeLabel"} WIN11 · PowerShell :::
Restart-Service -Name WazuhSvc
Get-Service WazuhSvcCHECKPOINT
::: {custom-style="CodeLabel"} WIN11 · PowerShell :::
Get-Service WazuhSvcThe service should report Running. FIM is now watching C:\LabData\Vault in realtime. Confirm the agent is connected in the Dashboard under Agents (win11 = Active).
Activity 2 — Establish the FIM Baseline
WHY THIS MATTERS
A quiet folder is your control condition. Seeing zero FIM activity now means every alert in Activity 3 is unambiguously caused by the simulation — clean cause and effect.
In Discover (index wazuh-alerts-*, Last 15 minutes), run: agent.name:"win11" and rule.groups:"syscheck".
Expect little or nothing. That silence is your baseline.
CHECKPOINT
The syscheck query is quiet. Baseline confirmed — the folder is calm before the storm.
Activity 3 — Trigger the Ransomware Simulation
WHY THIS MATTERS
Detection engineering needs ground truth. By producing the exact behavior of ransomware — safely — you can confirm FIM catches it and learn the alert signature you will recognize in the wild.
On WIN11, run this benign simulator in PowerShell. Read the breakdown before running it.
::: {custom-style="CodeLabel"} WIN11 · PowerShell :::
$vault = "C:\LabData\Vault"
# 1) Seed 30 "victim" documents
1..30 | ForEach-Object {
Set-Content -Path "$vault\report_$_.docx" -Value "Quarterly data $_"
}
Start-Sleep -Seconds 2
# 2) Simulate encryption: rewrite + rename each to .locked (no real crypto)
Get-ChildItem "$vault\*.docx" | ForEach-Object {
Set-Content -Path $_.FullName -Value "ENCRYPTED_PLACEHOLDER" # modify
Rename-Item -Path $_.FullName -NewName ($_.BaseName + ".locked") # rename
}
# 3) Drop a ransom note
Set-Content -Path "$vault\README_RESTORE_FILES.txt" `
-Value "Your files are encrypted. (This is a lab simulation.)"
Write-Host "Simulation complete: 30 files locked + ransom note dropped."COMMAND BREAKDOWN — What this simulator does
Seed — creates 30 ordinary .docx files so there is something to "encrypt."
Modify — Set-Content overwrites each file's contents (FIM sees a modification).
Rename — Rename-Item changes each extension to .locked (FIM sees a deletion of the old name and creation of the new one — the classic ransomware fingerprint).
Note — drops README_RESTORE_FILES.txt, the high-confidence ransom-note indicator.
No encryption library is called; the word "ENCRYPTED_PLACEHOLDER" is literal text. It is fully reversible.
CHECKPOINT
::: {custom-style="CodeLabel"} WIN11 · PowerShell :::
C:\LabData\Vault now contains 30 .locked files and a README note. On to detection.Activity 4 — Discovery
WHY THIS MATTERS
Ransomware manifests as high-volume, high-severity clusters. Learning to focus on the pattern — the spike — rather than any single file event is what lets you catch it in the first minute instead of the first hour.
In Discover, Last 15 minutes, run: agent.name:"win11" and rule.groups:"syscheck".
Watch the histogram: a dense spike of file events appears where before there was silence.
Expand a few alerts and read the decoded fields.
Map what you see to FIM's three event types:
| FIM Event | Typical Rule | What Caused It Here |
|---|---|---|
| File added | 554 — File added to the system | The 30 seed files and the .locked renames + the note |
| File modified | 550 — Integrity checksum changed | The Set-Content overwrite of each file |
| File deleted | 553 — File deleted | The original .docx names disappearing on rename |
NOTE — Confirm your own rule IDs
Default FIM rules are commonly 550 (modified), 553 (deleted), and 554 (added), grouped under syscheck. Record the actual IDs your environment shows — verifying against your own data is the habit this book keeps reinforcing.
CHECKPOINT
A tight cluster of dozens of syscheck alerts sits in the last few minutes, versus the flat baseline from Activity 2. That density is the ransomware signature.
Activity 5 — Qualify the Threat
WHY THIS MATTERS
Not every alert is an incident, but ransomware is high-impact and high-likelihood once indicators appear — so analysts operate with a bias toward early containment. Delay means data loss. The framework below keeps that urgency disciplined rather than panicked.
Grade what you found against the triage framework:
| Evidence Level | Examples (what you'd see) | Response Posture |
|---|---|---|
| Confirmed ransomware — act now | Files renamed to .locked/.crypt, ransom note present, mass modification | Isolate, trigger IR, preserve evidence, notify |
| Pre-ransomware activity — investigate + contain | Privilege escalation, lateral movement, credential dumping, AV/EDR tampering | Investigate immediately, contain suspect hosts, hunt |
| Weak / indirect signal — monitor + validate | Generic malware alert, unopened attachment, threat-intel mention only | Validate fidelity, correlate, raise monitoring — no full IR yet |
Your simulation lands squarely in row 1: .locked extensions, a ransom note, and a mass-modification spike. That combination is a confirmed-indicator scenario.
NOTE — Practical rule of thumb
If encryption or a ransom note exists → escalate immediately. If behavior matches a ransomware playbook → treat as imminent. If uncertain → investigate quickly; do not ignore.
Activity 6 — Investigate & Correlate
WHY THIS MATTERS
Confirming ransomware is only the start — you must scope it. Which user, which host, which process, which paths? Scoping determines what you isolate and how far the damage reaches.
Extract key entities from the alerts: the user context, the agent/host (win11), and the file paths (
C:\LabData\Vault).Check suspicious-path patterns ransomware favors:
C:\Users\Public\,C:\Windows\Temp\,C:\ProgramData\, ...\AppData\...\Temp\.If Sysmon process telemetry is present, pivot to find the process behind the changes: agent.name:"win11" and data.win.system.eventID:"11" (Sysmon FileCreate) around the same timestamps.
Build a timeline: seed → modify → rename → note, with first and last timestamps (this is your MTTD input).
NOTE — Network vs. host — where each helps
FIM (host) proves what happened to the files. In a real incident you would also check network telemetry for C2 beaconing or exfiltration before the encryption. Correlating both is how you tell "encryption only" from "steal-then-encrypt."
Activity 7 — Respond (Containment First)
WHY THIS MATTERS
With confirmed ransomware, the cost of waiting is measured in encrypted files per second. Containment comes before tidy investigation — you stop the bleeding, then finish the analysis on a frozen scene.
| Action | Purpose | Order |
|---|---|---|
| Isolate WIN11 from the network | Stop spread / block C2 and lateral movement | 1 — immediate |
| Preserve evidence (logs, affected files, memory) | Enable forensics and possible recovery | 2 — before remediation |
| Trigger the incident-response plan | Bring in the right people and process | 3 — in parallel |
| Identify & kill the responsible process | End active encryption | 4 — once identified |
| Notify stakeholders | Legal, leadership, affected users | 5 — per policy |
NOTE — Optional — Active Response
Wazuh can automate containment. A conceptual design: a rule matching the FIM spike triggers an Active Response command that disables the host's network adapter or isolates it. You built the Active Response mechanics in Lab 8; here you decide whether automating this is wise (speed vs. the risk of auto-isolating on a false positive).
Activity 8 — Recovery & Lessons Learned
WHY THIS MATTERS
Recovery restores service and hardens against recurrence. The best incident output is a control that prevents the next one — or catches it faster.
Root cause (in a real incident): initial access vector — phishing, exposed RDP, unpatched service? State how you would determine it.
Recovery: restore from known-good backups; verify backups were not also encrypted (a key ransomware objective).
Detection improvement: propose a correlation rule that fires on N file modifications within T seconds on a monitored path — turning the spike itself into a single high-severity alert.
Compute MTTD from your timeline: first FIM event → your detection. Discuss a realistic production target.
Cleanup
Reset the lab folder when finished:
::: {custom-style="CodeLabel"} WIN11 · PowerShell :::
Remove-Item "C:\LabData\Vault\*" -Force
Write-Host "Vault cleared."Knowledge Check
Which single FIM behavior — added, modified, or deleted — most strongly signals encryption-in-progress, and why does a rename generate two of them?
The simulator never calls an encryption library. Why is it still a faithful detection test?
Your triage framework puts this scenario in "act now." Name the two indicators that place it there.
Why is containment ordered before completing the investigation for ransomware, unlike the auth anomaly in Lab 3?
Backups exist, so is ransomware "not a problem"? Explain.
Answer Key
| Q | Answer |
|---|---|
| 1 | A mass of modifications clustered in seconds signals encryption. A rename produces a deletion (old name) plus a creation (new .locked name), so renaming 30 files yields ~60 add/delete events — a hallmark burst. |
| 2 | FIM detects file-system behavior (modify/rename/create), not cryptography. Reproducing that behavior exercises the exact detection path real ransomware would trip. |
| 3 | Files renamed to a suspicious extension (.locked) AND a ransom note present — two confirmed indicators, alongside the mass-modification spike. |
| 4 | Ransomware causes ongoing, escalating damage every second; the auth anomaly did not. High-impact/active threats justify containment-first to stop the loss, then investigate. |
| 5 | No. Attackers target backups first, exfiltrate data for extortion, and cause downtime regardless. Backups aid recovery but do not neutralize the threat. |
Discussion Questions
FIM realtime mode is powerful but noisy. Which directories are worth watching in a real enterprise, and which would drown you in false positives?
The lab detected ransomware after encryption began. What earlier (pre-ransomware) indicators from the triage framework would give you more warning, and where would you look for them?
Automating containment via Active Response is fast but risky. Describe a false positive that would make auto-isolation harmful, and how you would guard against it.
You correlated FIM with Sysmon to find the process. What could an attacker do to make that process-level correlation fail?
What Comes Next
You have now completed the four foundational labs: familiarization and first detection (Lab 1), the full analytic workflow (Lab 2), the threat lifecycle (Lab 3), and a high-impact FIM investigation (Lab 4). From here the book moves to your custom investigation series — Lab 5 (Sysmon), Lab 6 (Emerging Threats), Lab 7 (Threat Intelligence), and Lab 8 (Capstone) — where these workflows deepen against progressively harder telemetry.