As a result of discussions with the guys over on
EthicalHacker.net, I've decided to briefly write about the latest discovery from
Didier Stevens. In this post, I will be looking at the PDF exe launch feature discovered by Didier. Ironically, I used his tools to view the launch objects. In this sample, rather than embed the objects, it seems he is simply using /Launch and /Action features of PDF. The real POC that is unreleased however, will embed objects in a different manner and is more dangerous in my opinion. As a first step, the real PoC also launches cmd.exe. But then it takes 4 extra steps, that ultimately launch an embedded, arbitrary executable.
A similar javascript feature is available in Metaphish, but obviously a feature that doesn’t work if JS is disabled. Post is not too in-depth, just wanted to give you guys a look at the internals.
For the PDF analysis, I used the excellent PDF-Tools from Didier Stevens that can be located
here. The main python script that was used was pdf-parser and pdfid seen below:
With PdfID, we can see that there is an OpenAction object which is traditionally used to execute command at PDF runtime. With further analysis using Pdf-parser, we can examine objects within the document.
Using the search feature, we can look for the /Launch action that Didier talks about. In plain sight, the cmd.exe is viewable in object 8. Alternatively, we could have searched for “cmd.exe”. But we don’t know what will be launched in a malicious file...
A full dump of object 8, with the –object flag provides more detailed information and a breakdown of the /Action format.
All in all, a nice little feature identified by Didier and fairly simple to implement. I expect some examples in the wild soon though :P
Cheers,
Mark