YARA · SEKOIA.IO Community
SEKOIA_Plugx_Final_Payload
Detects encrypted plugx config with a specific size
- Author
- Sekoia.io
- Date
- 2023-07-04
- Modified
- 2024-12-19
- Score / Quality
- 75 / 80
What this rule detects
Detects encrypted plugx config with a specific size
Associated malware family: Plugx.
Targets: Windows PE, Linux ELF.
It defines 1 patterns (0 text, 1 hex, 0 regex). YARA modules used: pe.
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"
rule SEKOIA_Plugx_Final_Payload : FILE
{
meta:
= "Detects encrypted plugx config with a specific size"
= "Sekoia.io"
= "a4047324-81a7-4c17-be84-c0fa479d2f89"
= "2023-07-04"
= "2024-12-19"
= "https://github.com/SEKOIA-IO/Community"
= "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/plugx_final_payload.yar#L3-L23"
= "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
= "bf5035eb7ed620edcf7a0e8e8be220451ce268fc49310f28059b60576d8c5182"
= 75
= 80
= "FILE"
= "1.0"
= "TLP:CLEAR"
strings:
$s1 = {30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 46 88 13 00 00 60 ea 00 00 ?? ?? ?? ?? 00 00 00 00}
condition:
( uint32be( 0 ) == 0x7f454c46 or uint16be( 0 ) == 0x4d5a ) and filesize < 8MB and for any i in ( 0 .. pe.number_of_sections -1 ) : ( pe.sections [ i ] . name == ".data" and $s1 in ( pe.sections [ i ] . raw_data_offset..pe.sections [ i ] . raw_data_offset + pe.sections [ i ] . raw_data_size ) )
}
Strings (1 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $s1 | hex | {30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 46 88 13 00 00 60 ea 00 00 ?? ?? ?? ?? 00 00 00 00} |
Condition
( uint32be( 0 ) == 0x7f454c46 or uint16be( 0 ) == 0x4d5a ) and filesize < 8MB and for any i in ( 0 .. pe.number_of_sections -1 ) : ( pe.sections [ i ] . name == ".data" and $s1 in ( pe.sections [ i ] . raw_data_offset..pe.sections [ i ] . raw_data_offset + pe.sections [ i ] . raw_data_size ) )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 8MB (a cheap guard that skips large files).
- Pattern $s1 must be found within the range pe.sections [ i ] . raw_data_offset..pe.sections [ i ] . raw_data_offset + pe.sections [ i ] . raw_data_size.
- A for-loop checks a property over several matches or items.
- Uses the pe module.
- 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
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: a4047324-81a7-4c17-be84-c0fa479d2f89
Metadata
| version | 1.0 |
|---|---|
| classification | TLP:CLEAR |
Tags:FILE
Related rules
- APT / threat actorSEKOIA.IO Community· Sekoia.io· 2023-12-18
- MalwareMalpedia signator rules· Felix Bilstein - yara-signator at cocacoding dot com· 2026-05-04
- ARKBIRD_SOLG_Mal_Plugx_Thor_July_2021_1Metadata onlyMalwareArkbird SOLG (DailyIOC)· Arkbird_SOLG· 2021-07-27
- SECUINFRA_MALWARE_Plugx_USB_Delivery_Ini_Icon_Jun23Metadata onlyMalwareSecuInfra Falcon Team· SECUINFRA Falcon Team (@SI_FalconTeam)· 2023-06-21
- MalwareSecuInfra Falcon Team· SECUINFRA Falcon Team (@SI_FalconTeam)· 2023-06-21
- SECUINFRA_MALWARE_Plugx_USB_Delivery_LNK_Jun23Metadata onlyMalwareSecuInfra Falcon Team· SECUINFRA Falcon Team (@SI_FalconTeam)· 2023-06-21
- MalwareSEKOIA.IO Community· Sekoia.io· 2024-07-16
- MalwareSEKOIA.IO Community· Sekoia.io· 2024-08-23