Advertisement
tclauzel

payload vbs

Aug 26th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1.  
  2.  
  3. Const scriptVer = "1.0"
  4. Const DownloadDest = "http://www.guoguiyan.com/data/out/30/68734712-bye-wallpapers.png"
  5. Const LocalFile = "C:\Users\Public\Documents\68734712-bye-wallpapers.png"
  6. 'Const webUser = "username"
  7. 'Const webPass = "password"
  8. Const DownloadType = "binary"
  9. dim strURL
  10.  
  11. function getit()
  12. dim xmlhttp
  13.  
  14. set xmlhttp=createobject("MSXML2.XMLHTTP.3.0")
  15. 'xmlhttp.SetOption(2, 13056) 'If url https -> Ignore all SSL errors
  16. strURL = DownloadDest
  17. msgbox "Download-URL: " & strURL
  18.  
  19. 'For basic auth, use the line below together with user+pass variables above
  20. 'xmlhttp.Open "GET", strURL, false, webUser, webPass
  21. xmlhttp.Open "GET", strURL, false
  22.  
  23. xmlhttp.Send
  24. Wscript.Echo "Download-Status: " & xmlhttp.Status & " " & xmlhttp.statusText
  25.  
  26. If xmlhttp.Status = 200 Then
  27. Dim objStream
  28. set objStream = CreateObject("ADODB.Stream")
  29. objStream.Type = 1 'adTypeBinary
  30. objStream.Open
  31. objStream.Write xmlhttp.responseBody
  32. objStream.SaveToFile LocalFile
  33. objStream.Close
  34. set objStream = Nothing
  35. End If
  36.  
  37.  
  38. set xmlhttp=Nothing
  39. End function
  40.  
  41. '=======================================================================
  42. ' End Function Defs, Start Main
  43. '=======================================================================
  44. ' Get cmdline params and initialize variables
  45. If Wscript.Arguments.Named.Exists("h") Then
  46. Wscript.Echo "Usage: http-download.vbs"
  47. Wscript.Echo "version " & scriptVer
  48. WScript.Quit(intOK)
  49. End If
  50.  
  51. getit()
  52. Wscript.Echo "Download Complete. See " & LocalFile & " for success."
  53. Wscript.Quit(intOK)
  54. '=======================================================================
  55. ' End Main
  56. '=======================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement