Skip to content

YARA · BlackBerry Research & Intelligence (via Open-Source-YARA-rules)

BLACKBERRY_Boratratkeylogger

Detects BoratRAT Keylogger

MalwareBlackBerry Research & Intelligence (via Open-Source-YARA-rules)Apache License 2.0Compiles with YARA-X (with warnings)
Author
BlackBerry Threat Research Team
Date
2022-04-13
Modified
2022-07-07
Score / Quality
75 / 85

What this rule detects

Detects BoratRAT Keylogger

Targets: Windows PE.

It defines 6 patterns (5 text, 1 hex, 0 regex).

YARA-X says: warning[text_as_hex]: hex pattern could be written as text literal

Summary generated from the rule's metadata and condition.

Rule source

boratratkeylogger.yarApache License 2.0
rule BLACKBERRY_Boratratkeylogger : FILE
{
	meta:
		description = "Detects BoratRAT Keylogger"
		author = "BlackBerry Threat Research Team"
		id = "8bcec652-a76b-5bfc-bf2c-bb8ce6a88ed5"
		date = "2022-04-13"
		modified = "2022-07-07"
		reference = "https://blogs.blackberry.com/en/2022/04/threat-thursday-boratrat"
		source_url = "https://github.com/mikesxrs/Open-Source-YARA-rules/blob/ec0056f767db98bf6d5fd63877ad51fb54d350e9/Blackberry/BoratRATKeylogger.yar#L1-L39"
		license_url = "N/A"
		logic_hash = "ea3f39b675f02274b19b5732d065a0fcb05a4fe150f10a452a844af71b69aed2"
		score = 75
		quality = 85
		tags = "FILE"
		license = "This Yara rule is provided under the Apache License 2.0   (https://www.apache.org/licenses/LICENSE-2.0) and open to any user or organization, as long as you use it under this license and ensure originator credit in any derivative to The BlackBerry Research & Intelligence Team"

	strings:
		$s1 = "Sa8XOfH1BudXLog.txt" wide
		$s2 = "[CAPSLOCK: ON]" wide
		$s3 = "[CAPSLOCK: OFF]" wide
		$s4 = "[SPACE]" wide
		$s5 = "[ENTER]" wide
		$sp = { 43 3A 5C 55 73 65 72 73 5C 41 64 6D 69 6E 69 73 74 72 61 74 6F 72 5C

                    44 6F 77 6E 6C 6F 61 64 73 5C 53 61 6E 74 61 52 61 74 2D 6D 61 69 6E 

                    5C 42 69 6E 61 72 69 65 73 5C 52 65 6C 65 61 73 65 5C 50 6C 75 67 69 

                    6E 73 5C 4B 65 79 6C 6F 67 67 65 72 2E 70 64 62 }

	condition:
		uint16( 0 ) == 0x5a4d and all of them
}

Strings (6 patterns)

IdentifierTypeValueModifiers
$s1text"Sa8XOfH1BudXLog.txt"wide
$s2text"[CAPSLOCK: ON]"wide
$s3text"[CAPSLOCK: OFF]"wide
$s4text"[SPACE]"wide
$s5text"[ENTER]"wide
$sphex{ 43 3A 5C 55 73 65 72 73 5C 41 64 6D 69 6E 69 73 74 72 61 74 6F 72 5C 44 6F 77 6E 6C 6F 61 64 73 5C 53 61 6E 74 61 52 61 74 2D 6D 61 69 6E …

Condition

uint16( 0 ) == 0x5a4d and all of them

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • All 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: BlackBerry Threat Research Team

Source repository: BlackBerry Research & Intelligence (via Open-Source-YARA-rules) @ ec0056f767

Licence: Apache License 2.0 (stated in the rule's own meta)

“This Yara rule is provided under the Apache License 2.0 (https://www.apache.org/licenses/LICENSE-2.0) and open to any user or organization, as long as you use it under this license and ensure originator credit in any derivative to The BlackBerry Research & Intelligence Team”

Original rule

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

Rule id: 8bcec652-a76b-5bfc-bf2c-bb8ce6a88ed5

Tags:FILE