YARA · SEKOIA.IO Community
SEKOIA_Apt_Badmagic_Ld_Dll_Loader_Pshscript
Detects BadMagic DLL Loader powershell script
- Author
- Sekoia.io
- Date
- 2023-05-15
- Modified
- 2024-12-19
- Score / Quality
- 75 / 80
What this rule detects
Detects BadMagic DLL Loader powershell script
Associated malware family: Dllloader.
It defines 4 patterns (4 text, 0 hex, 0 regex).
Summary generated from the rule's metadata and condition.
Rule source
apt-badmagic-ld-dll-loader-pshscript.yarDetection Rule License 1.1
rule SEKOIA_Apt_Badmagic_Ld_Dll_Loader_Pshscript : FILE
{
meta:
= "Detects BadMagic DLL Loader powershell script"
= "Sekoia.io"
= "d4a23afc-693f-4fab-b2c4-15eecba047f7"
= "2023-05-15"
= "2024-12-19"
= "https://github.com/SEKOIA-IO/Community"
= "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/apt_badmagic_ld_dll_loader_pshscript.yar#L1-L18"
= "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
= "8482521fe1f90c008948e551df35448b870145cf8b58f3c5019cafb66bb0ae36"
= 75
= 80
= "FILE"
= "1.0"
= "TLP:CLEAR"
strings:
$ = "$ModulePath = \"$folder_path\\$name"
$ = "$ModuleExport ="
$ = "start-job -ScriptBlock $ScriptBlock"
$ = "Invoke-WebRequest -Uri"
condition:
all of them and filesize < 1KB
}
Strings (4 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $ | text | "$ModulePath = \"$folder_path\\$name" | |
| $ | text | "$ModuleExport =" | |
| $ | text | "start-job -ScriptBlock $ScriptBlock" | |
| $ | text | "Invoke-WebRequest -Uri" |
Condition
all of them and filesize < 1KBIn plain words (Heuristic)
- The file must be smaller than 1KB (a cheap guard that skips large files).
- 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.
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: d4a23afc-693f-4fab-b2c4-15eecba047f7
Metadata
| version | 1.0 |
|---|---|
| classification | TLP:CLEAR |
Tags:FILE
Related rules
- MalwareSignature Base (Florian Roth / Nextron)· X__Junior· 2026-02-02
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- 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