YARA · Mandiant red team tool countermeasures
FIREEYE_RT_APT_Builder_Win64_MATRYOSHKA_1
matryoshka_pe_to_shellcode.rs
- Author
- FireEye
- Date
- 2020-12-02
- Modified
- 2020-12-09
- Score / Quality
- 75 / 75
What this rule detects
matryoshka_pe_to_shellcode.rs
Targets: Windows PE.
It defines 4 patterns (3 text, 1 hex, 0 regex).
Summary generated from the rule's metadata and condition.
Rule source
rule FIREEYE_RT_APT_Builder_Win64_MATRYOSHKA_1 : FILE
{
meta:
= "matryoshka_pe_to_shellcode.rs"
= "FireEye"
= "0afcf13e-5cd3-5c1c-897e-b6d0c283ab0f"
= "2020-12-02"
= "2020-12-02"
= "2020-12-09"
= "https://github.com/mandiant/red_team_tool_countermeasures/"
= "https://github.com/mandiant/red_team_tool_countermeasures//blob/3561b71724dbfa3e2bb78106aaa2d7f8b892c43b/rules/MATRYOSHKA/production/yara/APT_Builder_Win64_MATRYOSHKA_1.yar#L4-L20"
= "https://github.com/mandiant/red_team_tool_countermeasures//blob/3561b71724dbfa3e2bb78106aaa2d7f8b892c43b/LICENSE.txt"
= "8d949c34def898f0f32544e43117c057"
= "b370d7dea44bccc92fc8dbd4ea0ee9bec523820108bf8bc67acb17ebf9835f74"
= 75
= 75
= "FILE"
= 1
strings:
$sb1 = { 4D 5A 45 52 [0-32] E8 [0-32] 00 00 00 00 [0-32] 5B 48 83 EB 09 53 48 81 [0-32] C3 [0-32] FF D3 [0-32] C3 }
$ss1 = "\x00Stub Size: "
$ss2 = "\x00Executable Size: "
$ss3 = "\x00[+] Writing out to file"
condition:
( uint16( 0 ) == 0x5A4D ) and ( uint32( uint32( 0x3C ) ) == 0x00004550 ) and ( uint16( uint32( 0x3C ) + 0x18 ) == 0x020B ) and all of them
}
Strings (4 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $sb1 | hex | { 4D 5A 45 52 [0-32] E8 [0-32] 00 00 00 00 [0-32] 5B 48 83 EB 09 53 48 81 [0-32] C3 [0-32] FF D3 [0-32] C3 } | |
| $ss1 | text | "\x00Stub Size: " | |
| $ss2 | text | "\x00Executable Size: " | |
| $ss3 | text | "\x00[+] Writing out to file" |
Condition
( uint16( 0 ) == 0x5A4D ) and ( uint32( uint32( 0x3C ) ) == 0x00004550 ) and ( uint16( uint32( 0x3C ) + 0x18 ) == 0x020B ) and all of themIn plain words (Heuristic)
- The file must start with “MZ” — a Windows executable (PE).
- 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.
Sample hashes
Hashes of samples the author lists in the rule's meta (look them up in your threat-intelligence platform).
- 8d949c34def898f0f32544e43117c057
Licence & attribution
Author: FireEye
Source repository: Mandiant red team tool countermeasures @ 3561b71724
Licence: BSD 2-Clause License (repository licence)
Copyright notice: Copyright (c) 2023, MANDIANT
Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.
Rule id: 0afcf13e-5cd3-5c1c-897e-b6d0c283ab0f
Metadata
| rev | 1 |
|---|
Tags:FILE
Related rules
- APT / threat actorMandiant red team tool countermeasures· FireEye· 2020-12-08
- APT / threat actorMandiant red team tool countermeasures· FireEye· 2020-12-08
- APT / threat actorMandiant red team tool countermeasures· FireEye· 2020-12-02
- APT / threat actorMandiant red team tool countermeasures· FireEye· 2020-12-02
- APT / threat actorMandiant red team tool countermeasures· FireEye· 2020-11-27
- APT / threat actorMandiant red team tool countermeasures· FireEye· 2020-12-02
- APT / threat actorMandiant red team tool countermeasures· FireEye· 2020-11-27
- APT / threat actorMandiant red team tool countermeasures· FireEye· 2020-11-27