← Back to SOC feed Coverage →

Detects WannaCry Ransomware VBS

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 the execution of specific Visual Basic Script (VBS) files associated with the initial propagation and payload delivery stages of the WannaCry ransomware campaign. Proactively hunting for these artifacts in Azure Sentinel is critical because early identification of this legacy threat vector allows security teams to validate endpoint hardening measures and prevent lateral movement before encryption begins, even when automated alerts are classified as low severity.

YARA Rule

rule WannCry_m_vbs {
   meta:
      description = "Detects WannaCry Ransomware VBS"
      author = "Florian Roth"
      reference = "https://goo.gl/HG2j5T"
      date = "2017-05-12"
      hash1 = "51432d3196d9b78bdc9867a77d601caffd4adaa66dcac944a5ba0b3112bbea3b"
   strings:
      $x1 = ".TargetPath = \"C:\\@" ascii
      $x2 = ".CreateShortcut(\"C:\\@" ascii
      $s3 = " = WScript.CreateObject(\"WScript.Shell\")" ascii
   condition:
      ( uint16(0) == 0x4553 and filesize < 1KB and all of them )
}

Deployment Notes

This YARA rule can be deployed in the following contexts:

This rule contains 3 string patterns in its detection logic.

References

False Positive Guidance

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

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