YARA · ditekSHen detection
DITEKSHEN_MALWARE_Win_Commonmagic
Detects CommonMagic and Modules
- Author
- ditekSHen
- Date
- 2020-11-06
- Modified
- 2024-11-01
- Score / Quality
- 75 / 75
What this rule detects
Detects CommonMagic and Modules
Associated malware family: Common Magic.
Targets: Windows PE.
It defines 8 patterns (8 text, 0 hex, 0 regex).
Summary generated from the rule's metadata and condition.
Rule source
malware-win-commonmagic.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Commonmagic : FILE
{
meta:
= "Detects CommonMagic and Modules"
= "ditekSHen"
= "cbebe334-9b66-5931-8f92-25d080f7fd6a"
= "2020-11-06"
= "2024-11-01"
= "https://github.com/ditekshen/detection"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/malware.yar#L9645-L9660"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
= "e94ba53f31f3effe12b1fbaca19fea59c0e12f742f6fc0af2a0a679bf4299cbe"
= 75
= 75
= "FILE"
strings:
$p1 = "\\\\.\\pipe\\PipeMd" wide
$p2 = "\\\\.\\pipe\\PipeCrDtMd" wide
$p3 = "\\\\.\\pipe\\PipeDtMd" wide
$s1 = "graph.microsoft.com" fullword wide
$s2 = "CreateNamedPipe" ascii
$s3 = "\\CommonCommand\\" wide
$ua1 = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36" wide
$ua2 = "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136" wide
condition:
uint16( 0 ) == 0x5a4d and ( 2 of ( $p* ) and 1 of ( $s* ) ) or ( 1 of ( $ua* ) and 1 of ( $s* ) and 1 of ( $p* ) )
}
Strings (8 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $p1 | text | "\\\\.\\pipe\\PipeMd" | wide |
| $p2 | text | "\\\\.\\pipe\\PipeCrDtMd" | wide |
| $p3 | text | "\\\\.\\pipe\\PipeDtMd" | wide |
| $s1 | text | "graph.microsoft.com" | fullword wide |
| $s2 | text | "CreateNamedPipe" | ascii |
| $s3 | text | "\\CommonCommand\\" | wide |
| $ua1 | text | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36" | wide |
| $ua2 | text | "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136" | wide |
Condition
uint16( 0 ) == 0x5a4d and ( 2 of ( $p* ) and 1 of ( $s* ) ) or ( 1 of ( $ua* ) and 1 of ( $s* ) and 1 of ( $p* ) )In plain words (Heuristic)
- The file must start with “MZ” — a Windows executable (PE).
- At least 2 patterns in ( $p* ) must match.
- At least 1 patterns in ( $s* ) must match.
- At least 1 patterns in ( $ua* ) must match.
- At least 1 patterns in ( $p* ) 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: ditekSHen
Source repository: ditekSHen detection @ e76c93dcde
Licence: BSD 2-Clause License (repository licence)
Copyright notice: Copyright 2021 by ditekSHen (https://github.com/ditekshen/detection).
Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.
Rule id: cbebe334-9b66-5931-8f92-25d080f7fd6a
Tags:FILE
Related rules
- MalwareMalpedia signator rules· Felix Bilstein - yara-signator at cocacoding dot com· 2026-05-04
- APT / threat actorSEKOIA.IO Community· Sekoia.io· 2023-05-15
- APT / threat actorSEKOIA.IO Community· Sekoia.io· 2023-05-15
- APT / threat actorSEKOIA.IO Community· Sekoia.io· 2023-05-15
- APT / threat actorSEKOIA.IO Community· Sekoia.io· 2023-05-15
- APT / threat actorSEKOIA.IO Community· Sekoia.io· 2023-05-15
- MalwareditekSHen detection· ditekSHen· 2034-02-17
- MalwareditekSHen detection· ditekSHen· 2020-11-06