Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Backdoor_Win_Blackrat

Detect Andariel's Black RAT malware

MalwareSEKOIA.IO CommunityDetection Rule License 1.1Compiles with YARA-X (with warnings)
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.

backdoor-win-blackrat.yarDetection Rule License 1.1
import "pe"
import "hash"

rule SEKOIA_Backdoor_Win_Blackrat : FILE
{
	meta:
		description = "Detect Andariel's Black RAT malware"
		author = "Sekoia.io"
		id = "3a5a6290-6344-45ce-8929-ea5a4451840f"
		date = "2023-09-04"
		modified = "2024-12-19"
		reference = "https://github.com/SEKOIA-IO/Community"
		source_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/yara_rules/backdoor_win_blackrat.yar#L4-L33"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		hash = "c2500a6e12f22b16e221ba01952b69c92278cd05632283d8b84c55c916efe27c"
		logic_hash = "4edf1335e357ebc02e4abb51cd8d808ae39e649cf19cdb3ec667c9cf313181a9"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "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)

IdentifierTypeValueModifiers
$s1text"I:/01___Tools/02__RAT/Black/Client_Go/Client.go"
$s2text"I:/01___Tools/02__RAT/Black/Client_Go/Define.go"
$s3text"I:/01___Tools/02__RAT/Black/Client_Go/Screenshot.go"
$x1text"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.

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).

  • c2500a6e12f22b16e221ba01952b69c92278cd05632283d8b84c55c916efe27c

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: 3a5a6290-6344-45ce-8929-ea5a4451840f

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE