← Back to SOC feed Coverage →

JavaScript Obfuscation Detection

yara LOW Yara-Rules
communityevasion
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Yara-Rules →
Retrieved: 2026-07-31T23:00:00Z · Confidence: medium

Hunt Hypothesis

This hunt hypothesis targets adversaries who employ complex JavaScript obfuscation techniques within web applications or browser environments to conceal malicious payloads and evade signature-based security controls. A SOC team should proactively hunt for this behavior in Azure Sentinel because obfuscated scripts often serve as the initial entry point for fileless attacks, allowing attackers to execute stealthy commands that traditional static analysis might overlook.

YARA Rule

rule generic_javascript_obfuscation
{
meta:
	author = "Josh Berry"
	date = "2016-06-26"
	description = "JavaScript Obfuscation Detection"
	sample_filetype = "js-html"
strings:
	$string0 = /eval\(([\s]+)?(unescape|atob)\(/ nocase
	$string1 = /var([\s]+)?([a-zA-Z_$])+([a-zA-Z0-9_$]+)?([\s]+)?=([\s]+)?\[([\s]+)?\"\\x[0-9a-fA-F]+/ nocase
	$string2 = /var([\s]+)?([a-zA-Z_$])+([a-zA-Z0-9_$]+)?([\s]+)?=([\s]+)?eval;/
condition:
	any of them
}

Deployment Notes

This YARA rule can be deployed in the following contexts:

This rule contains 3 string patterns in its detection logic.

False Positive Guidance

Here are specific false positive scenarios for the JavaScript Obfuscation Detection rule, including suggested filters and exclusions:

Original source: https://github.com/Yara-Rules/rules/blob/main/packers/Javascript_exploit_and_obfuscation.yar