I am used to receive SPAM emails containing zips and exes, even "PDF files" with double extension (.pdf.exe), but some days ago I received an email with a PDF file attached, without any .exe extension and it didn't look like a Viagra advertisement. Weird. I didn't have time to take a look at it, but the next day I received another one, with a different subject. The subject of the first email was “Invoice 454889 April” from Sue Mockridge (motherlandjjw949 at gmail.com) attaching “April invoice 819953.pdf” (eae0827f3801faa2a58b57850f8da9f5), and the second one “Image has been sent jesparza” from Evernote Service (message at evernote.com, but really protectoratesl9 at gmail.com) attaching “Agreemnet-81220097.pdf” (2a03ac24042fc35caa92c847638ca7c2).
At this point I was really curious so I took a look at them with peepdf.
At that moment I only saw a suspicious /AcroForm element, but nothing more. This element was referencing object 1, not shown due to a bug in peepdf.
With this information and thanks to other characteristic strings found in this object (“0aa46f9b-2c50-42d4-ab0b-1a1015321da7”, “// Index of the overlapped string”, “// Base of the AcroRd32_dll”
, etc) it was easy to spot the vulnerability exploited here. It turned out to be the Adobe Reader BMP/RLE heap corruption vulnerability (CVE-2013-2729)
and the bad guys copied the PoC written by Felipe Manzano
(it was not the first time that the attackers reused code from Felipe
, for example, in the case of a CVE-2011-2462 exploit
). I have to be fair and mention that the bad guys made some extra effort to add more ROP offsets to cover 23 different Adobe Reader versions, from 188.8.131.52 to 184.108.40.206 ;) The vulnerability itself is an integer overflow patched one year ago
and explained really well by Felipe in these blog post
, so nothing to add here.
Knowing all the details about the exploit it was easy to make peepdf detect it (update it using the -u flag!):
The shellcode was not hidden at all, it was located in plain sight within one of the script elements, so it was easy to decode with the js_unescape command.
In both PDF files the shellcode tried to download an executable from a compromised web site:
After the execution of the first binary the system was downloading:
The binary 91d33fc439c64bd517f4f10a0a4574f1 was dropping ZeuS-P2P/Gameover with the Necurs rootkit
, but the size was unusually big (496,128 bytes). Inside the rootkit a PDB path related to GMER could be found (“e:\projects\cpp\gmer\driver\objfre_wxp_x86\i386\gmer.pdb
”), probably used to disable the rootkit detection.
After that, another loader was downloaded and executed:
From this point and after connecting to pimplelotion.com (220.127.116.11) to receive instructions a lot of binaries were executed. This is an example of the configuration received from this server:
<install id="1" filetype="1" name="soks" autorun="1" limits="0:16632" filter="" hash="2368a8c8b50900d57c0366049f755c05">hxxp://segurgestion.es/1.bin</install>
And the list of URLs I had until I stop monitoring it:
So it was funny (and weird) to receive directly a PDF exploit via email and not the usual downloader like Andromeda/Upatre to drop ZeuS-P2P/Gameover (among others). Also, it was the first time I was seeing this vulnerability in the wild, because, as far as I know, it is not used in any Exploit Kit either
. If I am wrong and you think this vuln is common be free to drop a comment ;)