Skip to content

YARA · SEKOIA.IO Community

SEKOIA_Rat_Win_Ratel_Strings

Detect RATel based on characteristic strings

MalwareRatelSEKOIA.IO CommunityDetection Rule License 1.1Compiles with YARA-X
Author
Sekoia.io
Date
2023-04-24
Modified
2024-12-19
Score / Quality
75 / 80

What this rule detects

Detect RATel based on characteristic strings

Associated malware family: Ratel.

Targets: Windows PE.

It defines 12 patterns (12 text, 0 hex, 0 regex).

Summary generated from the rule's metadata and condition.

Rule source

rat-win-ratel-strings.yarDetection Rule License 1.1
rule SEKOIA_Rat_Win_Ratel_Strings : FILE
{
	meta:
		description = "Detect RATel based on characteristic strings"
		author = "Sekoia.io"
		id = "d0c8b89b-c811-47aa-9e03-717998c40d91"
		date = "2023-04-24"
		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_ratel_strings.yar#L1-L28"
		license_url = "https://github.com/SEKOIA-IO/Community/blob/a438a5901a211c2abdf75da9c93921ef187473d1/LICENSE.md"
		logic_hash = "ff5640b03ec3e535cdb86c2a0feb52d0c472928ff88a36ec9f66ac8aa07c9f69"
		score = 75
		quality = 80
		tags = "FILE"
		version = "1.0"
		classification = "TLP:CLEAR"

	strings:
		$s1 = "[-] Error when changing folder." ascii
		$s2 = "cmd.exe" wide
		$s3 = "back slash find: " ascii
		$s4 = "MOD_ALL:" wide
		$s5 = "MOD_PERSISTENCE" wide
		$s6 = "MOD_DESTRUCTION:" wide
		$s7 = "MOD_RECONNECT" wide
		$s8 = "Software\\Microsoft\\Windows\\CurrentVersion\\Run" wide
		$s9 = "powershell.exe -command \"([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')\"" wide
		$s10 = "The command was executed successfully but no data was returned."
		$s11 = "[-] TIMEOUT IN CREATEPROCESS, but all the processes in the name of: " ascii
		$s12 = "we were well and truly killed." ascii

	condition:
		( uint16be( 0 ) == 0x4d5a ) and filesize > 500KB and filesize < 3MB and 8 of them
}

Strings (12 patterns)

IdentifierTypeValueModifiers
$s1text"[-] Error when changing folder."ascii
$s2text"cmd.exe"wide
$s3text"back slash find: "ascii
$s4text"MOD_ALL:"wide
$s5text"MOD_PERSISTENCE"wide
$s6text"MOD_DESTRUCTION:"wide
$s7text"MOD_RECONNECT"wide
$s8text"Software\\Microsoft\\Windows\\CurrentVersion\\Run"wide
$s9text"powershell.exe -command \"([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltI …wide
$s10text"The command was executed successfully but no data was returned."
$s11text"[-] TIMEOUT IN CREATEPROCESS, but all the processes in the name of: "ascii
$s12text"we were well and truly killed."ascii

Condition

( uint16be( 0 ) == 0x4d5a ) and filesize > 500KB and filesize < 3MB and 8 of them

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • The file must be smaller than 3MB (a cheap guard that skips large files).
  • The file must be larger than 500KB.
  • At least 8 patterns in the rule 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: 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: d0c8b89b-c811-47aa-9e03-717998c40d91

Metadata

version1.0
classificationTLP:CLEAR

Tags:FILE

More Ratel rules