Skip to content

YARA · CAPE Sandbox (CAPEv2)

CAPE_Quasarrat

QuasarRAT payload

GenericCAPE Sandbox (CAPEv2)GNU General Public License v3.0Compiles with YARA-X
Author
ditekshen
Date
2024-10-09
Modified
2025-02-03
Score / Quality
75 / 70

What this rule detects

QuasarRAT payload

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

quasarrat.yarGNU General Public License v3.0
rule CAPE_Quasarrat : FILE
{
	meta:
		description = "QuasarRAT payload"
		author = "ditekshen"
		id = "f256b88f-eee6-5f8c-afd6-32ed10ea908d"
		date = "2024-10-09"
		modified = "2025-02-03"
		reference = "https://github.com/kevoreilly/CAPEv2"
		source_url = "https://github.com/kevoreilly/CAPEv2/blob/6b15e76f28cd83fd1187da6c9aaaad2174255356/data/yara/CAPE/AsyncRAT.yar#L245-L266"
		license_url = "https://github.com/kevoreilly/CAPEv2/blob/6b15e76f28cd83fd1187da6c9aaaad2174255356/LICENSE"
		logic_hash = "556b19dc0980761198ea31a285f281adae084463d24bff1eda15326436ad562b"
		score = 75
		quality = 70
		tags = "FILE"
		cape_type = "QuasarRAT Payload"

	strings:
		$s1 = "GetKeyloggerLogsResponse" fullword ascii
		$s2 = "GetKeyloggerLogs" fullword ascii
		$s3 = "/>Log created on" wide
		$s4 = "User: {0}{3}Pass: {1}{3}Host: {2}" wide
		$s5 = "Domain: {1}{0}Cookie Name: {2}{0}Value: {3}{0}Path: {4}{0}Expired: {5}{0}HttpOnly: {6}{0}Secure: {7}" wide
		$s6 = "grabber_" wide
		$s7 = "<virtualKeyCode>" ascii
		$s8 = "<RunHidden>k__BackingField" fullword ascii
		$s9 = "<keyboardHookStruct>" ascii
		$s10 = "add_OnHotKeysDown" ascii
		$mutex = "QSR_MUTEX_" ascii wide
		$ua1 = "Mozilla/5.0 (Windows NT 6.3; rv:48.0) Gecko/20100101 Firefox/48.0" fullword wide
		$us2 = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A" fullword wide

	condition:
		uint16( 0 ) == 0x5a4d and ( $mutex or ( all of ( $ua* ) and 2 of them ) or 6 of ( $s* ) )
}

Strings (13 patterns)

IdentifierTypeValueModifiers
$s1text"GetKeyloggerLogsResponse"fullword ascii
$s2text"GetKeyloggerLogs"fullword ascii
$s3text"/>Log created on"wide
$s4text"User: {0}{3}Pass: {1}{3}Host: {2}"wide
$s5text"Domain: {1}{0}Cookie Name: {2}{0}Value: {3}{0}Path: {4}{0}Expired: {5}{0}HttpOnly: {6}{0}Secure: {7}"wide
$s6text"grabber_"wide
$s7text"<virtualKeyCode>"ascii
$s8text"<RunHidden>k__BackingField"fullword ascii
$s9text"<keyboardHookStruct>"ascii
$s10text"add_OnHotKeysDown"ascii
$mutextext"QSR_MUTEX_"ascii wide
$ua1text"Mozilla/5.0 (Windows NT 6.3; rv:48.0) Gecko/20100101 Firefox/48.0"fullword wide
$us2text"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A"fullword wide

Condition

uint16( 0 ) == 0x5a4d and ( $mutex or ( all of ( $ua* ) and 2 of them ) or 6 of ( $s* ) )

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • All patterns in ( $ua* ) must match.
  • At least 2 patterns in the rule must match.
  • At least 6 patterns in ( $s* ) must match.
  • Pattern $mutex must be present.

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: ditekshen

Source repository: CAPE Sandbox (CAPEv2) @ 6b15e76f28

Licence: GNU General Public License v3.0 (repository licence)

Copyright notice: Cuckoo Sandbox is copyrighted by the Cuckoo Foundation.

Original rule

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

Rule id: f256b88f-eee6-5f8c-afd6-32ed10ea908d

Metadata

cape_typeQuasarRAT Payload

Tags:FILE