Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Infostealer_Win_Mars_Stealer_Xor_Routine

Detect Mars Stealer based on a specific XOR routine

MalwareMars StealerSEKOIA.IO CommunityDetection Rule License 1.1Compiles with YARA-X
Author
Sekoia.io
Date
2022-04-06
Modified
2024-12-19
Score / Quality
75 / 80

What this rule detects

Detect Mars Stealer based on a specific XOR routine

Associated malware family: Mars Stealer.

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

infostealer-win-mars-stealer-xor-routine.yarDetection Rule License 1.1
rule SEKOIA_Infostealer_Win_Mars_Stealer_Xor_Routine : FILE
{
	meta:
		description = "Detect Mars Stealer based on a specific XOR routine"
		author = "Sekoia.io"
		id = "3e2c7440b2fc9e4b039e6fa8152ac8ff"
		date = "2022-04-06"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/infostealer_win_mars_stealer_xor_routine.yar#L1-L15"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "c7e65550a225431552e8a81bbce81dd66350021b6444c94fe7a37aa96712e9b1"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$xor = {8b 4d ?? 03 4d ?? 0f be 19 8b 55 ?? 52 e8 ?? ?? ?? ?? 83 c4 ?? 8b c8 8b 45 ?? 33 d2 f7 f1 8b 45 ?? 0f be 0c 10 33 d9 8b 55 ?? 03 55 ?? 88 1a eb be}

	condition:
		uint16( 0 ) == 0x5A4D and $xor
}

Strings (1 patterns)

IdentifierTypeValueModifiers
$xorhex{8b 4d ?? 03 4d ?? 0f be 19 8b 55 ?? 52 e8 ?? ?? ?? ?? 83 c4 ?? 8b c8 8b 45 ?? 33 d2 f7 f1 8b 45 ?? 0f be 0c 10 33 d9 8b 55 ?? 03 55 ?? 88 1a eb be}

Condition

uint16( 0 ) == 0x5A4D and $xor

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • Pattern $xor 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: 3e2c7440b2fc9e4b039e6fa8152ac8ff

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE

More Mars Stealer rules