Skip to content

YARA · dr4k0nia yara-rules

DR4K0NIA_Msil_Susp_Obf_Xorstringsnet

Detects XorStringsNET string encryption, and other obfuscators derived from it

Suspicious / huntingdr4k0nia yara-rulesDetection Rule License 1.1Compiles with YARA-X
Author
dr4k0nia
Date
2023-03-26
Score / Quality
65 / 85

What this rule detects

Detects XorStringsNET string encryption, and other obfuscators derived from it

Targets: Windows PE, .NET assembly.

It defines 1 patterns (0 text, 1 hex, 0 regex). YARA modules used: dotnet.

Summary generated from the rule's metadata and condition.

Rule source

Includes the imports needed to compile it on its own.

msil-susp-obf-xorstringsnet.yarDetection Rule License 1.1
import "dotnet"

rule DR4K0NIA_Msil_Susp_Obf_Xorstringsnet : FILE
{
	meta:
		description = "Detects XorStringsNET string encryption, and other obfuscators derived from it"
		author = "dr4k0nia"
		id = "0bea654d-9244-5320-a815-691384decc74"
		date = "2023-03-26"
		modified = "2023-03-26"
		reference = "https://github.com/dr4k0nia/yara-rules"
		source_url = "https://github.com/dr4k0nia/yara-rules/blob/4b10f9b79a4cfb3ec9cb5675f32cc7ee6885fbd8/dotnet/msil_susp_obf_xorstringsnet.yar#L3-L16"
		license_url = "https://github.com/dr4k0nia/yara-rules/blob/4b10f9b79a4cfb3ec9cb5675f32cc7ee6885fbd8/LICENSE.md"
		logic_hash = "c494b5b64bcb63d1edd611206fb41eb9a23a940a72c3e9fc3f626e91482b1352"
		score = 65
		quality = 85
		tags = "FILE"
		version = "1.0"

	strings:
		$pattern = { 06 1E 58 07 8E 69 FE17 }

	condition:
		uint16( 0 ) == 0x5a4d and filesize < 25MB and dotnet.is_dotnet and $pattern
}

Strings (1 patterns)

IdentifierTypeValueModifiers
$patternhex{ 06 1E 58 07 8E 69 FE17 }

Condition

uint16( 0 ) == 0x5a4d and filesize < 25MB and dotnet.is_dotnet and $pattern

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • The file must be smaller than 25MB (a cheap guard that skips large files).
  • Uses the dotnet module.
  • Pattern $pattern 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: dr4k0nia

Source repository: dr4k0nia yara-rules @ 4b10f9b79a

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: 0bea654d-9244-5320-a815-691384decc74

Metadata

version1.0

Tags:FILE