Skip to content

YARA · CAPE Sandbox (CAPEv2)

CAPE_Nightshadec2

NightshadeC2 AKA CastleRAT - https://x.com/YungBinary/status/1963751038340534482

MalwareNightshade C2CAPE Sandbox (CAPEv2)GNU General Public License v3.0Compiles with YARA-X
Author
YungBinary
Date
2025-09-04
Modified
2025-09-12
Score / Quality
75 / 70

What this rule detects

NightshadeC2 AKA CastleRAT - https://x.com/YungBinary/status/1963751038340534482

Associated malware family: Nightshade C2.

Targets: Windows PE.

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

Summary generated from the rule's metadata and condition.

Rule source

nightshadec2.yarGNU General Public License v3.0
rule CAPE_Nightshadec2 : FILE
{
	meta:
		description = "NightshadeC2 AKA CastleRAT - https://x.com/YungBinary/status/1963751038340534482"
		author = "YungBinary"
		id = "d70f9051-c7ab-537a-ab80-03ae7ef80b81"
		date = "2025-09-04"
		modified = "2025-09-12"
		reference = "https://github.com/kevoreilly/CAPEv2"
		source_url = "https://github.com/kevoreilly/CAPEv2/blob/6b15e76f28cd83fd1187da6c9aaaad2174255356/data/yara/CAPE/NightshadeC2.yar#L1-L20"
		license_url = "https://github.com/kevoreilly/CAPEv2/blob/6b15e76f28cd83fd1187da6c9aaaad2174255356/LICENSE"
		hash = "963c012d56c62093d105ab5044517fdcce4ab826f7782b3e377932da1df6896d"
		logic_hash = "f9fabc391e21180a1c92abea0a5ded6d7669e8d8f2330b69d6c1227c9b4237a0"
		score = 75
		quality = 70
		tags = "FILE"
		cape_type = "NightshadeC2 Payload"

	strings:
		$s1 = "keylog.txt" fullword wide
		$s2 = "\"%ws\" --mute-audio --do-not-de-elevate" fullword wide
		$s3 = "\"%ws\" -no-deelevate" fullword wide
		$s4 = "MachineGuid" fullword wide
		$s5 = "www.ip-api.com" fullword wide
		$s6 = "rundll32 \"C:\\Windows\\System32\\shell32.dll\" #61" fullword wide
		$s7 = "IsabellaWine" fullword wide
		$s8 = "Shell_TrayWnd" fullword wide

	condition:
		uint16( 0 ) == 0x5A4D and 3 of them
}

Strings (8 patterns)

IdentifierTypeValueModifiers
$s1text"keylog.txt"fullword wide
$s2text"\"%ws\" --mute-audio --do-not-de-elevate"fullword wide
$s3text"\"%ws\" -no-deelevate"fullword wide
$s4text"MachineGuid"fullword wide
$s5text"www.ip-api.com"fullword wide
$s6text"rundll32 \"C:\\Windows\\System32\\shell32.dll\" #61"fullword wide
$s7text"IsabellaWine"fullword wide
$s8text"Shell_TrayWnd"fullword wide

Condition

uint16( 0 ) == 0x5A4D and 3 of them

In plain words (Heuristic)

  • The file must start with “MZ” — a Windows executable (PE).
  • At least 3 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

Sample hashes

Hashes of samples the author lists in the rule's meta (look them up in your threat-intelligence platform).

  • 963c012d56c62093d105ab5044517fdcce4ab826f7782b3e377932da1df6896d

Licence & attribution

Author: YungBinary

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: d70f9051-c7ab-537a-ab80-03ae7ef80b81

Metadata

cape_typeNightshadeC2 Payload

Tags:FILE