Detection

    Ransomware Detection with Wazuh: Rules, FIM and Active Response (2026 Guide)

    Detect ransomware early with Wazuh: file integrity monitoring, mass file change rules, shadow copy deletion alerts, Sysmon events and active response to isolate infected hosts.

    WazuGuardix Team November 9, 2026 16 min read
    Share:LinkedInWhatsAppX

    Verified on

    Wazuh v4.14.10 (latest stable)

    Tested OS

    Windows Server 2022 and Windows 11

    Architecture

    Wazuh 4.x deployment

    Reading time

    16 min read

    Modern ransomware follows a predictable chain: initial access, privilege escalation, disabling backups, then mass encryption. Each stage creates signals Wazuh can detect. The goal is to alert and contain before encryption spreads.

    Key ransomware signals

    • Deletion of Volume Shadow Copies (vssadmin, wmic shadowcopy, wbadmin).
    • Sudden mass file modifications or renames to unusual extensions.
    • Ransom note files appearing across many folders.
    • Security tools or Windows Defender being disabled.

    Enable real time FIM on user data

    xml
    <syscheck>  <directories realtime="yes" check_all="yes">C:\Users</directories>  <directories realtime="yes" check_all="yes">C:\Shares</directories></syscheck>

    Alert on shadow copy deletion

    With Sysmon forwarding process creation events (Event ID 1), add a custom rule in /var/ossec/etc/rules/local_rules.xml:

    xml
    <group name="ransomware,">  <rule id="100600" level="14">    <if_group>sysmon_event1</if_group>    <field name="win.eventdata.commandLine" type="pcre2">(?i)vssadmin.+delete.+shadows|wmic.+shadowcopy.+delete|wbadmin.+delete</field>    <description>Possible ransomware: shadow copy deletion</description>    <mitre><id>T1490</id></mitre>  </rule></group>

    Detect mass file changes

    xml
    <rule id="100601" level="13" frequency="50" timeframe="60">  <if_matched_sid>550</if_matched_sid>  <same_field>agent.id</same_field>  <description>Possible ransomware: mass file modification on one host</description>  <mitre><id>T1486</id></mitre></rule>

    Note

    Tune frequency and timeframe to your environment. Backup jobs and software updates can trigger false positives, so test in a pilot group first.

    Contain automatically with active response

    Link high severity ransomware rules to an active response script that isolates the host or kills the process, so containment happens in seconds instead of waiting for an analyst.

    xml
    <active-response>  <command>netsh</command>  <location>local</location>  <rules_id>100600,100601</rules_id></active-response>

    Ransomware readiness checklist

    1. 1Sysmon deployed on all Windows endpoints and forwarding to Wazuh.
    2. 2Real time FIM on user folders and file shares.
    3. 3Custom rules for shadow copy deletion and mass file changes.
    4. 4Active response tested on a lab host.
    5. 5Offline, immutable backups verified monthly.

    Deploy Sysmon and forward its events

    Most ransomware rules depend on process creation data, which Windows does not log well by default. Install Sysmon with a community config on every Windows endpoint:

    powershell
    $Invoke-WebRequest https://download.sysinternals.com/files/Sysmon.zip -OutFile Sysmon.zip$Expand-Archive Sysmon.zip -DestinationPath C:\Sysmon$Invoke-WebRequest https://raw.githubusercontent.com/SwiftOnSecurity/sysmon-config/master/sysmonconfig-export.xml -OutFile C:\Sysmon\sysmonconfig.xml$C:\Sysmon\Sysmon64.exe -accepteula -i C:\Sysmon\sysmonconfig.xml

    Then tell the Wazuh agent to read the Sysmon channel. Add this to C:\Program Files (x86)\ossec-agent\ossec.conf, or push it centrally through agent groups:

    xml
    <localfile>  <location>Microsoft-Windows-Sysmon/Operational</location>  <log_format>eventchannel</log_format></localfile>

    Extra high value detection rules

    Add these to /var/ossec/etc/rules/local_rules.xml on the manager. Each targets a step attackers take right before encryption:

    xml
    <group name="ransomware,">  <rule id="100602" level="13">    <if_group>sysmon_event1</if_group>    <field name="win.eventdata.commandLine" type="pcre2">(?i)bcdedit.+(recoveryenabled.+no|bootstatuspolicy.+ignoreallfailures)</field>    <description>Possible ransomware: Windows recovery disabled</description>    <mitre><id>T1490</id></mitre>  </rule>   <rule id="100603" level="12">    <if_group>sysmon_event1</if_group>    <field name="win.eventdata.commandLine" type="pcre2">(?i)Set-MpPreference.+-Disable(RealtimeMonitoring|BehaviorMonitoring)\s+\$?true</field>    <description>Defender protection disabled by command line</description>    <mitre><id>T1562.001</id></mitre>  </rule>   <rule id="100604" level="12">    <if_group>sysmon_event1</if_group>    <field name="win.eventdata.commandLine" type="pcre2">(?i)wevtutil.+cl\s</field>    <description>Event logs cleared, common before ransomware</description>    <mitre><id>T1070.001</id></mitre>  </rule>   <rule id="100605" level="15">    <if_sid>550,554</if_sid>    <field name="file" type="pcre2">(?i)canary</field>    <description>Canary file modified: likely ransomware encryption in progress</description>    <mitre><id>T1486</id></mitre>  </rule></group>

    Use canary files for near zero false positives

    Place decoy files that no person or backup job should ever touch, for example C:\Shares\000_canary.docx. Any change to them is almost certainly encryption, which is why rule 100605 is level 15. Make sure the folder is covered by realtime FIM, then run a quick check after placing them:

    bash
    $sudo /var/ossec/bin/agent_control -i <agent-id>$sudo grep canary /var/ossec/logs/alerts/alerts.json | tail

    A complete isolation response

    Wazuh ships a netsh active response that blocks the attacker IP on Windows. For ransomware you usually want to isolate the whole host instead. Define the command on the manager:

    xml
    <command>  <name>isolate-host</name>  <executable>isolate-host.cmd</executable>  <timeout_allowed>yes</timeout_allowed></command> <active-response>  <command>isolate-host</command>  <location>local</location>  <rules_id>100600,100602,100605</rules_id>  <timeout>3600</timeout></active-response>

    Save the script on each endpoint as C:\Program Files (x86)\ossec-agent\active-response\bin\isolate-host.cmd. It blocks all traffic except to the Wazuh manager, so you keep visibility:

    bat
    @echo offset MANAGER=10.0.0.5netsh advfirewall set allprofiles firewallpolicy blockinbound,blockoutboundnetsh advfirewall firewall add rule name="WazuhOut" dir=out action=allow remoteip=%MANAGER%netsh advfirewall firewall add rule name="WazuhIn" dir=in action=allow remoteip=%MANAGER%echo %date% %time% host isolated >> "C:\Program Files (x86)\ossec-agent\active-response\active-responses.log"

    Note

    Test isolation on a lab machine first. Isolating a domain controller or a critical server automatically can cause an outage, so exclude those hosts and route their alerts to an analyst instead.

    Safely test your detections

    Never test with real ransomware. These harmless commands trigger the rules without deleting anything, because the shadow copy command targets a volume that has no copies on a lab VM:

    powershell
    # triggers 100600 (run on a LAB machine only)$vssadmin delete shadows /for=Z: /quiet# triggers 100605$Add-Content C:\Shares\000_canary.docx "test"

    Within seconds you should see the alerts in Threat Hunting and, if active response is enabled, the host losing network access except to the manager.

    Keeping false positives low

    • Exclude backup software processes from the mass change rule using a child rule at level 0.
    • Exclude Windows Update and software deployment folders from FIM.
    • Start the mass change rule at frequency 100 and lower it after a week of observation.
    • Review every level 12+ alert for two weeks before turning on automatic isolation.

    Frequently asked questions

    Can Wazuh stop ransomware completely?

    No single tool can. Wazuh detects the early stages and can contain a host automatically, which limits damage. Offline backups and patching remain essential.

    Does this work on Linux servers?

    Yes. FIM, canary files and the mass change rule work the same on Linux. Use auditd or the Wazuh who-data option instead of Sysmon.

    Our 24/7 SOC deploys these detections, tunes them for your environment and responds around the clock. Start with a 30-Day PoC to see them working on your own endpoints.

    Your deployment checklist

    0%

    Tick each step as you finish it. Your progress is saved on this device, so you can come back tomorrow and continue.

    Next in Detection series: part 2 of 2

    Wazuh MITRE ATT&CK Mapping (Built-in Coverage)

    Every Wazuh rule ships with MITRE ATT&CK metadata. Use the dashboard module to track coverage and threat actor TTPs.

    Read next (5 min read)

    Official reference

    Commands and configuration in this guide are based on the official Wazuh documentation. For the canonical source, see:

    WazuhRansomwareFIMActive ResponseSysmon

    Need someone watching these alerts 24/7?

    Our managed SOC runs Wazuh for you with analyst triage, threat hunting and incident response around the clock.