Wednesday, March 19, 2025
HomeCyber Security NewsAttackers Hide Malicious Word Files Inside PDFs to Evade Detection

Attackers Hide Malicious Word Files Inside PDFs to Evade Detection

Published on

SIEM as a Service

Follow Us on Google News

A newly identified cybersecurity threat involves attackers embedding malicious Word files within PDFs to deceive detection systems.

This technique, confirmed by JPCERT/CC, exploits the fact that files created using MalDoc in PDF can be opened in Microsoft Word, even though they possess the magic numbers and structure of PDF files.

If these files contain macros and are opened in Word, they execute malicious scripts, often in the form of Visual Basic Scripting (VBS), leading to harmful activities on the victim’s system, as per a report by JPCERT.

Background on MalDoc in PDF

Files created using this method are built by appending an mht file—complete with macros—after a PDF file object.

Although recognized as PDFs due to their file signature, these files can still be opened in Word when configured appropriately. This dual functionality is highlighted, which shows a dump view of such a file.

The attackers’ strategy relies on Windows file settings; if a file with a .doc extension is configured to open in Word, the PDF-structured file with embedded Word content can be treated as a Word document.

This misdirection can lead to severe security breaches, especially if macros are enabled.

Dump view of MalDoc in PDF
Dump view of MalDoc in PDF

Challenges in Detection

PDF analysis tools, like pdfid, often fail to detect the malicious components within these hybrid files.

pdfid’s analysis results
pdfid’s analysis results

Since the file appears as a legitimate PDF, sandbox and antivirus software may overlook it, thinking it harmless.

However, tools designed for analyzing malicious Word files, such as OLEVBA, remain effective in identifying embedded macros and thus uncovering the malicious parts of the file.

OLEVBA’s analysis results
OLEVBA’s analysis results

To combat this technique, users can employ detection methods using Yara rules. For instance, a rule can be created to identify when Excel files are embedded within PDFs.

This approach triggers a warning when opening such a file in Excel, if it is detected, which makes it less likely for Excel files to be used in this manner.

Here’s an example of a detection rule for identifying Word or Excel files embedded in PDFs:

rule malware_MaldocinPDF {

    strings:

        $docfile2 = "<w:WordDocument>" ascii nocase

        $xlsfile2 = "<x:ExcelWorkbook>" ascii nocase

        $mhtfile0 = "mime" ascii nocase

        $mhtfile1 = "content-location:" ascii nocase

        $mhtfile2 = "content-type:" ascii nocase

    condition:

        (uint32(0) == 0x46445025) and

        (1 of ($mhtfile*)) and

        ( (1 of ($docfile*)) or

          (1 of ($xlsfile*)) )

}

While this method doesn’t bypass Word’s macro auto-execution controls, users should remain vigilant when analyzing potentially malicious files with automation tools.

Attackers are using complex file manipulation to evade detection by embedding malicious content within seemingly innocuous PDFs. Understanding and countering these tactics is crucial for maintaining robust cybersecurity defenses.

This evolving threat landscape requires continuous awareness and adaptability to ensure effective protection against sophisticated malware tactics.

Investigate Real-World Malicious Links & Phishing Attacks With Threat Intelligence Lookup - Try for Free

Divya
Divya
Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Latest articles

mySCADA myPRO Manager RCE Vulnerabilities Allow Remote Attackers to Take Control of ICS Devices

In a significant discovery, PRODAFT's security research team has identified two critical vulnerabilities in...

Hackers Use RMM Tools to Maintain Persistence and Navigate Networks Undetected

Threat actors have increasingly been leveraging legitimate remote monitoring and management (RMM) software to...

Threat Actors Leverage Legacy Drivers to Circumvent TLS Certificate Validation

Threat actors have recently been exploiting legacy drivers to bypass certificate validation, leveraging a...

Threat Actors Steal 3.2 Billion Login Credentials and Infect 23 Million Devices Worldwide

In a stark revelation of the escalating cyber threat landscape, Flashpoint's latest intelligence report...

Supply Chain Attack Prevention

Free Webinar - Supply Chain Attack Prevention

Recent attacks like Polyfill[.]io show how compromised third-party components become backdoors for hackers. PCI DSS 4.0’s Requirement 6.4.3 mandates stricter browser script controls, while Requirement 12.8 focuses on securing third-party providers.

Join Vivekanand Gopalan (VP of Products – Indusface) and Phani Deepak Akella (VP of Marketing – Indusface) as they break down these compliance requirements and share strategies to protect your applications from supply chain attacks.

Discussion points

Meeting PCI DSS 4.0 mandates.
Blocking malicious components and unauthorized JavaScript execution.
PIdentifying attack surfaces from third-party dependencies.
Preventing man-in-the-browser attacks with proactive monitoring.

More like this

mySCADA myPRO Manager RCE Vulnerabilities Allow Remote Attackers to Take Control of ICS Devices

In a significant discovery, PRODAFT's security research team has identified two critical vulnerabilities in...

Hackers Use RMM Tools to Maintain Persistence and Navigate Networks Undetected

Threat actors have increasingly been leveraging legitimate remote monitoring and management (RMM) software to...

Threat Actors Leverage Legacy Drivers to Circumvent TLS Certificate Validation

Threat actors have recently been exploiting legacy drivers to bypass certificate validation, leveraging a...