Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Mediapi

Detects MediaPI

MalwareMediapiditekSHen detectionBSD 2-Clause LicenseCompiles with YARA-X
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.

malware-win-mediapi.yarBSD 2-Clause License
import "pe"

rule DITEKSHEN_MALWARE_Win_Mediapi : FILE
{
	meta:
		description = "Detects MediaPI"
		author = "ditekSHen"
		id = "95db8772-1bcd-5eea-956c-c9578b8e1329"
		date = "2020-11-06"
		modified = "2024-11-01"
		reference = "https://github.com/ditekshen/detection"
		source_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/malware.yar#L11425-L11439"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "2bce0a96b45e46c0cbd913dacb3dfe7ae1b519102d637e0fd9dabe2008037d94"
		score = 75
		quality = 75
		tags = "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)

IdentifierTypeValueModifiers
$s1text"SomeFunction"ascii
$s2text"\"stealth"ascii
$s3text"\"ServAddr"ascii
$s4text"\"ServPort"ascii
$s5text"\"ServIp"ascii
$s6text"\"wsaData"ascii
$s7text"\"-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.

Drop a file here or click to chooseScanned locally with YARA-X. Files up to 200 MB.

Open in editor

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).

Original rule

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