← Back to SOC feed Coverage →

Overlay Check

yara LOW Yara-Rules
community
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-09-22T11:00:00Z · Confidence: medium

Hunt Hypothesis

This rule detects potential UI overlay attacks where an adversary places a malicious window over a legitimate interface to trick users into interacting with the wrong element, a common tactic in phishing and credential theft scenarios. Proactively hunting for these overlays in Azure Sentinel helps identify subtle social engineering attempts that may bypass standard network-based detections by exploiting user trust and visual cues.

YARA Rule

rule HasOverlay : PECheck
{
	meta: 
		author="_pusher_"
		description = "Overlay Check"
	condition:
		// MZ signature at offset 0 and ...
		uint16(0) == 0x5A4D and
		// ... PE signature at offset stored in MZ header at 0x3C
		uint32(uint32(0x3C)) == 0x00004550 and
		//stupid check if last section is 0		
		//not (pe.sections[pe.number_of_sections-1].raw_data_offset+pe.sections[pe.number_of_sections-1].raw_data_size) == 0x0 and

		(pe.sections[pe.number_of_sections-1].raw_data_offset+pe.sections[pe.number_of_sections-1].raw_data_size) < filesize
		
}

Deployment Notes

This YARA rule can be deployed in the following contexts:

False Positive Guidance


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