Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Pcrat

Detects PCRat / Gh0st

MalwarePcratditekSHen 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 PCRat / Gh0st

Associated malware family: Pcrat.

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

malware-win-pcrat.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Pcrat : FILE
{
	meta:
		description = "Detects PCRat / Gh0st"
		author = "ditekSHen"
		id = "de5b3e08-16da-56e2-a0a4-d8bed5840804"
		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#L8534-L8561"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "ad56d7d6a2bb6d09bc4530c31b51456b6bbca5def1810449fd2a31973cce18f8"
		score = 75
		quality = 75
		tags = "FILE"

	strings:
		$s1 = "ClearEventLogA" fullword ascii
		$s2 = "NetUserAdd" fullword ascii
		$s3 = "<H1>403 Forbidden</H1>" fullword ascii
		$s4 = ":]%d-%d-%d  %d:%d:%d" fullword ascii
		$s5 = "Mozilla/4.0 (compatible)" fullword ascii
		$s6 = "<Enter>" fullword ascii
		$s7 = "\\cmd.exe" fullword ascii
		$s8 = "Program Files\\Internet Explorer\\IEXPLORE.EXE" fullword ascii
		$s9 = "Collegesoft ScenicPlayer" fullword wide
		$a1 = "360tray.exe" fullword ascii
		$a2 = "avp.exe" fullword ascii
		$a3 = "RavMonD.exe" fullword ascii
		$a4 = "360sd.exe" fullword ascii
		$a5 = "Mcshield.exe" fullword ascii
		$a6 = "egui.exe" fullword ascii
		$a7 = "kxetray.exe" fullword ascii
		$a8 = "knsdtray.exe" fullword ascii
		$a9 = "TMBMSRV.exe" fullword ascii
		$a10 = "avcenter.exe" fullword ascii
		$a11 = "ashDisp.exe" fullword ascii

	condition:
		uint16( 0 ) == 0x5a4d and 5 of ( $s* ) and 6 of ( $a* )
}

Strings (20 patterns)

IdentifierTypeValueModifiers
$s1text"ClearEventLogA"fullword ascii
$s2text"NetUserAdd"fullword ascii
$s3text"<H1>403 Forbidden</H1>"fullword ascii
$s4text":]%d-%d-%d %d:%d:%d"fullword ascii
$s5text"Mozilla/4.0 (compatible)"fullword ascii
$s6text"<Enter>"fullword ascii
$s7text"\\cmd.exe"fullword ascii
$s8text"Program Files\\Internet Explorer\\IEXPLORE.EXE"fullword ascii
$s9text"Collegesoft ScenicPlayer"fullword wide
$a1text"360tray.exe"fullword ascii
$a2text"avp.exe"fullword ascii
$a3text"RavMonD.exe"fullword ascii
$a4text"360sd.exe"fullword ascii
$a5text"Mcshield.exe"fullword ascii
$a6text"egui.exe"fullword ascii
$a7text"kxetray.exe"fullword ascii
$a8text"knsdtray.exe"fullword ascii
$a9text"TMBMSRV.exe"fullword ascii
$a10text"avcenter.exe"fullword ascii
$a11text"ashDisp.exe"fullword ascii

Condition

uint16( 0 ) == 0x5a4d and 5 of ( $s* ) and 6 of ( $a* )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • At least 5 patterns in ( $s* ) must match.
  • At least 6 patterns in ( $a* ) 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: de5b3e08-16da-56e2-a0a4-d8bed5840804

Tags:FILE