Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Klingonrat

Detects KlingonRAT

MalwareKlingonratditekSHen 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 KlingonRAT

Associated malware family: Klingonrat.

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

malware-win-klingonrat.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Klingonrat : FILE
{
	meta:
		description = "Detects KlingonRAT"
		author = "ditekSHen"
		id = "bea50bce-b38c-50a0-902a-1014615bd9b8"
		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#L6405-L6427"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "2abfbfc1b67f931f15bfdfd2cd4ba7821e62eb8c518bbc04629c0dd694bbd9c1"
		score = 75
		quality = 75
		tags = "FILE"

	strings:
		$go = "Go build ID:" ascii
		$s1 = "/UCRelease/src/client/uac/once/"
		$s2 = "%T\\AppData\\Local\\Windows Update\\"
		$s3 = "%TSoftware\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\"
		$s4 = "wmic /namespace:'\\\\root\\subscription' PATH"
		$s5 = "C:\\Windows\\System32\\fodhelper.exeCaption,ParentProcessId,ProcessId"
		$s6 = "ldpro.exelsass.exeluall.exeluspt.exe"
		$s7 = "scangui.exedeps/lsass.exeetrustcipe.exefile"
		$s8 = "alogserv.exeaplica32.exeapvxdwin.exeatro55en.exeautodown.exeavconsol.exeavgserv9.exeavkwctl9.exeavltmain.exeavpdos32.exeavsynmgr.exeavwupd32.exeavwupsrv.exe"
		$c1 = "%s/keyLogger?machineId=%s" ascii
		$c2 = "%s/stealer?machineId=%s" ascii
		$c3 = "%s/lsass?machineId=%s" ascii
		$c4 = "%s/logger?machineId=%s" ascii
		$c5 = "%s/machineInfo?machineId=%s" ascii
		$c6 = "failurehttps://%s:%d/botif-modified-sinceillegal" ascii

	condition:
		uint16( 0 ) == 0x5a4d and ( $go ) and ( 3 of ( $c* ) or 5 of ( $s* ) or ( 3 of ( $s* ) and 1 of ( $c* ) ) )
}

Strings (15 patterns)

IdentifierTypeValueModifiers
$gotext"Go build ID:"ascii
$s1text"/UCRelease/src/client/uac/once/"
$s2text"%T\\AppData\\Local\\Windows Update\\"
$s3text"%TSoftware\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\"
$s4text"wmic /namespace:'\\\\root\\subscription' PATH"
$s5text"C:\\Windows\\System32\\fodhelper.exeCaption,ParentProcessId,ProcessId"
$s6text"ldpro.exelsass.exeluall.exeluspt.exe"
$s7text"scangui.exedeps/lsass.exeetrustcipe.exefile"
$s8text"alogserv.exeaplica32.exeapvxdwin.exeatro55en.exeautodown.exeavconsol.exeavgserv9.exeavkwctl9.exeavltmain.exeavpdos32.exeavsynmgr.exeavwupd32.exeavwupsrv.exe"
$c1text"%s/keyLogger?machineId=%s"ascii
$c2text"%s/stealer?machineId=%s"ascii
$c3text"%s/lsass?machineId=%s"ascii
$c4text"%s/logger?machineId=%s"ascii
$c5text"%s/machineInfo?machineId=%s"ascii
$c6text"failurehttps://%s:%d/botif-modified-sinceillegal"ascii

Condition

uint16( 0 ) == 0x5a4d and ( $go ) and ( 3 of ( $c* ) or 5 of ( $s* ) or ( 3 of ( $s* ) and 1 of ( $c* ) ) )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • At least 3 patterns in ( $c* ) must match.
  • At least 5 patterns in ( $s* ) must match.
  • At least 3 patterns in ( $s* ) must match.
  • At least 1 patterns in ( $c* ) 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: bea50bce-b38c-50a0-902a-1014615bd9b8

Tags:FILE