Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Apt_Darkpink_Sample

Detects two parts of cmd.exe /c

APT / threat actorDarkpinkSEKOIA.IO CommunityDetection Rule License 1.1Compiles with YARA-X
Author
Sekoia.io
Date
2023-06-05
Modified
2024-12-19
Score / Quality
75 / 80

What this rule detects

Detects two parts of cmd.exe /c

Associated malware family: Darkpink.

Targets: Windows PE, Linux ELF.

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

Summary generated from the rule's metadata and condition.

Rule source

apt-darkpink-sample.yarDetection Rule License 1.1
rule SEKOIA_Apt_Darkpink_Sample : FILE
{
	meta:
		description = "Detects two parts of cmd.exe /c "
		author = "Sekoia.io"
		id = "91b4c64a-7622-4f03-bd3f-9fe56f01dfbe"
		date = "2023-06-05"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/apt_darkpink_sample.yar#L1-L19"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		hash = "8dc3f6179120f03fd6cb2299dbc94425451d84d6852b801a313a39e9df5d9b1a"
		logic_hash = "c9d3952036bffe2d924ea553fd53f8b6f0b3f16f1060fbde69496c800d4d5ad9"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$cmd_xor_part_1 = {DF 00 A1 00 E4 00 F0 00 4B 00 3A 00 D1 00 C4 00}
		$cmd_xor_part_2 = {bc 00 cc 00 80 00 d0 00 64 00 59 00 F1 00 E6 00 FD 00 83 00 C6}

	condition:
		( uint32be( 0 ) == 0x7f454c46 or uint16be( 0 ) == 0x4d5a ) and filesize < 1MB and all of them
}

Strings (2 patterns)

IdentifierTypeValueModifiers
$cmd_xor_part_1hex{DF 00 A1 00 E4 00 F0 00 4B 00 3A 00 D1 00 C4 00}
$cmd_xor_part_2hex{bc 00 cc 00 80 00 d0 00 64 00 59 00 F1 00 E6 00 FD 00 83 00 C6}

Condition

( uint32be( 0 ) == 0x7f454c46 or uint16be( 0 ) == 0x4d5a ) and filesize < 1MB and all of them

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • The file must start with the ELF header — a Linux/Unix executable.
  • The file must be smaller than 1MB (a cheap guard that skips large files).
  • All patterns in the rule 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

Sample hashes

Hashes of samples the author lists in the rule's meta (look them up in your threat-intelligence platform).

  • 8dc3f6179120f03fd6cb2299dbc94425451d84d6852b801a313a39e9df5d9b1a

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: 91b4c64a-7622-4f03-bd3f-9fe56f01dfbe

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE

More Darkpink rules