Wanna_Cry_Ransomware_Generic
YARA-2017-12867
Critical
general
Active
Detects WannaCry Ransomware on Disk and in Virtual Page
Wanna_Cry_Ransomware_Generic.yar
Valid Syntax
rule Wanna_Cry_Ransomware_Generic {
meta:
description = "Detects WannaCry Ransomware on Disk and in Virtual Page"
author = "US-CERT Code Analysis Team"
reference = "not set"
date = "2017/05/12"
hash0 = "4DA1F312A214C07143ABEEAFB695D904"
strings:
$s0 = {410044004D0049004E0024}
$s1 = "WannaDecryptor"
$s2 = "WANNACRY"
$s3 = "Microsoft Enhanced RSA and AES Cryptographic"
$s4 = "PKS"
$s5 = "StartTask"
$s6 = "wcry@123"
$s7 = {2F6600002F72}
$s8 = "unzip 0.15 Copyrigh"
$s9 = "Global\\WINDOWS_TASKOSHT_MUTEX"
$s10 = "Global\\WINDOWS_TASKCST_MUTEX"
$s11 = {7461736B736368652E657865000000005461736B5374617274000000742E776E7279000069636163}
$s12 = {6C73202E202F6772616E742045766572796F6E653A46202F54202F43202F5100617474726962202B68}
$s13 = "WNcry@2ol7"
$s14 = "wcry@123"
$s15 = "Global\\MsWinZonesCacheCounterMutexA"
condition:
$s0 and $s1 and $s2 and $s3 or $s4 and $s5 and $s6 and $s7 or $s8 and $s9 and $s10 or $s11 and $s12 or $s13 or $s14 or $s15
}
/*The following Yara ruleset is under the GNU-GPLv2 license (http://www.gnu.org/licenses/gpl-2.0.html) and open to any user or organization, as long as you use it under this license.*/
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
}
Rule Metadata
description
Detects WannaCry Ransomware on Disk and in Virtual Page
author
US-CERT Code Analysis Team
reference
not set
date
2017/05/12
hash0
4DA1F312A214C07143ABEEAFB695D904
String Definitions
{"name":"$s0","value":"{410044004D0049004E0024}"}
{"name":"$s1","value":"\"WannaDecryptor\""}
{"name":"$s2","value":"\"WANNACRY\""}
{"name":"$s3","value":"\"Microsoft Enhanced RSA and AES Cryptographic\""}
{"name":"$s4","value":"\"PKS\""}
{"name":"$s5","value":"\"StartTask\""}
{"name":"$s6","value":"\"wcry@123\""}
{"name":"$s7","value":"{2F6600002F72}"}
{"name":"$s8","value":"\"unzip 0.15 Copyrigh\""}
{"name":"$s9","value":"\"Global\\\\WINDOWS_TASKOSHT_MUTEX\""}
{"name":"$s10","value":"\"Global\\\\WINDOWS_TASKCST_MUTEX\""}
{"name":"$s11","value":"{7461736B736368652E657865000000005461736B5374617274000000742E776E7279000069636163}"}
{"name":"$s12","value":"{6C73202E202F6772616E742045766572796F6E653A46202F54202F43202F5100617474726962202B68}"}
{"name":"$s13","value":"\"WNcry@2ol7\""}
{"name":"$s14","value":"\"wcry@123\""}
{"name":"$s15","value":"\"Global\\\\MsWinZonesCacheCounterMutexA\""}
Threat Analysis
This YARA rule is designed to detect general threats.
Severity Level: Critical
The rule uses pattern matching to identify specific byte sequences, strings, or behavioral patterns associated with malicious activity.
Detection Capabilities
- File-based detection for executables and documents
- Memory scanning for running processes
- Network traffic analysis support
Command Line Usage
# Scan a single file yara Wanna_Cry_Ransomware_Generic.yar /path/to/suspicious/file # Scan a directory recursively yara -r Wanna_Cry_Ransomware_Generic.yar /path/to/directory/ # Scan with metadata output yara -m Wanna_Cry_Ransomware_Generic.yar target_file # Scan process memory (Linux) yara Wanna_Cry_Ransomware_Generic.yar /proc/[pid]/exe
Integration Examples
Python (yara-python)
import yara
rules = yara.compile(filepath='Wanna_Cry_Ransomware_Generic.yar')
matches = rules.match('/path/to/file')
ClamAV Integration
clamscan --yara-rules=Wanna_Cry_Ransomware_Generic.yar /path/to/scan
Rule Information
YARA ID
YARA-2017-12867
Author
Repository
Created
August 19, 2025
Last Updated
August 19, 2025
Last Imported
Never
Threat Intelligence
Risk Level
Critical
Category
general
Detection Confidence
Analysis Pending
False Positive Rate
Not Available
Last Seen in Wild
No Data
Related Rules
Export Options
Similar Rules in general
YARA-2023-0001
CRI
Detect_Mimic_Ransomware
Detect_Mimic_Ransomware
YARA-2023-0002
MED
SystemBC_malware
Detect_SystemBC
YARA-2023-0003
MED
detect_catB
detect_CatB_ransomware
YARA-2022-0001
MED
detect_Typhon_Stealer
detect_Typhon_Stealer
YARA-2023-0004
MED
Nosu_stealer
Detect_Nosu_stealer
YARA-2022-0002
MED
detect_Lumma_stealer
detect_Lumma_stealer
YARA-2022-0003
MED
detect_StrelaStealer
detect_StrelaStealer
YARA-2022-0004
MED
detect_silence_Downloader
detect_silence_Downloader