Skip to content

YARA · ditekSHen detection

DITEKSHEN_INDICATOR_TOOL_PET_Sharpwmi

Detects SharpWMI

Suspicious / huntingditekSHen detectionBSD 2-Clause LicenseCompiles with YARA-X
Author
ditekSHen
Date
2020-11-06
Modified
2024-09-25
Score / Quality
75 / 73

What this rule detects

Detects SharpWMI

Targets: Windows PE.

It defines 8 patterns (8 text, 0 hex, 0 regex).

Summary generated from the rule's metadata and condition.

Rule source

indicator-tool-pet-sharpwmi.yarBSD 2-Clause License
rule DITEKSHEN_INDICATOR_TOOL_PET_Sharpwmi : FILE
{
	meta:
		description = "Detects SharpWMI"
		author = "ditekSHen"
		id = "9c58d9fa-04b8-5a9c-8ae9-ff2e7530772f"
		date = "2020-11-06"
		modified = "2024-09-25"
		reference = "https://github.com/ditekshen/detection"
		source_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/yara/indicator_tools.yar#L604-L619"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "e6c5764d0883e2882e06f07e4729362011a4d65614259b85978e1c6ef5cfadb7"
		score = 75
		quality = 73
		tags = "FILE"

	strings:
		$s1 = "scriptKillTimeout" fullword ascii
		$s2 = "RemoteWMIExecuteWithOutput" fullword ascii
		$s3 = "RemoteWMIFirewall" fullword ascii
		$s4 = "iex([char[]](@({0})|%{{$_-bxor{1}}}) -join '')" fullword wide
		$s5 = "\\\\{0}\\root\\subscription" fullword wide
		$s6 = "_Context##RANDOM##" fullword wide
		$s7 = "executevbs" fullword wide
		$s8 = "scriptb64" fullword wide

	condition:
		uint16( 0 ) == 0x5a4d and 4 of them
}

Strings (8 patterns)

IdentifierTypeValueModifiers
$s1text"scriptKillTimeout"fullword ascii
$s2text"RemoteWMIExecuteWithOutput"fullword ascii
$s3text"RemoteWMIFirewall"fullword ascii
$s4text"iex([char[]](@({0})|%{{$_-bxor{1}}}) -join '')"fullword wide
$s5text"\\\\{0}\\root\\subscription"fullword wide
$s6text"_Context##RANDOM##"fullword wide
$s7text"executevbs"fullword wide
$s8text"scriptb64"fullword wide

Condition

uint16( 0 ) == 0x5a4d and 4 of them

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • At least 4 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.

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: 9c58d9fa-04b8-5a9c-8ae9-ff2e7530772f

Tags:FILE