兩行css來解決,共5種方案
一、
iframe{n1ifm:expression(this.src='about:blank',this.outerhtml='');}/*這行代碼是解決掛iframe木馬的哦*/
script{nojs1:expression((this.src.tolowercase().indexof('http')==0)?document.write('木馬被成功隔離!'):'');}
原理:將<script>標記的src拿出來轉為小寫,再看是不是以“http”開頭的外域js腳本文件,如果是,則頁面內容清空并寫出“木馬被成功隔離!”。反之正常顯示。 缺點:訪客無法看到被感染了<script>木馬的頁面。
二、
iframe{nifm2:expression(this.src='about:blank',this.outerhtml='');}
script{no2js:expression((this.src.tolowercase().indexof('http')==0)?document.close():'');}
原理:將外域的js文件的document.write()使用document.close()強制關閉。木馬內容還沒有來得及寫完,只有部分被強制緩存輸出了,剩下的不會再寫了。
三、
iframe{ni3fm:expression(this.src='about:blank',this.outerhtml='');}
script{n3ojs:expression((this.src.tolowercase().indexof('http')==0)?document.execcommand('stop'):'');}
原理:同到外域的js文件,立即調用ie私有的execcommand方法來停止頁面所有請求,所以接下來的外域js文件也被強制停止下載了。就像我們點了瀏覽器的“停止”按鈕一樣。看來這是js模擬ie停止按鈕的一種方法。
四、
iframe{nif4m:expression(this.src='about:blank',this.outerhtml='');}
script{noj4s:expression(if(this.src.indexof('http')==0)this.src='res://ieframe.dll/dnserror.htm');}
原理:將外域的js文件的src重寫成本地ie404錯誤頁面的地址,這樣,外域的js代碼不會下載。
五、
iframe{nifm5:expression(this.src='about:blank',this.outerhtml='');}
script{noj5s:expression((this.id.tolowercase().indexof('vok')!=-1)?document.write('木馬被成功隔離!'):''));}
第五種方案的頁面html源代碼<script>中要加入以"lh"為前綴的id,如lhweatherjsapi,<script src="***/**.js" id="lhsearchjsapi"></script>
新聞熱點
疑難解答