Skip to content

YARA · ditekSHen detection

DITEKSHEN_INDICATOR_TOOL_PWS_Credstealer

Detects Python executable for stealing credentials including domain environments. Observed in MuddyWater.

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

What this rule detects

Detects Python executable for stealing credentials including domain environments. Observed in MuddyWater.

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

indicator-tool-pws-credstealer.yarBSD 2-Clause License
rule DITEKSHEN_INDICATOR_TOOL_PWS_Credstealer : FILE
{
	meta:
		description = "Detects Python executable for stealing credentials including domain environments. Observed in MuddyWater."
		author = "ditekSHen"
		id = "ab587b12-f3e1-5f08-b27c-03ee9752e513"
		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#L22-L41"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "e729c8b0b1db642acabbc4590833c05ce81447bb89e5f40aea5f0b8ebdee4438"
		score = 75
		quality = 75
		tags = "FILE"

	strings:
		$s1 = "PYTHON27.DLL" fullword wide
		$s2 = "C:\\Python27\\lib\\site-packages\\py2exe\\boot_common.pyR" fullword ascii
		$s3 = "C:\\Python27\\lib\\site-packages\\py2exe\\boot_common.pyt" fullword ascii
		$s4 = "subprocess.pyc" fullword ascii
		$s5 = "MyGetProcAddress(%p, %p(%s)) -> %p" fullword ascii
		$p1 = "Dump SAM hashes from target systemss" fullword ascii
		$p2 = "Dump LSA secrets from target systemss" fullword ascii
		$p3 = "Dump the NTDS.dit from target DCs using the specifed method" fullword ascii
		$p4 = "Dump NTDS.dit password historys" fullword ascii
		$p5 = "Use Kerberos authentication. Grabs credentials from ccache file (KRB5CCNAME) based on target parameterss" fullword ascii
		$p6 = "Retrieve plaintext passwords and other information for accounts pushed through Group Policy Preferencess" fullword ascii
		$p7 = "Combo file containing a list of domain\\username:password or username:password entriess" fullword ascii

	condition:
		uint16( 0 ) == 0x5a4d and ( 3 of ( $s* ) and 1 of ( $p* ) )
}

Strings (12 patterns)

IdentifierTypeValueModifiers
$s1text"PYTHON27.DLL"fullword wide
$s2text"C:\\Python27\\lib\\site-packages\\py2exe\\boot_common.pyR"fullword ascii
$s3text"C:\\Python27\\lib\\site-packages\\py2exe\\boot_common.pyt"fullword ascii
$s4text"subprocess.pyc"fullword ascii
$s5text"MyGetProcAddress(%p, %p(%s)) -> %p"fullword ascii
$p1text"Dump SAM hashes from target systemss"fullword ascii
$p2text"Dump LSA secrets from target systemss"fullword ascii
$p3text"Dump the NTDS.dit from target DCs using the specifed method"fullword ascii
$p4text"Dump NTDS.dit password historys"fullword ascii
$p5text"Use Kerberos authentication. Grabs credentials from ccache file (KRB5CCNAME) based on target parameterss"fullword ascii
$p6text"Retrieve plaintext passwords and other information for accounts pushed through Group Policy Preferencess"fullword ascii
$p7text"Combo file containing a list of domain\\username:password or username:password entriess"fullword ascii

Condition

uint16( 0 ) == 0x5a4d and ( 3 of ( $s* ) and 1 of ( $p* ) )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • At least 3 patterns in ( $s* ) 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.

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: ab587b12-f3e1-5f08-b27c-03ee9752e513

Tags:FILE