Skip to content

YARA · Trellix Advanced Research Center

TRELLIX_ARC_Megacortex_Signed

Rule to detect MegaCortex samples digitally signed

MalwareMegaCortexTrellix Advanced Research CenterApache License 2.0Compiles with YARA-X (with warnings)
Author
Marc Rivero | McAfee ATR Team
Date
2026-09-01
Modified
2020-08-14
Score / Quality
75 / 70

What this rule detects

Rule to detect MegaCortex samples digitally signed

Associated malware family: MegaCortex.

Targets: Windows PE.

It has no patterns: the condition alone decides (modules, file properties or other rules). YARA modules used: pe.

YARA-X says: warning[deprecated_field]: field `number_of_signatures` is deprecated

Summary generated from the rule's metadata and condition.

Rule source

Includes the imports needed to compile it on its own.

megacortex-signed.yarApache License 2.0
import "pe"

rule TRELLIX_ARC_Megacortex_Signed : RANSOMWARE FILE
{
	meta:
		description = "Rule to detect MegaCortex samples digitally signed"
		author = "Marc Rivero | McAfee ATR Team"
		id = "78a74e30-4de0-5e63-8ca5-31251c296f98"
		date = "2026-09-01"
		modified = "2020-08-14"
		reference = "https://blog.malwarebytes.com/detections/ransom-megacortex/"
		source_url = "https://github.com/advanced-threat-research/Yara-Rules//blob/1919562a59f190bda60c982424f6a24c542ee3e0/ransomware/RANSOM_MegaCortex.yar#L3-L26"
		license_url = "https://github.com/advanced-threat-research/Yara-Rules//blob/1919562a59f190bda60c982424f6a24c542ee3e0/LICENSE"
		logic_hash = "8ffced3aca837682fbd7ee68f559f73b8299cbfbe198f48124c4857680735249"
		score = 75
		quality = 70
		tags = "RANSOMWARE, FILE"
		malware_type = "ransomware"
		malware_family = "Ransom:W32/MegaCortex"
		actor_type = "Cybercrime"
		actor_group = "Unknown"

	condition:
		uint16( 0 ) == 0x5a4d and for any i in ( 0 .. pe.number_of_signatures ) : ( pe.signatures [ i ] . subject contains "/C=GB/L=ROMFORD/O=3AN LIMITED/CN=3AN LIMITED" and pe.signatures [ i ] . serial == "04:c7:cd:cc:16:98:e2:5b:49:3e:b4:33:8d:5e:2f:8b" or pe.signatures [ i ] . subject contains "/C=GB/postalCode=RM6 4DE/ST=ROMFORD/L=ROMFORD/street=8 Quarles Park Road/O=3AN LIMITED/CN=3AN LIMITED" and pe.signatures [ i ] . serial == "53:cc:4c:69:e5:6a:7d:bc:36:67:d5:ff:d5:24:aa:4b" or pe.signatures [ i ] . subject contains "/C=GB/postalCode=RM6 4DE/ST=ROMFORD/L=ROMFORD/street=8 Quarles Park Road/O=3AN LIMITED/CN=3AN LIMITED" or pe.signatures [ i ] . serial == "00:ad:72:9a:65:f1:78:47:ac:b8:f8:49:6a:76:80:ff:1e" )
}

Condition

uint16( 0 ) == 0x5a4d and for any i in ( 0 .. pe.number_of_signatures ) : ( pe.signatures [ i ] . subject contains "/C=GB/L=ROMFORD/O=3AN LIMITED/CN=3AN LIMITED" and pe.signatures [ i ] . serial == "04:c7:cd:cc:16:98:e2:5b:49:3e:b4:33:8d:5e:2f:8b" or pe.signatures [ i ] . subject contains "/C=GB/postalCode=RM6 4DE/ST=ROMFORD/L=ROMFORD/street=8 Quarles Park Road/O=3AN LIMITED/CN=3AN LIMITED" and pe.signatures [ i ] . serial == "53:cc:4c:69:e5:6a:7d:bc:36:67:d5:ff:d5:24:aa:4b" or pe.signatures [ i ] . subject contains "/C=GB/postalCode=RM6 4DE/ST=ROMFORD/L=ROMFORD/street=8 Quarles Park Road/O=3AN LIMITED/CN=3AN LIMITED" or pe.signatures [ i ] . serial == "00:ad:72:9a:65:f1:78:47:ac:b8:f8:49:6a:76:80:ff:1e" )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • A for-loop checks a property over several matches or items.
  • Uses the pe module.
  • Checks the Authenticode signature.

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

Licence & attribution

Author: Marc Rivero | 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: 78a74e30-4de0-5e63-8ca5-31251c296f98

Metadata

malware_typeransomware
malware_familyRansom:W32/MegaCortex
actor_typeCybercrime
actor_groupUnknown

Tags:RANSOMWAREFILE