JPCERT/CC has unveiled a novel attack technique termed “MalDoc in PDF,” which was observed in a July cyber attack, effectively sidestepping detection by embedding a malicious Word file within a PDF document.
This technique allows the creation of files with PDF magic numbers and file structures that can be opened in Word, triggering potentially harmful macros upon opening. The attack identified by JPCERT/CC utilized a .doc file extension to open the crafted file in Word. This article provides an in-depth analysis of the “MalDoc in PDF” technique, including its characteristics and potential countermeasures.
Furthermore, the “MalDoc in PDF” technique allows an attacker to embed a Word file containing macros into a PDF, presenting it as a PDF file with recognizable characteristics while still able to execute malicious macros when opened in Word. While traditional PDF analysis tools might not detect its malicious components, the file’s behavior changes when viewed in Word compared to PDF viewers.
Existing sandbox and antivirus solutions may struggle to identify this threat due to its deceptive PDF appearance. Despite the technique’s evasion tactics, the OLEVBA analysis tool remains a potent countermeasure to uncover embedded macros within the malicious Word file.
A sample detection rule utilizing Yara demonstrates one possible approach to detecting such attacks, highlighting the manipulation of file extensions in PDFs. Although the described technique does not bypass the setting that disables auto-execution in Word macros, it raises concerns about automated malware analysis tools potentially misidentifying the threat due to its PDF façade.
To address this issue, users are advised to exercise caution when analyzing files, particularly in automated environments, and should refer to the article’s Appendix for information on mitigating the threat’s impact.