Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Karkoff

Detects Karkoff

MalwareKarkoffditekSHen 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 Karkoff

Associated malware family: Karkoff.

Targets: Windows PE.

It defines 8 patterns (7 text, 0 hex, 1 regex).

Summary generated from the rule's metadata and condition.

Rule source

malware-win-karkoff.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Karkoff : FILE
{
	meta:
		description = "Detects Karkoff"
		author = "ditekSHen"
		id = "7d2fe783-18b3-5d84-a9b5-e8e0b5a0db98"
		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#L5298-L5313"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "e9b6ba5be2b3cd0faa898347e57cee5a57b80b19842c3a1ddb42d620307c8b39"
		score = 75
		quality = 75
		tags = "FILE"

	strings:
		$x1 = "C:\\Windows\\Temp\\MSEx_log.txt" fullword wide
		$x2 = "CMD.exe" fullword wide
		$x3 = "Karkoff.ProjectInstaller.resources" fullword ascii
		$s1 = /try\shttp(s)?\s(ip|domain)/ fullword wide
		$s2 = "Reg cleaned!" fullword wide nocase
		$s3 = "Content-Disposition: form-data; name=\"{1}\"" fullword wide
		$s4 = "^[A-Fa-f0-9]{8}-([A-Fa-f0-9]{4}-){3}[A-Fa-f0-9]{12}$" fullword wide
		$s5 = "new backdoor" fullword wide

	condition:
		uint16( 0 ) == 0x5a4d and ( all of ( $x* ) or 4 of ( $s* ) or ( 2 of ( $x* ) and 2 of ( $s* ) ) )
}

Strings (8 patterns)

IdentifierTypeValueModifiers
$x1text"C:\\Windows\\Temp\\MSEx_log.txt"fullword wide
$x2text"CMD.exe"fullword wide
$x3text"Karkoff.ProjectInstaller.resources"fullword ascii
$s1regex/try\shttp(s)?\s(ip|domain)/fullword wide
$s2text"Reg cleaned!"fullword wide nocase
$s3text"Content-Disposition: form-data; name=\"{1}\""fullword wide
$s4text"^[A-Fa-f0-9]{8}-([A-Fa-f0-9]{4}-){3}[A-Fa-f0-9]{12}$"fullword wide
$s5text"new backdoor"fullword wide

Condition

uint16( 0 ) == 0x5a4d and ( all of ( $x* ) or 4 of ( $s* ) or ( 2 of ( $x* ) and 2 of ( $s* ) ) )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • All patterns in ( $x* ) must match.
  • At least 4 patterns in ( $s* ) must match.
  • At least 2 patterns in ( $x* ) must match.
  • At least 2 patterns in ( $s* ) 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: 7d2fe783-18b3-5d84-a9b5-e8e0b5a0db98

Tags:FILE