Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Merlin_Crossplatform

Detects Merlin agent cross platform

GenericSEKOIA.IO CommunityDetection Rule License 1.1Compiles with YARA-X
Author
Sekoia.io
Date
2022-01-03
Modified
2024-12-19
Score / Quality
75 / 80

What this rule detects

Detects Merlin agent cross platform

Targets: Windows PE.

It defines 6 patterns (6 text, 0 hex, 0 regex).

Summary generated from the rule's metadata and condition.

Rule source

merlin-crossplatform.yarDetection Rule License 1.1
rule SEKOIA_Merlin_Crossplatform : FILE
{
	meta:
		description = "Detects Merlin agent cross platform"
		author = "Sekoia.io"
		id = "c9c57f5e-26c3-43be-b2cf-10f5129d3be6"
		date = "2022-01-03"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/merlin_crossplatform.yar#L1-L23"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "975cc4fe0d89383188f9fd3c516d1e853dd6070d7703c0b5b5874dc1e7e6f32a"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$s1 = ".CRT" ascii
		$s2 = ".tls" ascii
		$s3 = "github.com/Ne0nd0g/merlin" ascii
		$s4 = "github.com/refraction-networking" ascii
		$s5 = "SendMerlinMessage" ascii
		$s6 = "ifconfigH9" ascii

	condition:
		( uint16( 0 ) == 0x5a4d or uint16( 0 ) == 0x457f ) and all of them and filesize > 5MB and filesize < 15MB
}

Strings (6 patterns)

IdentifierTypeValueModifiers
$s1text".CRT"ascii
$s2text".tls"ascii
$s3text"github.com/Ne0nd0g/merlin"ascii
$s4text"github.com/refraction-networking"ascii
$s5text"SendMerlinMessage"ascii
$s6text"ifconfigH9"ascii

Condition

( uint16( 0 ) == 0x5a4d or uint16( 0 ) == 0x457f ) and all of them and filesize > 5MB and filesize < 15MB

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • The file must be smaller than 15MB (a cheap guard that skips large files).
  • The file must be larger than 5MB.
  • All patterns in the rule must match.

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: Sekoia.io

Source repository: SEKOIA.IO Community @ a438a5901a

Licence: Detection Rule License 1.1 (repository licence)

Original rule

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

Rule id: c9c57f5e-26c3-43be-b2cf-10f5129d3be6

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE