← Back to SOC feed Coverage →

Detects WannaCry Ransomware BATCH File

yara LOW Yara-Rules
communityransomware
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Yara-Rules →
Retrieved: 2026-07-11T11:00:01Z · Confidence: medium

Hunt Hypothesis

This detection rule identifies adversary behavior consistent with the initial execution phase of WannaCry ransomware by monitoring for suspicious Windows Batch file activities that often precede lateral movement and encryption. Proactively hunting for these artifacts in Azure Sentinel is critical because early identification of such batch scripts allows SOC teams to isolate compromised endpoints before the ransomware propagates across the network, even when individual events are flagged with low severity.

YARA Rule

rule WannCry_BAT {
   meta:
      description = "Detects WannaCry Ransomware BATCH File"
      author = "Florian Roth"
      reference = "https://goo.gl/HG2j5T"
      date = "2017-05-12"
      hash1 = "f01b7f52e3cb64f01ddc248eb6ae871775ef7cb4297eba5d230d0345af9a5077"
   strings:
      $s1 = "@.exe\">> m.vbs" ascii
      $s2 = "cscript.exe //nologo m.vbs" fullword ascii
      $s3 = "echo SET ow = WScript.CreateObject(\"WScript.Shell\")> " ascii
      $s4 = "echo om.Save>> m.vbs" fullword ascii
   condition:
      ( uint16(0) == 0x6540 and filesize < 1KB and 1 of them )
}

Deployment Notes

This YARA rule can be deployed in the following contexts:

This rule contains 4 string patterns in its detection logic.

References

False Positive Guidance

Here are 5 specific false positive scenarios for the Detects WannaCry Ransomware BATCH File rule in an enterprise environment:

Original source: https://github.com/Yara-Rules/rules/blob/main/malware/RANSOM_MS17-010_Wannacrypt.yar