Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Apt_Kimsuky_Powershell_Dropper_Strings

Detects a PowerShell dropper used by Kimsuky

APT / threat actorKimsukySEKOIA.IO CommunityDetection Rule License 1.1Compiles with YARA-X
Author
Sekoia.io
Date
2024-06-11
Modified
2024-12-19
Score / Quality
75 / 80

What this rule detects

Detects a PowerShell dropper used by Kimsuky

Associated malware family: Kimsuky.

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

Summary generated from the rule's metadata and condition.

Rule source

apt-kimsuky-powershell-dropper-strings.yarDetection Rule License 1.1
rule SEKOIA_Apt_Kimsuky_Powershell_Dropper_Strings : FILE
{
	meta:
		description = "Detects a PowerShell dropper used by Kimsuky"
		author = "Sekoia.io"
		id = "8b346e05-215b-46c0-82bf-fce3a65440f3"
		date = "2024-06-11"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/apt_kimsuky_powershell_dropper_strings.yar#L1-L21"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "e98f23ddf02049126786e9300e7b6661b2a74817b36e2f3a661b07b24ef4402d"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$s1 = "try { " ascii wide
		$s2 = "); } catch(e){} } if ("
		$s3 = "WScript.Sleep("
		$s4 = " } catch(e) { }"

	condition:
		filesize > 500KB and $s1 at 0 and $s2 in ( filesize -1000 .. filesize ) and $s3 in ( filesize -1000 .. filesize ) and $s4 in ( filesize -1000 .. filesize )
}

Strings (4 patterns)

IdentifierTypeValueModifiers
$s1text"try { "ascii wide
$s2text"); } catch(e){} } if ("
$s3text"WScript.Sleep("
$s4text" } catch(e) { }"

Condition

filesize > 500KB and $s1 at 0 and $s2 in ( filesize -1000 .. filesize ) and $s3 in ( filesize -1000 .. filesize ) and $s4 in ( filesize -1000 .. filesize )

In plain words (Heuristic)

  • The file must be larger than 500KB.
  • Pattern $s1 must be found at offset 0.
  • Pattern $s2 must be found within the range filesize -1000 .. filesize.
  • Pattern $s3 must be found within the range filesize -1000 .. filesize.
  • Pattern $s4 must be found within the range filesize -1000 .. filesize.

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: Sekoia.io

Source repository: SEKOIA.IO Community @ a438a5901a

Licence: Detection Rule License 1.1 (repository licence)

Original rule

Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.

Rule id: 8b346e05-215b-46c0-82bf-fce3a65440f3

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE

More Kimsuky rules