Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Rat_Win_Ninerat

Detect the NineRAT payload

MalwareNineratSEKOIA.IO CommunityDetection Rule License 1.1Compiles with YARA-X (with warnings)
Author
Sekoia.io
Date
2023-12-12
Modified
2024-12-19
Score / Quality
75 / 80

What this rule detects

Detect the NineRAT payload

Associated malware family: Ninerat.

Targets: Windows PE.

It defines 6 patterns (6 text, 0 hex, 0 regex). YARA modules used: pe, hash.

YARA-X says: warning[deprecated_field]: field `number_of_sections` is deprecated

Summary generated from the rule's metadata and condition.

Rule source

Includes the imports needed to compile it on its own.

rat-win-ninerat.yarDetection Rule License 1.1
import "pe"
import "hash"

rule SEKOIA_Rat_Win_Ninerat
{
	meta:
		description = "Detect the NineRAT payload"
		author = "Sekoia.io"
		id = "a9f4f78b-5b86-4ac1-9b9b-ba2672b938bf"
		date = "2023-12-12"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/rat_win_ninerat.yar#L4-L31"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		hash = "47e017b40d418374c0889e4d22aa48633b1d41b16b61b1f2897a39112a435d30"
		hash = "82d4a0fef550af4f01a07041c16d851f262d859a3352475c62630e2c16a21def"
		logic_hash = "bbb695444a6ec0d6049d0ce233ca37de6f78393e5ceb5d454867c8b554269684"
		score = 75
		quality = 80
		tags = ""
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$ = "https://api.telegram.org/bot"
		$ = "/getMe"
		$ = "/upgrade"
		$ = "/getFile"
		$ = "/sendMessage"
		$ = ">> Request send time:"

	condition:
		all of them or for any i in ( 0 .. pe.number_of_sections -1 ) : ( hash.md5 ( pe.sections [ i ] . raw_data_offset , pe.sections [ i ] . raw_data_size ) == "3ce78c89e2c0e795ad3382aa12e99683" )
}

Strings (6 patterns)

IdentifierTypeValueModifiers
$text"https://api.telegram.org/bot"
$text"/getMe"
$text"/upgrade"
$text"/getFile"
$text"/sendMessage"
$text">> Request send time:"

Condition

all of them or for any i in ( 0 .. pe.number_of_sections -1 ) : ( hash.md5 ( pe.sections [ i ] . raw_data_offset , pe.sections [ i ] . raw_data_size ) == "3ce78c89e2c0e795ad3382aa12e99683" )

In plain words (Heuristic)

  • All patterns in the rule must match.
  • A for-loop checks a property over several matches or items.
  • Uses the pe module.
  • Uses the hash module.
  • Compares a hash of the file or a part of it.
  • Checks PE sections (names, count or properties).

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

Sample hashes

Hashes of samples the author lists in the rule's meta (look them up in your threat-intelligence platform).

  • 47e017b40d418374c0889e4d22aa48633b1d41b16b61b1f2897a39112a435d30
  • 82d4a0fef550af4f01a07041c16d851f262d859a3352475c62630e2c16a21def

Licence & attribution

Author: Sekoia.io

Source repository: SEKOIA.IO Community @ a438a5901a

Licence: Detection Rule License 1.1 (repository licence)

Original rule

Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.

Rule id: a9f4f78b-5b86-4ac1-9b9b-ba2672b938bf

Metadata

version1.0
classificationTLP:CLEAR

More Ninerat rules