CSS代碼解決網頁掛馬問題

來源:互聯網
上載者:User

兩行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>

 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.