Skip to content

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

BLACKBERRY_Mal_Infostealer_Win32_Blackguard

Detects W32 BlackGuard Infostealer

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-14
Modified
2022-07-06
Score / Quality
75 / 85

What this rule detects

Detects W32 BlackGuard Infostealer

Targets: Windows PE.

It defines 15 patterns (14 text, 1 hex, 0 regex). YARA modules used: pe.

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.

mal-infostealer-win32-blackguard.yarApache License 2.0
import "pe"

rule BLACKBERRY_Mal_Infostealer_Win32_Blackguard : FILE
{
	meta:
		description = "Detects W32 BlackGuard Infostealer"
		author = "BlackBerry Threat Research team "
		id = "e079de0f-c607-5089-b385-ba67ed2cb73e"
		date = "2022-04-14"
		modified = "2022-07-06"
		reference = "https://blogs.blackberry.com/en/2022/04/threat-thursday-blackguard-infostealer"
		source_url = "https://github.com/mikesxrs/Open-Source-YARA-rules/blob/ec0056f767db98bf6d5fd63877ad51fb54d350e9/Blackberry/Mal_Infostealer_Win32_BlackGuard.yar#L3-L39"
		license_url = "N/A"
		hash = "6ab3b21fa7cb638ed68509be1ed6302284e8a9cd1a10f9b6837c057154aa6162"
		logic_hash = "6e819ee656b6d696be1e818eeb8a545e7934c1f5a1171a1192422d8c74c0caa2"
		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:
		$a1 = { 06 91 06 61 20 AA 00 00 00 61 D2 9C 06 17 58 0A }
		$a2 = "System.Data.SQLite"
		$a3 = "FromBase64String"
		$a4 = "BlockInput"
		$a5 = "UploadFile"
		$a6 = "Passwords"
		$a7 = "Discord"
		$a8 = "GetVolumeInformationA"
		$a9 = "NordVPN"
		$a10 = "OpenVPN"
		$a11 = "ProtonVPN"
		$a12 = "OperaCookies"
		$a13 = "EdgeCookies"
		$a14 = "ChromeCookies"
		$b1 = "upche" wide

	condition:
		uint16( 0 ) == 0x5a4d and pe.imphash ( ) == "f34d5f2d4577ed6d9ceec516c1f5a744" and pe.number_of_sections == 3 and pe.section_index ( ".text" ) == 0 and pe.section_index ( ".rsrc" ) == 1 and pe.section_index ( ".reloc" ) == 2 and ( ( all of ( $a* ) ) or ( ( 12 of ( $a* ) and all of ( $b* ) ) ) )
}

Strings (15 patterns)

IdentifierTypeValueModifiers
$a1hex{ 06 91 06 61 20 AA 00 00 00 61 D2 9C 06 17 58 0A }
$a2text"System.Data.SQLite"
$a3text"FromBase64String"
$a4text"BlockInput"
$a5text"UploadFile"
$a6text"Passwords"
$a7text"Discord"
$a8text"GetVolumeInformationA"
$a9text"NordVPN"
$a10text"OpenVPN"
$a11text"ProtonVPN"
$a12text"OperaCookies"
$a13text"EdgeCookies"
$a14text"ChromeCookies"
$b1text"upche"wide

Condition

uint16( 0 ) == 0x5a4d and pe.imphash ( ) == "f34d5f2d4577ed6d9ceec516c1f5a744" and pe.number_of_sections == 3 and pe.section_index ( ".text" ) == 0 and pe.section_index ( ".rsrc" ) == 1 and pe.section_index ( ".reloc" ) == 2 and ( ( all of ( $a* ) ) or ( ( 12 of ( $a* ) and all of ( $b* ) ) ) )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • All patterns in ( $a* ) must match.
  • All patterns in ( $b* ) must match.
  • At least 12 patterns in ( $a* ) must match.
  • Uses the pe module.
  • Checks the PE import hash (imphash).
  • 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).

  • 6ab3b21fa7cb638ed68509be1ed6302284e8a9cd1a10f9b6837c057154aa6162

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: e079de0f-c607-5089-b385-ba67ed2cb73e

Tags:FILE