Skip to main content
SECURITY GUIDE 5 min read• Updated 2024-11-28Graph v5.2.0

How to Detect a File Extension Spoof: Practical File Forensics

Learn how cyber attackers disguise malicious executables (.exe, .scr, .vbs) as harmless documents (.pdf, .jpg, .docx) using double extensions and Right-to-Left Override (RLO) characters, and how to verify headers safely.

David Chen
David ChenCISSP, GCIH
Systems Security Architect & Threat Forensics Researcher
Audited September 2026
Peer-Reviewed by Dr. Alistair Vance (Ph.D., CompEng)

What Is File Extension Spoofing?

Extension spoofing is a social engineering technique where a dangerous executable file is manipulated to look like an innocent document or image. Because default Windows settings hide known file extensions, users frequently click on files believing them to be safe PDFs or JPGs.

Top 3 Extension Spoofing Techniques

Attackers commonly employ three deceptive strategies:

  • 1. Double Extensions (e.g. `report.pdf.exe`): On default Windows setups where "Hide extensions for known file types" is enabled, Windows hides the trailing `.exe` and displays the filename as `report.pdf`. Clicking it runs the binary.
  • 2. Right-to-Left Override (RLO / Unicode U+202E): An invisible Unicode character flips the text direction of succeeding characters. A file named `invoice_[U+202E]cod.exe` is visually rendered by operating systems as `invoice_exe.doc`.
  • 3. Custom Icon Injection: Compiling an executable with the official Adobe Acrobat red PDF icon or Microsoft Word blue icon to trick visual inspection.

How to Safely Verify Suspicious Files on AnyFileX

To verify whether a downloaded file is genuine without executing it:

  • Step 1: Never double-click an untrusted file.
  • Step 2: Drop the file into the AnyFileX File Analyzer.
  • Step 3: Check the "Extension Mismatch" diagnostic indicator.
  • Step 4: Verify that the magic bytes match the claimed format (e.g. `25 50 44 46` for PDF vs `4D 5A` for Executable).
  • Step 5: Review the computed SHA-256 cryptographic hash against known vendor checksums.
Live Interactive Tools

Execute This Operation In Your Browser

AnyFileX processes all transformations, magic byte analysis, and batch pipelines 100% in client-side RAM with zero cloud storage exposure.

Frequently Asked Questions

A genuine JPEG image cannot execute arbitrary code on its own. However, if the file is actually an .exe with a fake .jpg icon and hidden extension, or if it exploits a zero-day memory buffer overflow in an unpatched photo viewer, execution could theoretically occur. Always verify headers using AnyFileX before opening untrusted downloads.
Tested & Verified EnvironmentsAudited: September 2026
Windows 11 Explorer Extension RulesNIST Special Publication 800-83Unicode Consortium UTR #36 (Security Considerations)

Official Standards Citations & Specifications

Masquerading: Double File Extension
Issuing Body: NIST
MITRE ATT&CK T1036.007
Secure Hash Standard (SHS)
Issuing Body: NIST
NIST FIPS PUB 180-4