← Back to SOC feed Coverage →

invalid trailer structure

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-05-12T23:00:00Z · Confidence: medium

Hunt Hypothesis

The “invalid trailer structure” rule detects potential adversarial manipulation of file structures to evade standard detection mechanisms by introducing malformed trailer data. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify and mitigate sophisticated file-based attacks that may bypass traditional signature-based detection.

YARA Rule

rule invalid_trailer_structure : PDF raw
{
	meta:
		author = "Glenn Edwards (@hiddenillusion)"
		version = "0.1"
		weight = 1
		
        strings:
                $magic = { 25 50 44 46 }
				// Required for a valid PDF
                $reg0 = /trailer\r?\n?.*\/Size.*\r?\n?\.*/
                $reg1 = /\/Root.*\r?\n?.*startxref\r?\n?.*\r?\n?%%EOF/

        condition:
                $magic in (0..1024) and not $reg0 and not $reg1
}

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

Original source: https://github.com/Yara-Rules/rules/blob/main/maldocs/Maldoc_PDF.yar