This hypothesis posits that adversaries are utilizing njRAT malware to establish persistent command-and-control channels within Azure workloads by executing malicious payloads directly in memory. Proactive hunting for this behavior is critical because, despite its current low severity classification, early identification of njRAT’s in-memory footprint allows the SOC team to mitigate potential data exfiltration and lateral movement before the threat escalates.
rule Njrat2 {
meta:
description = "detect njRAT in memory"
author = "JPCERT/CC Incident Response Group"
rule_usage = "memory scan"
hash1 = "d5f63213ce11798879520b0e9b0d1b68d55f7727758ec8c120e370699a41379d"
strings:
$reg = "SEE_MASK_NOZONECHECKS" wide fullword
$msg = "Execute ERROR" wide fullword
$ping = "cmd.exe /c ping 0 -n 2 & del" wide fullword
condition: all of them
}
This YARA rule can be deployed in the following contexts:
This rule contains 3 string patterns in its detection logic.
Here are 4 specific scenarios where the detect njRAT in memory rule may generate false positives in an enterprise environment, along with suggested filters or exclusions:
Endpoint Protection Scanning and Injection
csagent.exe, S1Service.exe, MsMpEng.exe) and the injected module path matches the vendor’s installation directory (e.g., C:\Program Files\CrowdStrike\).Software Deployment and Patching Operations
/update, /patch, or TaskName=SoftwareDeployment) and restrict detection to non-business hours if these jobs are scheduled nightly.Remote Desktop and Virtualization Infrastructure