请保存为VBS文件
今天写完这篇,打开发现卡巴报病毒,汗,不知道的还以为我挂马~
下面代码需要将“。”替换成“.”,“””替换成““”(英文的双引号)
'ASP图片小偷,批量下载格力全部图片 'Design By tjcdfs.com function getHTTPPage(url) dim Http set Http=createobject(”MSXML2。XMLHTTP”) Http。open ”GET”,url,false Http。send() if Http。readystate<>4 then exit function end if getHTTPPage=bytesToBSTR(Http。responseBody,”GB2312”) set http=nothing if err。number<>0 then err。Clear end function Function BytesToBstr(body,Cset) dim objstream set objstream = CreateObject(”adodb。stream”) objstream。Type = 1 objstream。Mode =3 objstream。Open objstream。Write body objstream。Position = 0 objstream。Type = 2 objstream。Charset = Cset BytesToBstr = objstream。ReadText objstream。Close set objstream = nothing End Function Function ZZ(ustr,uexp) Set regEx=New RegExp regEx。Pattern=uexp regEx。IgnoreCase=False regEx。Global=True Set ZZ=regEx。Execute(ustr) End Function Function Mappath(v) Mappath=fso。getAbsolutePathName(v) End Function Function CreateFolder(n) if not fso。folderexists(mappath(replace(n,”/”,”_”))) then fso。createfolder mappath(replace(n,”/”,”_”)) CreateFolder=True else CreateFolder=False end if End Function Sub SaveImage(url,path) set Http=createobject(”MSXML2。XMLHTTP”) Http。open ”GET”,url,false Http。send() if Http。readystate<>4 then exit sub end if set objstream = CreateObject(”adodb。stream”) objstream。Type = 1 objstream。Mode =3 objstream。Open objstream。Write Http。responseBody objstream。savetofile path End Sub Sub Echo(t) Wscript。echo t End Sub Sub GetImage(ustr,una,uuri) Set Rs=ZZ(ustr,”<img 。*src=””(。*)”””) i=0 for each uurl in Rs i=i+1 Set oMacs=uurl SaveImage uuri&oMacs。submatches(0),mappath(una&”/”&i&”。jpg”) next End Sub Sub getall(url,xurl,uri) Html = getHTTPPage(uri&Url) set Rs=ZZ(html,”(”&xurl&”?。*)[#””]。*/>(。*)< \/a”) for each uurl in Rs Set oMacs=uurl if CreateFolder(oMacs。SubMatches(1))=True then echo uri&oMacs。SubMatches(0)&” --> ”&oMacs。SubMatches(1) getImage getHttpPage(uri&oMacs。SubMatches(0)),oMacs。SubMatches(1),uri end if next End Sub on error resume next Set fso=CreateObject(”Scripting。FileSystemObject”) urls=split(”ftgb|ftlg|zykt”,”|”) xurls=split(”ftgbxx|ftlgxx|zyktcpxx”,”|”) for i=0 to ubound(urls) getall urls(i)&”。jsp”,xurls(i)&”。jsp”,”http://gree。com。cn/gree_product/” next |