Mahesh Harripaul
Home Experience Blog Services Contact
← Back to blog
YARAWazuhFIMActive ResponseMalware detection

Malware Detection Using YARA Integration

September 15, 2026 · Mahesh Harripaul

4
Departments integrated
12
Alert level
1
Critical issue resolved

YARA · Wazuh FIM · Active Response · pyinstaller · MITRE TA0002 Execution

What we set out to do:

Every time a file lands on a monitored endpoint, we wanted it automatically checked against a database of known malware signatures — without anyone having to manually run a scan. If something suspicious is found, an alert fires in the SIEM immediately.

The Departments Involved

Think of this as three departments working together:

What Was Built

The Problem We Had to Solve

The first attempt used a .bat file as the scanning engine. A .bat file is like a handwritten note — simple, but limited in how it receives information from other systems. Wazuh's communication system on Windows couldn't reliably hand off the file details to it. The call was going out but never connecting.

The fix was converting the scanning logic into a proper .exe executable using a tool called pyinstaller. An .exe is a fully packaged application — it speaks the same language as Wazuh's active response system natively. Once we made that change, the communication worked immediately.

The Flow in Action

New file lands in Downloads or Temp → FIM (Security Guard) detects it in real time → Active Response (Communication System) routes the file details to YARA → yara-ar.exe (YARA's phone) receives the details and passes the file to YARA → YARA checks the file against malware.yar (the threat database) → Match found: result logged as "wazuh-yara: error YARA_RULE - Mimikatz" → Log Collector carries the result back to the Wazuh manager → Decoder reads the result and confirms it's a YARA match → Rule 108001 fires — Level 12 alert generated → Alert visible on Wazuh dashboard

Confirmed Working

What This Means in Practice

This integration adds a content-based detection layer on top of the existing behaviour-based detection rules. The existing rules detect what processes are running and what they're doing. YARA detects what's inside a file the moment it appears on the machine — before it even runs. Together they cover two different angles of the same threat.

Previous: LSASS Credential Dumping: T1003.001 All posts →