This hypothesis posits that adversaries are embedding JavaScript files within RAR archives to execute malicious payloads while evading standard static analysis of common container formats. Proactive hunting for this pattern in Azure Sentinel is critical to identify early-stage supply chain compromises or phishing campaigns that leverage the low-severity nature of RAR containers to bypass initial alert thresholds.
rule rar_with_js
{
strings:
$h1 = "Rar!"
$s1 = ".js" nocase
condition:
$h1 at 0 and $s1
}
This YARA rule can be deployed in the following contexts:
This rule contains 2 string patterns in its detection logic.
Here are 4 specific false positive scenarios for the rar_with_js detection rule in an enterprise environment, along with suggested filters or exclusions:
Scenario: Automated Software Deployment via SCCM/Intune
.rar archives containing embedded JavaScript for pre-installation checks, language selection, or silent installation logic. These are legitimate administrative tasks triggered by scheduled maintenance windows.System, Network Service) and specific executable paths such as C:\Program Files\Microsoft Configuration Manager\bin\x64\ccmsetup.exe or C:\Windows\System32\smstsip.exe. Additionally, filter by file hashes of known good distribution points.Scenario: Legacy Financial Reporting Tools (e.g., SAP Crystal Reports)
.rar formats that utilize embedded JavaScript for dynamic chart rendering, interactive drill-downs, and data validation within the report viewer. This is common during end-of-month financial closing cycles.CrystalReport.exe, SAP_BI_Server.exe) running under specific service accounts (e.g., svc_finance_reports). You may also whitelist file paths located in dedicated data directories like D:\Reports\Generated\ where these archives are routinely created and consumed.Scenario: IT Asset Management Scans (e.g., Lansweeper or ManageEngine)