Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Tool_Masky_Strings

Detects Masky tool

Hack toolSEKOIA.IO CommunityDetection Rule License 1.1Compiles with YARA-X
Author
Sekoia.io
Date
2022-08-23
Modified
2024-12-19
Score / Quality
75 / 80

What this rule detects

Detects Masky tool

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

tool-masky-strings.yarDetection Rule License 1.1
rule SEKOIA_Tool_Masky_Strings : FILE
{
	meta:
		description = "Detects Masky tool"
		author = "Sekoia.io"
		id = "542670ee-9f2e-4148-853d-a3f055bd584c"
		date = "2022-08-23"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/tool_masky_strings.yar#L1-L21"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "35dc536879d9464919028ace6b65b225455621035184d7b58468d259ccda62aa"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$s1 = "caa1aa2e-8a2a-4f98-bc51-b7cf10663fa9" ascii
		$s2 = "Masky" ascii
		$s3 = "\\Windows\\Temp\\" wide
		$s4 = "Length must be non-negative" wide
		$s5 = "CSP does not contain a private key" wide

	condition:
		uint16be( 0 ) == 0x4d5a and filesize < 1MB and 4 of them or $s1
}

Strings (5 patterns)

IdentifierTypeValueModifiers
$s1text"caa1aa2e-8a2a-4f98-bc51-b7cf10663fa9"ascii
$s2text"Masky"ascii
$s3text"\\Windows\\Temp\\"wide
$s4text"Length must be non-negative"wide
$s5text"CSP does not contain a private key"wide

Condition

uint16be( 0 ) == 0x4d5a and filesize < 1MB and 4 of them or $s1

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • The file must be smaller than 1MB (a cheap guard that skips large files).
  • At least 4 patterns in the rule must match.
  • Pattern $s1 must be present.

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: 542670ee-9f2e-4148-853d-a3f055bd584c

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE