YARA · SEKOIA.IO Community
SEKOIA_Apt_Lazarus_Dll_C2_Comms
Detects DLL communicating with the C2
- Author
- Sekoia.io
- Date
- 2023-04-04
- Modified
- 2024-12-19
- Score / Quality
- 75 / 80
What this rule detects
Detects DLL communicating with the C2
Targets: Windows PE, Linux ELF.
It defines 6 patterns (3 text, 3 hex, 0 regex).
Summary generated from the rule's metadata and condition.
Rule source
apt-lazarus-dll-c2-comms.yarDetection Rule License 1.1
rule SEKOIA_Apt_Lazarus_Dll_C2_Comms : FILE
{
meta:
= "Detects DLL communicating with the C2"
= "Sekoia.io"
= "9b379aa8-77ce-4c76-ab13-05e35ebfbdfe"
= "2023-04-04"
= "2024-12-19"
= "https://github.com/SEKOIA-IO/Community"
= "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/apt_lazarus_dll_c2_comms.yar#L1-L33"
= "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
= "fe948451df90df80c8028b969bf89ecbf501401e7879805667c134080976ce2e"
= "bb1066c1ca53139dc5a2c1743339f4e6360d6fe4f2f3261d24fc28a12f3e2ab9"
= "dca33d6dacac0859ec2f3104485720fe2451e21eb06e676f4860ecc73a41e6f9"
= "69dd140f45c3fa3aaa64c69f860cd3c74379dec37c46319d7805a29b637d4dbf"
= "b5ba5ae25822cf54d530d1a18c8196194d44e4fd76be1a0bf98c193772286282"
= 75
= 80
= "FILE"
= "1.0"
= "TLP:CLEAR"
strings:
$x1 = "vG2eZ1KOeGd2n5fr" ascii fullword
$s1 = "Windows %d(%d)-%s" ascii fullword
$s2 = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" wide fullword
$op1 = {B8 C8 00 00 00 83 FB 01 44 0F 47 E8 41 8B C5 48 8B B4 24 E0 18 00 00 4C 8B A4 24 E8 18 00 00 48 8B 8D A0 17 00 00 48 33 CC}
$op2 = {33 D2 46 8D 04 B5 00 00 00 00 66 0F 1F 44 00 00 49 63 C0 41 FF C0 8B 4C 84 70 31 4C 94 40 48 FF C2}
$op3 = {89 5C 24 50 0F 57 C0 C7 44 24 4C 04 00 00 00 C7 44 24 48 40 00 00 00 0F 11 44 24 60 0F 11 44 24 70 0F 11 45 80 0F 11 45 90}
condition:
( uint32be( 0 ) == 0x7f454c46 or uint16be( 0 ) == 0x4d5a ) and ( filesize < 500KB and ( 1 of ( $x* ) or 2 of them ) or ( $x1 and 1 of ( $s* ) or 3 of them ) )
}
Strings (6 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $x1 | text | "vG2eZ1KOeGd2n5fr" | ascii fullword |
| $s1 | text | "Windows %d(%d)-%s" | ascii fullword |
| $s2 | text | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" | wide fullword |
| $op1 | hex | {B8 C8 00 00 00 83 FB 01 44 0F 47 E8 41 8B C5 48 8B B4 24 E0 18 00 00 4C 8B A4 24 E8 18 00 00 48 8B 8D A0 17 00 00 48 33 CC} | |
| $op2 | hex | {33 D2 46 8D 04 B5 00 00 00 00 66 0F 1F 44 00 00 49 63 C0 41 FF C0 8B 4C 84 70 31 4C 94 40 48 FF C2} | |
| $op3 | hex | {89 5C 24 50 0F 57 C0 C7 44 24 4C 04 00 00 00 C7 44 24 48 40 00 00 00 0F 11 44 24 60 0F 11 44 24 70 0F 11 45 80 0F 11 45 90} |
Condition
( uint32be( 0 ) == 0x7f454c46 or uint16be( 0 ) == 0x4d5a ) and ( filesize < 500KB and ( 1 of ( $x* ) or 2 of them ) or ( $x1 and 1 of ( $s* ) or 3 of them ) )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 500KB (a cheap guard that skips large files).
- At least 1 patterns in ( $x* ) must match.
- At least 2 patterns in the rule must match.
- At least 1 patterns in ( $s* ) must match.
- At least 3 patterns in the rule must match.
- Pattern $x1 must be present.
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
Sample hashes
Hashes of samples the author lists in the rule's meta (look them up in your threat-intelligence platform).
- fe948451df90df80c8028b969bf89ecbf501401e7879805667c134080976ce2e
- bb1066c1ca53139dc5a2c1743339f4e6360d6fe4f2f3261d24fc28a12f3e2ab9
- dca33d6dacac0859ec2f3104485720fe2451e21eb06e676f4860ecc73a41e6f9
- 69dd140f45c3fa3aaa64c69f860cd3c74379dec37c46319d7805a29b637d4dbf
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: 9b379aa8-77ce-4c76-ab13-05e35ebfbdfe
Metadata
| version | 1.0 |
|---|---|
| classification | TLP:CLEAR |
Tags:FILE
Related rules
- 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
- APT / threat actorSEKOIA.IO Community· Sekoia.io· 2024-06-11
- APT / threat actorSEKOIA.IO Community· Sekoia.io· 2024-03-06