This hunt targets adversaries leveraging the EternalBlue vulnerability (MS17-010) to propagate laterally across unpatched Windows systems while simultaneously deploying WannaCry ransomware payloads. Proactively hunting for this behavior in Azure Sentinel is critical because even low-severity alerts can indicate an active, self-replicating worm capable of rapid network-wide encryption before traditional endpoint defenses trigger high-priority alarms.
rule MS17_010_WanaCry_worm {
meta:
description = "Worm exploiting MS17-010 and dropping WannaCry Ransomware"
author = "Felipe Molina (@felmoltor)"
reference = "https://www.exploit-db.com/exploits/41987/"
date = "2017/05/12"
strings:
$ms17010_str1="PC NETWORK PROGRAM 1.0"
$ms17010_str2="LANMAN1.0"
$ms17010_str3="Windows for Workgroups 3.1a"
$ms17010_str4="__TREEID__PLACEHOLDER__"
$ms17010_str5="__USERID__PLACEHOLDER__"
$wannacry_payload_substr1 = "h6agLCqPqVyXi2VSQ8O6Yb9ijBX54j"
$wannacry_payload_substr2 = "h54WfF9cGigWFEx92bzmOd0UOaZlM"
$wannacry_payload_substr3 = "tpGFEoLOU6+5I78Toh/nHs/RAP"
condition:
all of them
}
This YARA rule can be deployed in the following contexts:
This rule contains 8 string patterns in its detection logic.
Here are 5 specific false positive scenarios for the Worm exploiting MS17-010 and dropping WannaCry Ransomware detection rule, tailored for an enterprise environment:
Scheduled Endpoint Protection Scans on Patched Servers
C:\Windows\System32 directory. During these scans, the agent may simulate file creation and network socket binding activities that mimic the initial propagation behavior of the MS17-010 worm (specifically SMB port 445 traffic) without actually executing malicious payloads.NT SERVICE\DefenderSvc or specific CrowdStrike hostnames) where the destination IP is an internal management server, and the process hash matches a verified “Good” signature in the threat intelligence feed.Automated Patch Management Deployment via WSUS/SCCM
wuauserv service establishing SMB connections to distribute update packages and temporarily creating files in the %TEMP% directory, which can trigger the “dropping ransomware” logic if the file metadata resembles a dropped executable.ccmexec.exe or wuauclt.exe and the destination port is 445 (SMB), provided the event timestamp falls within the defined maintenance window (e.g., Sundays between 02:00–0