Skip to content

YARA · Trellix Advanced Research Center

TRELLIX_ARC_Ransom_Egregor

Detect Egregor ransomware

MalwareRansom/EgregorTrellix Advanced Research CenterApache License 2.0Compiles with YARA-X
Author
Thomas Roccia | McAfee ATR team
Date
2020-10-28
Score / Quality
75 / 70

What this rule detects

Detect Egregor ransomware

Associated malware family: Ransom/Egregor.

Targets: Windows PE.

It defines 5 patterns (5 text, 0 hex, 0 regex). YARA modules used: pe, hash.

Summary generated from the rule's metadata and condition.

Rule source

Includes the imports needed to compile it on its own.

ransom-egregor.yarApache License 2.0
import "pe"
import "hash"

rule TRELLIX_ARC_Ransom_Egregor : RANSOMWARE FILE
{
	meta:
		description = "Detect Egregor ransomware"
		author = "Thomas Roccia | McAfee ATR team"
		id = "b9f1a712-c168-5e0f-8b9e-cb03a6c43fc3"
		date = "2020-10-28"
		modified = "2020-10-28"
		reference = "https://bazaar.abuse.ch/sample/004a2dc3ec7b98fa7fe6ae9c23a8b051ec30bcfcd2bc387c440c07ff5180fe9a/"
		source_url = "https://github.com/advanced-threat-research/Yara-Rules//blob/1919562a59f190bda60c982424f6a24c542ee3e0/ransomware/RANSOM_egregor.yar#L4-L31"
		license_url = "https://github.com/advanced-threat-research/Yara-Rules//blob/1919562a59f190bda60c982424f6a24c542ee3e0/LICENSE"
		hash = "5f9fcbdf7ad86583eb2bbcaa5741d88a"
		logic_hash = "8077c656eed0b1633da54f8d017d4eff122f2f4e486c4e1af6f6434ea33c0675"
		score = 75
		quality = 70
		tags = "RANSOMWARE, FILE"
		rule_version = "v1"
		malware_type = "ransomware"
		malware_family = "Ransom/Egregor"
		actor_type = "Cybercrime"
		actor_group = "egregor"

	strings:
		$p1 = "ewdk.pdb" fullword ascii
		$p2 = "testbuild.pdb" fullword ascii
		$s1 = "M:\\" nocase ascii
		$s2 = "1z1M9U9" fullword wide
		$s3 = "C:\\Logmein\\{888-8888-9999}\\Logmein.log" fullword wide

	condition:
		uint16( 0 ) == 0x5a4d and filesize < 2000KB and hash.sha256 ( pe.rich_signature.clear_data ) == "b030ed1a7ca222a0923a59f321be7e55b8d0fc24c1134df1ba775bcf0994c79c" or ( pe.sections [ 4 ] . name == ".gfids" and pe.sections [ 5 ] . name == ".00cfg" ) and ( any of ( $p* ) or 2 of ( $s* ) )
}

Strings (5 patterns)

IdentifierTypeValueModifiers
$p1text"ewdk.pdb"fullword ascii
$p2text"testbuild.pdb"fullword ascii
$s1text"M:\\"nocase ascii
$s2text"1z1M9U9"fullword wide
$s3text"C:\\Logmein\\{888-8888-9999}\\Logmein.log"fullword wide

Condition

uint16( 0 ) == 0x5a4d and filesize < 2000KB and hash.sha256 ( pe.rich_signature.clear_data ) == "b030ed1a7ca222a0923a59f321be7e55b8d0fc24c1134df1ba775bcf0994c79c" or ( pe.sections [ 4 ] . name == ".gfids" and pe.sections [ 5 ] . name == ".00cfg" ) and ( any of ( $p* ) or 2 of ( $s* ) )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • The file must be smaller than 2000KB (a cheap guard that skips large files).
  • At least one pattern in ( $p* ) must match.
  • At least 2 patterns in ( $s* ) must match.
  • Uses the hash module.
  • Uses the pe module.
  • Compares a hash of the file or a part of it.
  • Checks PE sections (names, count or properties).

Test this rule in your browser

Drop a file to scan it with this rule using YARA-X compiled to WebAssembly. Nothing is uploaded.

Drop a file here or click to chooseScanned locally with YARA-X. Files up to 200 MB.

Open in editor

References

Sample hashes

Hashes of samples the author lists in the rule's meta (look them up in your threat-intelligence platform).

  • 5f9fcbdf7ad86583eb2bbcaa5741d88a

Licence & attribution

Author: Thomas Roccia | McAfee ATR team

Source repository: Trellix Advanced Research Center @ 1919562a59

Licence: Apache License 2.0 (repository licence)

Original rule

Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.

Rule id: b9f1a712-c168-5e0f-8b9e-cb03a6c43fc3

Metadata

rule_versionv1
malware_typeransomware
malware_familyRansom/Egregor
actor_typeCybercrime
actor_groupegregor

Tags:RANSOMWAREFILE