两行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>
新闻热点
疑难解答