Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Pwshloader_Runpe02

Detects PowerShell PE loader / executer. Observed Gorgon TTPs

MalwarePwshloaderditekSHen 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 PowerShell PE loader / executer. Observed Gorgon TTPs

Associated malware family: Pwshloader.

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

Summary generated from the rule's metadata and condition.

Rule source

malware-win-pwshloader-runpe02.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Pwshloader_Runpe02
{
	meta:
		description = "Detects PowerShell PE loader / executer. Observed Gorgon TTPs"
		author = "ditekSHen"
		id = "08261054-bebc-58fe-949a-27f6e817003a"
		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#L4922-L4934"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "d7677689938d3e3eb6b59b99b7e347c60214f6edf8e5f83bf85da5a5f1ad33bb"
		score = 75
		quality = 75
		tags = ""

	strings:
		$s1 = "'.Replace('" ascii nocase
		$s2 = "'aspnet_compiler.exe'" ascii
		$s3 = "[Byte[]]$" ascii
		$pe1 = "(77,90," ascii
		$pe2 = "='4D5A" ascii

	condition:
		all of ( $s* ) and ( #pe1 > 1 or #pe2 > 1 ) and #s1 > 4
}

Strings (5 patterns)

IdentifierTypeValueModifiers
$s1text"'.Replace('"ascii nocase
$s2text"'aspnet_compiler.exe'"ascii
$s3text"[Byte[]]$"ascii
$pe1text"(77,90,"ascii
$pe2text"='4D5A"ascii

Condition

all of ( $s* ) and ( #pe1 > 1 or #pe2 > 1 ) and #s1 > 4

In plain words (Heuristic)

  • All patterns in ( $s* ) must match.
  • Pattern $pe1 must occur > 1 times.
  • Pattern $pe2 must occur > 1 times.
  • Pattern $s1 must occur > 4 times.

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: 08261054-bebc-58fe-949a-27f6e817003a