Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Apt_Muddywater_Moriagent

Detects Muddy's Mori Agent implant

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

What this rule detects

Detects Muddy's Mori Agent implant

Associated malware family: Moriagent.

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

Includes the imports needed to compile it on its own.

apt-muddywater-moriagent.yarDetection Rule License 1.1
import "pe"

rule SEKOIA_Apt_Muddywater_Moriagent : FILE
{
	meta:
		description = "Detects Muddy's Mori Agent implant"
		author = "Sekoia.io"
		id = "e7a83663-6a30-416a-8f29-87a6b9445ea4"
		date = "2022-01-14"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/apt_muddywater_moriagent.yar#L3-L28"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "21389d4e71e9a19a9d263b8ced740c337ea88ed4ac97199897b0aa3f5914594a"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$mut = "0x50504060" ascii fullword
		$cmd1 = "TType" ascii fullword
		$cmd2 = "TPath" ascii fullword
		$cmd3 = "TFileid" ascii fullword
		$cmd4 = "TCommand" ascii fullword
		$cmd5 = "TTimeout" ascii fullword
		$cmd6 = "TFilter" ascii fullword

	condition:
		uint16be( 0 ) == 0x4d5a and ( ( pe.number_of_exports == 2 and pe.exports ( "DllRegisterServer" ) and pe.exports ( "DllUnregisterServer" ) ) and ( 5 of them ) )
}

Strings (7 patterns)

IdentifierTypeValueModifiers
$muttext"0x50504060"ascii fullword
$cmd1text"TType"ascii fullword
$cmd2text"TPath"ascii fullword
$cmd3text"TFileid"ascii fullword
$cmd4text"TCommand"ascii fullword
$cmd5text"TTimeout"ascii fullword
$cmd6text"TFilter"ascii fullword

Condition

uint16be( 0 ) == 0x4d5a and ( ( pe.number_of_exports == 2 and pe.exports ( "DllRegisterServer" ) and pe.exports ( "DllUnregisterServer" ) ) and ( 5 of them ) )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • At least 5 patterns in the rule must match.
  • Uses the pe module.
  • Checks exported functions or the DLL name.

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: e7a83663-6a30-416a-8f29-87a6b9445ea4

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE