← Back to SOC feed Coverage →

Data Beyond ImageSize 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-22T23:00:00Z · Confidence: medium

Hunt Hypothesis

This rule detects potential memory corruption or buffer overflow attempts where data extends beyond the expected image size, a technique often used by adversaries to execute arbitrary code or escalate privileges. Proactively hunting for this anomaly in Azure Sentinel allows the SOC to identify stealthy exploitation attempts or malformed payloads that may bypass standard integrity checks before they lead to a full system compromise.

YARA Rule

rule IsBeyondImageSize : PECheck
{
	meta: 
		author = "_pusher_"
		date = "2016-07"
		description = "Data Beyond ImageSize 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
		for any i in (0..pe.number_of_sections-1):
		( 
		(pe.sections[i].virtual_address+pe.sections[i].virtual_size) > (uint32(uint32(0x3C)+0x50)) or
		(pe.sections[i].raw_data_offset+pe.sections[i].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