YARA · SEKOIA.IO Community
SEKOIA_Backdoor_Win_Blackrat
Detect Andariel's Black RAT malware
- Author
- Sekoia.io
- Date
- 2023-09-04
- Modified
- 2024-12-19
- Score / Quality
- 75 / 80
What this rule detects
Detect Andariel's Black RAT malware
Targets: Windows PE.
It defines 4 patterns (4 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_Backdoor_Win_Blackrat : FILE
{
meta:
= "Detect Andariel's Black RAT malware"
= "Sekoia.io"
= "3a5a6290-6344-45ce-8929-ea5a4451840f"
= "2023-09-04"
= "2024-12-19"
= "https://github.com/SEKOIA-IO/Community"
= "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/backdoor_win_blackrat.yar#L4-L33"
= "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
= "c2500a6e12f22b16e221ba01952b69c92278cd05632283d8b84c55c916efe27c"
= "4edf1335e357ebc02e4abb51cd8d808ae39e649cf19cdb3ec667c9cf313181a9"
= 75
= 80
= "FILE"
= "1.0"
= "TLP:CLEAR"
strings:
$s1 = "I:/01___Tools/02__RAT/Black/Client_Go/Client.go"
$s2 = "I:/01___Tools/02__RAT/Black/Client_Go/Define.go"
$s3 = "I:/01___Tools/02__RAT/Black/Client_Go/Screenshot.go"
$x1 = "RAT/Black/Client"
condition:
uint16be( 0 ) == 0x4d5a and ( all of ( $s* ) or #x1 >= 3 ) 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 ) == "74c4cdc9d33fc63aee7ae9659b6f8d24" or hash.md5 ( pe.sections [ i ] . raw_data_offset , pe.sections [ i ] . raw_data_size ) == "298948afbe85985025e176605ee21176" or hash.md5 ( pe.sections [ i ] . raw_data_offset , pe.sections [ i ] . raw_data_size ) == "e5ca54c5def3c7a950e6d4034dc86277" or hash.md5 ( pe.sections [ i ] . raw_data_offset , pe.sections [ i ] . raw_data_size ) == "440ae899aea859458df5b6de7dbc5b34" or hash.md5 ( pe.sections [ i ] . raw_data_offset , pe.sections [ i ] . raw_data_size ) == "98e46f76b965ffb58f6cd53ff8dc91c0" )
}
Strings (4 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $s1 | text | "I:/01___Tools/02__RAT/Black/Client_Go/Client.go" | |
| $s2 | text | "I:/01___Tools/02__RAT/Black/Client_Go/Define.go" | |
| $s3 | text | "I:/01___Tools/02__RAT/Black/Client_Go/Screenshot.go" | |
| $x1 | text | "RAT/Black/Client" |
Condition
uint16be( 0 ) == 0x4d5a and ( all of ( $s* ) or #x1 >= 3 ) 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 ) == "74c4cdc9d33fc63aee7ae9659b6f8d24" or hash.md5 ( pe.sections [ i ] . raw_data_offset , pe.sections [ i ] . raw_data_size ) == "298948afbe85985025e176605ee21176" or hash.md5 ( pe.sections [ i ] . raw_data_offset , pe.sections [ i ] . raw_data_size ) == "e5ca54c5def3c7a950e6d4034dc86277" or hash.md5 ( pe.sections [ i ] . raw_data_offset , pe.sections [ i ] . raw_data_size ) == "440ae899aea859458df5b6de7dbc5b34" or hash.md5 ( pe.sections [ i ] . raw_data_offset , pe.sections [ i ] . raw_data_size ) == "98e46f76b965ffb58f6cd53ff8dc91c0" )In plain words (Heuristic)
- The file must start with “MZ” — a Windows executable (PE).
- All patterns in ( $s* ) must match.
- Pattern $x1 must occur >= 3 times.
- 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).
- c2500a6e12f22b16e221ba01952b69c92278cd05632283d8b84c55c916efe27c
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: 3a5a6290-6344-45ce-8929-ea5a4451840f
Metadata
| version | 1.0 |
|---|---|
| classification | TLP:CLEAR |
Tags:FILE
Related rules
- 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
- MalwareSEKOIA.IO Community· Sekoia.io· 2024-03-20
- MalwareSEKOIA.IO Community· Sekoia.io· 2024-03-20
- MalwareSEKOIA.IO Community· Sekoia.io· 2024-03-20