標籤:script main pen function http cti catch 網站 ext
<script>
//寫檔案 function writeFile(filename,filecontent){ var fso, f, s ; fso = new ActiveXObject("Scripting.FileSystemObject"); f = fso.OpenTextFile(filename,8,true); f.WriteLine(filecontent); f.Close(); } //判斷網站是否能開啟function http_go(URL){var http_c= new ActiveXObject("microsoft.xmlhttp");http_c.Open("GET",URL,false);try{http_c.Send();}catch(e){}finally{var result = http_c.responseText;if(result){if(http_c.Status==200)return(true);elsereturn(false);}elsereturn(false);}}var q = [‘bj‘,‘sh‘,‘sz‘,‘gz‘,‘tj‘,‘hz‘,‘nj‘];var c = [‘b‘,‘c‘,‘d‘,‘f‘,‘g‘,‘h‘,‘j‘,‘k‘,‘l‘,‘m‘,‘n‘,‘p‘,‘q‘,‘r‘,‘s‘,‘t‘,‘v‘,‘w‘,‘x‘,‘y‘,‘z‘];for(var x=0;x<q.length;x++)for(var i=0;i<c.length;i++) for(var j=0;j<c.length;j++)for(var k=0;k<c.length;k++){ var domain_m =q[x]+c[i]+c[j]+c[k]+‘.com‘;var domain_m1 =‘http://‘+domain_m;var domain_m2 =‘http://www‘+domain_m;if(http_go(domain_m1)||http_go(domain_m2)){writeFile(‘D:/WORK/domain/domain_qc.txt‘,domain_m);}}
</script>
JS擷取網站StatusCode,若存在寫入檔案