Skip to content

YARA · ditekSHen detection

DITEKSHEN_MALWARE_Win_Gravityrat

Detects GravityRAT

MalwareGravityratditekSHen 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 GravityRAT

Associated malware family: Gravityrat.

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-gravityrat.yarBSD 2-Clause License
rule DITEKSHEN_MALWARE_Win_Gravityrat : FILE
{
	meta:
		description = "Detects GravityRAT"
		author = "ditekSHen"
		id = "cb581dd6-15b2-54ae-9f27-30ec21554fb9"
		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#L6086-L6108"
		license_url = "https://github.com/ditekshen/detection/blob/e76c93dcdedff04076380ffc60ea54e45b313635/LICENSE.txt"
		logic_hash = "a6b049dbf21f22f751c15da98536e9ef2a4ced7755ade0cc9904afddef1d3ae6"
		score = 75
		quality = 75
		tags = "FILE"

	strings:
		$s1 = "/GX/GX-Server.php?VALUE=2&Type=" wide
		$s2 = "&SIGNATUREHASH=" wide
		$s3 = "Error => CommonFunctionClass => Upload()" wide
		$s4 = "/GetActiveDomains.php" wide
		$s5 = "DetectVM" ascii wide
		$s6 = "/c {0} > {1}" wide
		$s7 = "DRIVEUPLOADCOMPLETED => TOTALFILES={0}, FILESUPLOADED={1}" wide
		$s8 = "Program => RunAFile()" wide
		$s9 = "DoViaCmd" ascii
		$s10 = ".msoftupdates.com:" wide
		$f1 = "<RootJob>b__" ascii
		$f2 = "<GetFiles>b__" ascii
		$f3 = "<UpdateServer>b__" ascii
		$f4 = "<EthernetId>b__" ascii
		$f5 = "<MatchMacAdd>b__" ascii

	condition:
		uint16( 0 ) == 0x5a4d and ( 5 of ( $s* ) or ( all of ( $f* ) and 1 of ( $s* ) ) )
}

Strings (15 patterns)

IdentifierTypeValueModifiers
$s1text"/GX/GX-Server.php?VALUE=2&Type="wide
$s2text"&SIGNATUREHASH="wide
$s3text"Error => CommonFunctionClass => Upload()"wide
$s4text"/GetActiveDomains.php"wide
$s5text"DetectVM"ascii wide
$s6text"/c {0} > {1}"wide
$s7text"DRIVEUPLOADCOMPLETED => TOTALFILES={0}, FILESUPLOADED={1}"wide
$s8text"Program => RunAFile()"wide
$s9text"DoViaCmd"ascii
$s10text".msoftupdates.com:"wide
$f1text"<RootJob>b__"ascii
$f2text"<GetFiles>b__"ascii
$f3text"<UpdateServer>b__"ascii
$f4text"<EthernetId>b__"ascii
$f5text"<MatchMacAdd>b__"ascii

Condition

uint16( 0 ) == 0x5a4d and ( 5 of ( $s* ) or ( all of ( $f* ) and 1 of ( $s* ) ) )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • All patterns in ( $f* ) must match.
  • At least 5 patterns in ( $s* ) must match.
  • At least 1 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: cb581dd6-15b2-54ae-9f27-30ec21554fb9

Tags:FILE