Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Markirat

Detects MarkiRAT

MalwareMarkiratditekSHen 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 MarkiRAT

Associated malware family: Markirat.

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

malware-win-markirat.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Markirat : FILE
{
	meta:
		description = "Detects MarkiRAT"
		author = "ditekSHen"
		id = "6cfa276c-a64e-532a-a1ae-11a9e00867bd"
		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#L6380-L6403"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "17b8bcfe8d2b4c87ff8e0bddb436e18029a3b28a5ad3994fe9bef359588d9cad"
		score = 75
		quality = 75
		tags = "FILE"

	strings:
		$pdb = "\\mfcmklg.pdb" ascii
		$s1 = "runinhome Completed" wide
		$s2 = "ERROR find next file<br>" wide
		$s3 = "<br><mark>Hello: %s</mark>" wide
		$s4 = "<br><mark>CLIPBOARD[" wide
		$s5 = "@userhome@" wide
		$s6 = "Global\\{2194ABA1-BFFA-4e6b-8C26-D1BB20190312}" wide
		$s7 = "taskkill /im svehost.exe /t /f" fullword ascii
		$s8 = "taskkill /im keepass.exe /t /f" fullword ascii
		$ba = /bitsadmin \/(addfile|cancel|SetPriority|resume)/ ascii wide
		$c1 = "/ech/client.php?u=" wide
		$c2 = "/up/uploadx.php?u=" wide
		$c3 = "/ech/echo.php?req=rr&u=" wide
		$c4 = "/ech/rite.php" wide
		$c5 = "http://microsoft.com-view.space/i.php?u=" wide
		$c6 = "Content-Disposition: form-data; name=\"uploadedfile\"; filename=\"" ascii

	condition:
		uint16( 0 ) == 0x5a4d and ( ( $pdb and any of them ) or ( 5 of ( $s* ) ) or ( 3 of ( $c* ) ) or ( ( #ba > 3 and 4 of them ) ) )
}

Strings (16 patterns)

IdentifierTypeValueModifiers
$pdbtext"\\mfcmklg.pdb"ascii
$s1text"runinhome Completed"wide
$s2text"ERROR find next file<br>"wide
$s3text"<br><mark>Hello: %s</mark>"wide
$s4text"<br><mark>CLIPBOARD["wide
$s5text"@userhome@"wide
$s6text"Global\\{2194ABA1-BFFA-4e6b-8C26-D1BB20190312}"wide
$s7text"taskkill /im svehost.exe /t /f"fullword ascii
$s8text"taskkill /im keepass.exe /t /f"fullword ascii
$baregex/bitsadmin \/(addfile|cancel|SetPriority|resume)/ascii wide
$c1text"/ech/client.php?u="wide
$c2text"/up/uploadx.php?u="wide
$c3text"/ech/echo.php?req=rr&u="wide
$c4text"/ech/rite.php"wide
$c5text"http://microsoft.com-view.space/i.php?u="wide
$c6text"Content-Disposition: form-data; name=\"uploadedfile\"; filename=\""ascii

Condition

uint16( 0 ) == 0x5a4d and ( ( $pdb and any of them ) or ( 5 of ( $s* ) ) or ( 3 of ( $c* ) ) or ( ( #ba > 3 and 4 of them ) ) )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • At least one pattern in the rule must match.
  • At least 5 patterns in ( $s* ) must match.
  • At least 3 patterns in ( $c* ) must match.
  • At least 4 patterns in the rule must match.
  • Pattern $ba must occur > 3 times.
  • Pattern $pdb must be present.

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: 6cfa276c-a64e-532a-a1ae-11a9e00867bd

Tags:FILE