YARA · SEKOIA.IO Community
SEKOIA_Rat_Win_Ninerat
Detect the NineRAT payload
- 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.
import "pe"
import "hash"
rule SEKOIA_Rat_Win_Ninerat
{
meta:
= "Detect the NineRAT payload"
= "Sekoia.io"
= "a9f4f78b-5b86-4ac1-9b9b-ba2672b938bf"
= "2023-12-12"
= "2024-12-19"
= "https://github.com/SEKOIA-IO/Community"
= "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/rat_win_ninerat.yar#L4-L31"
= "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
= "47e017b40d418374c0889e4d22aa48633b1d41b16b61b1f2897a39112a435d30"
= "82d4a0fef550af4f01a07041c16d851f262d859a3352475c62630e2c16a21def"
= "bbb695444a6ec0d6049d0ce233ca37de6f78393e5ceb5d454867c8b554269684"
= 75
= 80
= ""
= "1.0"
= "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)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $ | 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.
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)
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
| version | 1.0 |
|---|---|
| classification | TLP:CLEAR |
Related rules
- MalwareSEKOIA.IO Community· Sekoia.io· 2023-12-12
- MalwareSEKOIA.IO Community· Sekoia.io· 2023-12-12
- MalwareMalpedia signator rules· Felix Bilstein - yara-signator at cocacoding dot com· 2026-05-04
- MalwareSEKOIA.IO Community· Sekoia.io· 2024-07-16
- MalwareSEKOIA.IO Community· Sekoia.io· 2024-08-23
- MalwareSEKOIA.IO Community· Sekoia.io· 2024-04-22
- MalwareSEKOIA.IO Community· Sekoia.io· 2024-07-23
- MalwareSEKOIA.IO Community· Sekoia.io· 2024-10-20