YARA · Cod3nym detection-rules
COD3NYM_SUSP_OBF_NET_Confuserex_Packer_Jan24
Detects binaries packed with ConfuserEx compression packer. This feature compresses and encrypts the actual image into a stub that unpacks and loads the original image on runtime.
- Author
- Jonathan Peters
- Date
- 2024-01-09
- Score / Quality
- 70 / 80
What this rule detects
Detects binaries packed with ConfuserEx compression packer. This feature compresses and encrypts the actual image into a stub that unpacks and loads the original image on runtime.
Targets: Windows PE.
It defines 5 patterns (2 text, 3 hex, 0 regex).
Summary generated from the rule's metadata and condition.
Rule source
rule COD3NYM_SUSP_OBF_NET_Confuserex_Packer_Jan24 : FILE
{
meta:
= "Detects binaries packed with ConfuserEx compression packer. This feature compresses and encrypts the actual image into a stub that unpacks and loads the original image on runtime."
= "Jonathan Peters"
= "cd53a62f-62e3-58a1-8bc3-7f40949e3f00"
= "2024-01-09"
= "2024-01-09"
= "https://github.com/yck1509/ConfuserEx/tree/master"
= "https://github.com/cod3nym/detection-rules//blob/86a04c4594cb48895192aad4af164f21f568c136/yara/dotnet/obf_confuserex.yar#L23-L42"
= "https://github.com/cod3nym/detection-rules//blob/86a04c4594cb48895192aad4af164f21f568c136/LICENSE.md"
= "2570bd4c3f564a61d6b3d589126e0940af27715e1e8d95de7863579fbe25f86f"
= "43aee4c01b47ca04ee516d418939ec3e90fd08566f2a4b501c4698b7f9e0225d"
= 70
= 80
= "FILE"
strings:
$s1 = "GCHandle" ascii
$s2 = "GCHandleType" ascii
$op1 = { 5A 20 89 C0 3F 14 6A 5E [8-20] 5A 20 FB 56 4D 44 6A 5E 6D 9E }
$op2 = { 20 61 FF 6F 00 13 ?? 06 13 ?? 16 13 [10-20] 20 1F 3F 5E 00 5A}
$op3 = { 16 91 7E [3] 04 17 91 1E 62 60 7E [3] 04 18 91 1F 10 62 60 7E [3] 04 19 91 1F 18 62 }
condition:
uint16( 0 ) == 0x5a4d and all of ( $s* ) and 2 of ( $op* )
}
Strings (5 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $s1 | text | "GCHandle" | ascii |
| $s2 | text | "GCHandleType" | ascii |
| $op1 | hex | { 5A 20 89 C0 3F 14 6A 5E [8-20] 5A 20 FB 56 4D 44 6A 5E 6D 9E } | |
| $op2 | hex | { 20 61 FF 6F 00 13 ?? 06 13 ?? 16 13 [10-20] 20 1F 3F 5E 00 5A} | |
| $op3 | hex | { 16 91 7E [3] 04 17 91 1E 62 60 7E [3] 04 18 91 1F 10 62 60 7E [3] 04 19 91 1F 18 62 } |
Condition
uint16( 0 ) == 0x5a4d and all of ( $s* ) and 2 of ( $op* )In plain words (Heuristic)
- The file must start with “MZ” — a Windows executable (PE).
- All patterns in ( $s* ) must match.
- At least 2 patterns in ( $op* ) 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).
- 2570bd4c3f564a61d6b3d589126e0940af27715e1e8d95de7863579fbe25f86f
Licence & attribution
Author: Jonathan Peters
Source repository: Cod3nym detection-rules @ 86a04c4594
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: cd53a62f-62e3-58a1-8bc3-7f40949e3f00
Tags:FILE
Related rules
- Suspicious / huntingCod3nym detection-rules· Jonathan Peters· 2024-01-14
- Suspicious / huntingCod3nym detection-rules· Jonathan Peters· 2024-01-11
- Suspicious / huntingCod3nym detection-rules· Jonathan Peters· 2024-01-09
- Suspicious / huntingCod3nym detection-rules· Jonathan Peters· 2024-01-05
- MalwareCod3nym detection-rules· Jonathan Peters· 2024-01-16
- MalwareCod3nym detection-rules· Jonathan Peters· 2024-01-12
- GenericCod3nym detection-rules· Jonathan Peters· 2024-01-02