Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Koiloader_Powershell_Reflective_Loading

Powershell script loading service.exe (related to Koi Loader)

MalwareKoiloaderSEKOIA.IO CommunityDetection Rule License 1.1Compiles with YARA-X
Author
Sekoia.io
Date
2024-03-20
Modified
2024-12-19
Score / Quality
75 / 80

What this rule detects

Powershell script loading service.exe (related to Koi Loader)

Associated malware family: Koiloader.

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

Summary generated from the rule's metadata and condition.

Rule source

koiloader-powershell-reflective-loading.yarDetection Rule License 1.1
rule SEKOIA_Koiloader_Powershell_Reflective_Loading : FILE
{
	meta:
		description = "Powershell script loading service.exe (related to Koi Loader)"
		author = "Sekoia.io"
		id = "9bbe4cea-3e64-4377-bf93-def9fb629734"
		date = "2024-03-20"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/koiloader_powershell_reflective_loading.yar#L1-L19"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "27deec01027a73129c6c8057eff1b48190c89ac18dcd7c390fc177d82a897290"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$s1 = "[Byte[]]$image" ascii fullword
		$s2 = "function GDT"
		$s3 = "function GPA"
		$s4 = "GDT @([IntPtr], [UInt32], [IntPtr], [IntPtr], [UInt32], [IntPtr]) ([IntPtr])"
		$s5 = "$marshal::GetDelegateForFunctionPointer($CTAddr, $CTDeleg)"

	condition:
		$s1 at 0 and 4 of them
}

Strings (5 patterns)

IdentifierTypeValueModifiers
$s1text"[Byte[]]$image"ascii fullword
$s2text"function GDT"
$s3text"function GPA"
$s4text"GDT @([IntPtr], [UInt32], [IntPtr], [IntPtr], [UInt32], [IntPtr]) ([IntPtr])"
$s5text"$marshal::GetDelegateForFunctionPointer($CTAddr, $CTDeleg)"

Condition

$s1 at 0 and 4 of them

In plain words (Heuristic)

  • At least 4 patterns in the rule must match.
  • Pattern $s1 must be found at offset 0.

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: 9bbe4cea-3e64-4377-bf93-def9fb629734

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE

More Koiloader rules