YARA · SEKOIA.IO Community
SEKOIA_Apt_Darkpink_Loader_Decryptionroutine
Detects decryption routine of dark pink loader
- Author
- Sekoia.io
- Date
- 2023-01-17
- Modified
- 2024-12-19
- Score / Quality
- 75 / 80
What this rule detects
Detects decryption routine of dark pink loader
Associated malware family: Darkpink.
Targets: Windows PE, Linux ELF.
It defines 1 patterns (0 text, 1 hex, 0 regex). YARA modules used: pe, hash.
YARA-X says: warning[deprecated_field]: field `number_of_sections` is deprecated
Summary generated from the rule's metadata and condition.
Rule source
Includes the imports needed to compile it on its own.
import "pe"
import "hash"
rule SEKOIA_Apt_Darkpink_Loader_Decryptionroutine : FILE
{
meta:
= "Detects decryption routine of dark pink loader"
= "Sekoia.io"
= "fefc7b2f-eecc-49dc-84bc-24c45e9ea8f0"
= "2023-01-17"
= "2024-12-19"
= "https://github.com/SEKOIA-IO/Community"
= "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/apt_darkpink_loader_decryptionroutine.yar#L4-L49"
= "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
= "3f38860d0f6f0ff1b65219379f8793383cba85b11de1c853192fb2d2ba99e481"
= "b3f1d6366ebc184f634a240c838b39d729c28b8718b0b9ca6be988a7e446ec42"
= "fe2726b77c293fc2aa19216025cfa2b4cd0c5194730cbc57a1fcceb6f6198977"
= 75
= 80
= "FILE"
= "1.0"
= "TLP:CLEAR"
strings:
$chunk_1 = {
8A 08
40
84 C9
75 ??
6A 00
2B C2
50
53
56
E8 ?? ?? ?? ??
8A 88 ?? ?? ?? ??
30 0C 3E
83 C6 01
83 D3 00
78 ??
7F ??
81 FE ?? ?? ?? ??
72 ??
55
}
condition:
( uint32be( 0 ) == 0x7f454c46 or uint16be( 0 ) == 0x4d5a ) and filesize < 3MB and ( all of them or hash.md5 ( pe.rich_signature.clear_data ) == "950c0710dc4cbf6e2cd6b857d25da523" or for any i in ( 0 .. pe.number_of_sections -1 ) : ( hash.md5 ( pe.sections [ i ] . raw_data_offset , pe.sections [ i ] . raw_data_size ) == "547e43dd8560fa8b0ca0be9f633bf62d" ) )
}
Strings (1 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $chunk_1 | hex | { 8A 08 40 84 C9 75 ?? 6A 00 2B C2 50 53 56 E8 ?? ?? ?? ?? 8A 88 ?? ?? ? … |
Condition
( uint32be( 0 ) == 0x7f454c46 or uint16be( 0 ) == 0x4d5a ) and filesize < 3MB and ( all of them or hash.md5 ( pe.rich_signature.clear_data ) == "950c0710dc4cbf6e2cd6b857d25da523" or for any i in ( 0 .. pe.number_of_sections -1 ) : ( hash.md5 ( pe.sections [ i ] . raw_data_offset , pe.sections [ i ] . raw_data_size ) == "547e43dd8560fa8b0ca0be9f633bf62d" ) )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 3MB (a cheap guard that skips large files).
- All patterns in the rule must match.
- A for-loop checks a property over several matches or items.
- Uses the hash module.
- Uses the pe module.
- Compares a hash of the file or a part of it.
- Checks PE sections (names, count or properties).
Test this rule in your browser
Drop a file to scan it with this rule using YARA-X compiled to WebAssembly. Nothing is uploaded.
References
Sample hashes
Hashes of samples the author lists in the rule's meta (look them up in your threat-intelligence platform).
- 3f38860d0f6f0ff1b65219379f8793383cba85b11de1c853192fb2d2ba99e481
- b3f1d6366ebc184f634a240c838b39d729c28b8718b0b9ca6be988a7e446ec42
Licence & attribution
Author: Sekoia.io
Source repository: SEKOIA.IO Community @ a438a5901a
Licence: Detection Rule License 1.1 (repository licence)
Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.
Rule id: fefc7b2f-eecc-49dc-84bc-24c45e9ea8f0
Metadata
| version | 1.0 |
|---|---|
| classification | TLP:CLEAR |
Tags:FILE
Related rules
- APT / threat actorSEKOIA.IO Community· Sekoia.io· 2023-02-22
- APT / threat actorSEKOIA.IO Community· Sekoia.io· 2023-06-05
- APT / threat actorSEKOIA.IO Community· Sekoia.io· 2023-01-16
- MalwareMalpedia signator rules· Felix Bilstein - yara-signator at cocacoding dot com· 2024-10-31
- APT / threat actorSEKOIA.IO Community· Sekoia.io· 2024-09-10
- APT / threat actorSEKOIA.IO Community· Sekoia.io· 2024-10-21
- APT / threat actorSEKOIA.IO Community· Sekoia.io· 2024-10-21
- APT / threat actorSEKOIA.IO Community· Sekoia.io· 2024-09-27