YARA · SEKOIA.IO Community
SEKOIA_Apt_Sofacy_Graphitemalware_Generic
Detects APT28 graphite malware based on strings
- Author
- Sekoia.io
- Date
- 2022-09-27
- Modified
- 2024-12-19
- Score / Quality
- 75 / 80
What this rule detects
Detects APT28 graphite malware based on strings
Associated malware family: Graphite.
Targets: Windows PE.
It defines 7 patterns (7 text, 0 hex, 0 regex). YARA modules used: pe.
Summary generated from the rule's metadata and condition.
Rule source
Includes the imports needed to compile it on its own.
apt-sofacy-graphitemalware-generic.yarDetection Rule License 1.1
import "pe"
rule SEKOIA_Apt_Sofacy_Graphitemalware_Generic : FILE
{
meta:
= "Detects APT28 graphite malware based on strings"
= "Sekoia.io"
= "6b51cfa3-4a7d-4c2a-9fd9-f129b8a18466"
= "2022-09-27"
= "2024-12-19"
= "https://github.com/SEKOIA-IO/Community"
= "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/apt_sofacy_graphitemalware_generic.yar#L3-L25"
= "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
= "f4c994c36768bae6d6e3b5aeefb634e485ab7b483a693781f29d5ff44c71996f"
= 75
= 80
= "FILE"
= "1.0"
= "TLP:CLEAR"
strings:
$ = "Microsoft Enhanced RSA and AES Cryptographic Provider" wide
$ = "Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)" wide
$ = "%s %04d sp%1d.%1d %s"
$ = "%s%c%s%c%s"
$ = "InternetReadFile"
$ = "ObtainUserAgentString"
$ = "CryptImportKey"
condition:
uint16be( 0 ) == 0x4d5a and filesize < 100KB and ( all of them or pe.imphash ( ) == "c56c322548250651361aef7dacf93eaf" )
}
Strings (7 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $ | text | "Microsoft Enhanced RSA and AES Cryptographic Provider" | wide |
| $ | text | "Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)" | wide |
| $ | text | "%s %04d sp%1d.%1d %s" | |
| $ | text | "%s%c%s%c%s" | |
| $ | text | "InternetReadFile" | |
| $ | text | "ObtainUserAgentString" | |
| $ | text | "CryptImportKey" |
Condition
uint16be( 0 ) == 0x4d5a and filesize < 100KB and ( all of them or pe.imphash ( ) == "c56c322548250651361aef7dacf93eaf" )In plain words (Heuristic)
- The file must start with “MZ” — a Windows executable (PE).
- The file must be smaller than 100KB (a cheap guard that skips large files).
- All patterns in the rule must match.
- Uses the pe module.
- Checks the PE import hash (imphash).
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.
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: 6b51cfa3-4a7d-4c2a-9fd9-f129b8a18466
Metadata
| version | 1.0 |
|---|---|
| classification | TLP:CLEAR |
Tags:FILE
Related rules
- APT / threat actorSEKOIA.IO Community· Sekoia.io· 2022-01-26
- MalwareMalpedia signator rules· Felix Bilstein - yara-signator at cocacoding dot com· 2026-05-04
- 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
- APT / threat actorSEKOIA.IO Community· Sekoia.io· 2024-09-27
- APT / threat actorSEKOIA.IO Community· Sekoia.io· 2024-09-23