YARA · ditekSHen detection
DITEKSHEN_MALWARE_Win_Mediapi
Detects MediaPI
- Author
- ditekSHen
- Date
- 2020-11-06
- Modified
- 2024-11-01
- Score / Quality
- 75 / 75
What this rule detects
Detects MediaPI
Associated malware family: Mediapi.
Targets: Windows PE.
It defines 7 patterns (7 text, 0 hex, 0 regex). YARA modules used: pe.
Summary generated from the rule's metadata and condition.
Rule source
Includes the imports needed to compile it on its own.
import "pe"
rule DITEKSHEN_MALWARE_Win_Mediapi : FILE
{
meta:
= "Detects MediaPI"
= "ditekSHen"
= "95db8772-1bcd-5eea-956c-c9578b8e1329"
= "2020-11-06"
= "2024-11-01"
= "https://github.com/ditekshen/detection"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/malware.yar#L11425-L11439"
= "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
= "2bce0a96b45e46c0cbd913dacb3dfe7ae1b519102d637e0fd9dabe2008037d94"
= 75
= 75
= "FILE"
strings:
$s1 = "SomeFunction" ascii
$s2 = "\"stealth" ascii
$s3 = "\"ServAddr" ascii
$s4 = "\"ServPort" ascii
$s5 = "\"ServIp" ascii
$s6 = "\"wsaData" ascii
$s7 = "\"-socket" ascii
condition:
uint16( 0 ) == 0x5a4d and pe.is_dll ( ) and ( ( 6 of them ) or ( 3 of them and pe.exports ( "SomeFunction" ) ) )
}
Strings (7 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $s1 | text | "SomeFunction" | ascii |
| $s2 | text | "\"stealth" | ascii |
| $s3 | text | "\"ServAddr" | ascii |
| $s4 | text | "\"ServPort" | ascii |
| $s5 | text | "\"ServIp" | ascii |
| $s6 | text | "\"wsaData" | ascii |
| $s7 | text | "\"-socket" | ascii |
Condition
uint16( 0 ) == 0x5a4d and pe.is_dll ( ) and ( ( 6 of them ) or ( 3 of them and pe.exports ( "SomeFunction" ) ) )In plain words (Heuristic)
- The file must start with “MZ” — a Windows executable (PE).
- At least 6 patterns in the rule must match.
- At least 3 patterns in the rule must match.
- Uses the pe module.
- Checks exported functions or the DLL name.
- Requires a DLL.
Test this rule in your browser
Drop a file to scan it with this rule using YARA-X compiled to WebAssembly. Nothing is uploaded.
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: 95db8772-1bcd-5eea-956c-c9578b8e1329
Tags:FILE
Related rules
- MalwareMalpedia signator rules· Felix Bilstein - yara-signator at cocacoding dot com· 2026-05-04
- MalwareditekSHen detection· ditekSHen· 2034-02-17
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06
- MalwareditekSHen detection· ditekSHen· 2020-11-06