Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_CRAT

Detects CRAT main DLL

MalwareCratditekSHen detectionBSD 2-Clause LicenseCompiles with YARA-X
Author
ditekSHen
Date
2020-11-06
Modified
2024-11-01
Score / Quality
75 / 75

What this rule detects

Detects CRAT main DLL

Associated malware family: Crat.

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

malware-win-crat.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_CRAT : FILE
{
	meta:
		description = "Detects CRAT main DLL"
		author = "ditekSHen"
		id = "9757a8de-61ea-55c0-b64c-055798450985"
		date = "2020-11-06"
		modified = "2024-11-01"
		reference = "https://github.com/ditekshen/detection"
		source_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/malware.yar#L1922-L1944"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "5a9fef68e110a1564dd5956408abcc3736cfa6853e1ac5510a089cc68f6bdc35"
		score = 75
		quality = 75
		tags = "FILE"

	strings:
		$s1 = "cmd /c \"dir %s /s >> %s\"" wide
		$s2 = "Set-Cookie:\\b*{.+?}\\n" wide
		$s3 = "Location: {[0-9]+}" wide
		$s4 = "Content-Disposition: form-data; name=\"%s\"; filename=\"" ascii
		$s6 = "%serror.log" wide
		$v2x_1 = "?timestamp=%u" wide
		$v2x_2 = "config.txt" wide
		$v2x_3 = "entdll.dll" wide
		$v2x_4 = "\\cmd.exe" wide
		$v2x_5 = "[MyDocuments]" wide
		$v2x_6 = "@SetWindowTextW FindFileExA" wide
		$v2x_7 = "Microsoft\\Windows\\WinX\\Group1\\*.exe" wide
		$v2s_1 = "Installed Anti Virus Programs" ascii
		$v2s_2 = "Running Processes" ascii
		$v2s_3 = "id=%u&content=" ascii

	condition:
		uint16( 0 ) == 0x5a4d and ( all of ( $s* ) or 6 of ( $v2x* ) or all of ( $v2s* ) or ( 2 of ( $v2s* ) and 4 of ( $v2x* ) ) )
}

Strings (15 patterns)

IdentifierTypeValueModifiers
$s1text"cmd /c \"dir %s /s >> %s\""wide
$s2text"Set-Cookie:\\b*{.+?}\\n"wide
$s3text"Location: {[0-9]+}"wide
$s4text"Content-Disposition: form-data; name=\"%s\"; filename=\""ascii
$s6text"%serror.log"wide
$v2x_1text"?timestamp=%u"wide
$v2x_2text"config.txt"wide
$v2x_3text"entdll.dll"wide
$v2x_4text"\\cmd.exe"wide
$v2x_5text"[MyDocuments]"wide
$v2x_6text"@SetWindowTextW FindFileExA"wide
$v2x_7text"Microsoft\\Windows\\WinX\\Group1\\*.exe"wide
$v2s_1text"Installed Anti Virus Programs"ascii
$v2s_2text"Running Processes"ascii
$v2s_3text"id=%u&content="ascii

Condition

uint16( 0 ) == 0x5a4d and ( all of ( $s* ) or 6 of ( $v2x* ) or all of ( $v2s* ) or ( 2 of ( $v2s* ) and 4 of ( $v2x* ) ) )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • All patterns in ( $s* ) must match.
  • All patterns in ( $v2s* ) must match.
  • At least 6 patterns in ( $v2x* ) must match.
  • At least 2 patterns in ( $v2s* ) must match.
  • At least 4 patterns in ( $v2x* ) 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: ditekSHen

Source repository: ditekSHen detection @ e76c93dcde

Licence: BSD 2-Clause License (repository licence)

Copyright notice: Copyright 2021 by ditekSHen (https://github.com/ditekshen/detection).

Original rule

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

Rule id: 9757a8de-61ea-55c0-b64c-055798450985

Tags:FILE