YARA · CAPE Sandbox (CAPEv2)
CAPE_Nighthawk
NightHawk C2
- Author
- Nikhil Ashok Hegde <@ka1do9>
- Date
- 2022-12-03
- Modified
- 2022-12-05
- Score / Quality
- 75 / 70
What this rule detects
NightHawk C2
Associated malware family: Nighthawk.
Targets: Windows PE.
It defines 3 patterns (0 text, 3 hex, 0 regex). YARA modules used: pe.
Summary generated from the rule's metadata and condition.
Rule source
Includes the imports needed to compile it on its own.
import "pe"
rule CAPE_Nighthawk
{
meta:
= "NightHawk C2"
= "Nikhil Ashok Hegde <@ka1do9>"
= "096b9d13-6aa7-5b6e-aaeb-e25aa7c8c53f"
= "2022-12-03"
= "2022-12-05"
= "https://github.com/kevoreilly/CAPEv2"
= "https://github.com/kevoreilly/CAPEv2/blob/6b15e76f28cd83fd1187da6c9aaaad2174255356/data/yara/CAPE/Nighthawk.yar#L3-L24"
= "https://github.com/kevoreilly/CAPEv2/blob/6b15e76f28cd83fd1187da6c9aaaad2174255356/LICENSE"
= "2d77912678e06503ffef0e8ed84aa4f9ac74357480d57742fbae619acebfb5f2"
= 75
= 70
= ""
= "Nighthawk Payload"
strings:
$keying_methods = { 85 C9 74 43 83 E9 01 74 1C 83 F9 01 0F 85 }
$aes_sbox = { 63 7C 77 7B F2 6B 6F C5 30 }
$aes_inv_sbox = { 52 09 6A D5 30 36 A5 38 BF }
condition:
pe.is_pe and for any s in pe.sections : ( s.name == ".profile" ) and all of them
}
Strings (3 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $keying_methods | hex | { 85 C9 74 43 83 E9 01 74 1C 83 F9 01 0F 85 } | |
| $aes_sbox | hex | { 63 7C 77 7B F2 6B 6F C5 30 } | |
| $aes_inv_sbox | hex | { 52 09 6A D5 30 36 A5 38 BF } |
Condition
pe.is_pe and for any s in pe.sections : ( s.name == ".profile" ) and all of themIn plain words (Heuristic)
- The file must start with “MZ” — a Windows executable (PE).
- All patterns in the rule must match.
- A for-loop checks a property over several matches or items.
- Uses the pe module.
- Uses the s module.
- 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.
References
Licence & attribution
Author: Nikhil Ashok Hegde <@ka1do9>
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.
Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.
Rule id: 096b9d13-6aa7-5b6e-aaeb-e25aa7c8c53f
Metadata
| cape_type | Nighthawk Payload |
|---|
Related rules
- Hack toolSignature Base (Florian Roth / Nextron)· Frank Boldewin (@r3c0nst)· 2022-11-22
- Hack toolSignature Base (Florian Roth / Nextron)· Arkbird_SOLG· 2022-11-22
- Hack toolMalpedia signator rules· Felix Bilstein - yara-signator at cocacoding dot com· 2026-05-04
- R3C0NST_Nighthawk_RATMetadata onlyHack toolFrank Boldewin (R3c0nst)· Frank Boldewin (@r3c0nst)· 2022-11-30
- MalwareSEKOIA.IO Community· Sekoia.io· 2022-11-23