如何杜绝iframe挂马的方法

因为FF(Firefox)不怕IFRAME,于是就拿IE开刀,不知道比尔有没有奖发 。我只写了一句代码,就搞定了,哈,痛快 。就是IE only(特有的)的CSS中的属性e瓁pression,插进去试试,果然那些IFRAME不起作用了 。
【如何杜绝iframe挂马的方法】代码如下:
/* iframe{
v:e瓁pression(this.src="/images/defaultpic.gif");/*使用IE Only 的样式会除所有 IFRAME */
}
#f126{v:e瓁pression() !important} //如果要使自己的IFRAME可以执行,在自己的IFRAME里加上ID="f126";
/*]]>*/
分析:
前缀:e瓁pression(表达式);
这个前缀是可以随意更换的,我上面取名为"v",例如我可以换成:startcn123:e瓁pression(this.src="/images/defaultpic.gif"); 挂木马的家伙得先看你的CSS里这个前缀,然后挂马的时候写成这样,那个前缀一定要是和你的网站一样的(startcn123),才能挂到马,哈哈哈!如果把前缀做成动态的,就非常OK了,看你怎么挂!
优点:
可以解决一些站长的烦恼,无须去理会人家插了多少IFRAME木马,那些IFRAME都不起作用;
保护了访客的安全,这些IFRAME不执行,不下载,就不会破坏到访问的电脑;
代码简单,仅一句CSS样式,不管你是ASP,ASP.NET,JSP,PHP还是RUBY,都通用;
缺点:
只适合防御目前的挂IFRAME方案;
使得人家挂马的方式要改变了,挂马者可以构造这样的代码使我的防御方式失效,不过挂马都一定得看我的CSS里e瓁pression前面的这个"v" 字母,我可以换成任意的如:xgz:e瓁pression(...),哈哈哈,他也拿我没办法,再如,如果我这个前缀是变化的,是不是也行吖 *_*
不能防御其他标记的马,如
另外转一种解决方案——这种方案不知道管不管用,没试过,方法如下:
在网页最后加入

,再用css控制它的显示方式,如:xmp {<br /> width:1px;<br /> overflow:hidden;<br /> text-overflow:clip;<br /> white-space: nowrap;<br /> clear: none;<br /> float: none;<br /> line-height: 0px;<br /> display: inline;<br /> } <br /></p> <div class="dede_pages"><ul></ul></div> <div class="pcd_ad"> <center><div class="_ahwullr0ac"></div> <script type="text/javascript"> (window.slotbydup = window.slotbydup || []).push({ id: "u6834461", container: "_ahwullr0ac", async: true }); </script> <script type="text/javascript" src="//cpro.baidustatic.com/cpro/ui/cm.js" async="async" defer="defer" > </script></center> </div> <div class="mbd_ad"> <div style=margin-top:10px;margin-bottom:10px;> <div class="_i7aftr79jl"></div> <script type="text/javascript"> (window.slotbydup = window.slotbydup || []).push({ id: "u5950612", container: "_i7aftr79jl", async: true }); </script> <!-- 多条广告如下脚本只需引入一次 --> <script type="text/javascript" src="//cpro.baidustatic.com/cpro/ui/cm.js" async="async" defer="defer" > </script> </div> </div> <h3>推荐阅读</h3> <ul class="post-loop post-loop-default cols-0"> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/665675.html" title="2022山东平行志愿的原则是什么?"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="2022山东平行志愿的原则是什么?" src="http://pic.yunnanlong.com/220830/0956262047-0-lp.jpg"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="/c/665675.html"> <b>2022山东平行志愿的原则是什么? </b></a></h4> <div class="item-meta"> <div class="item-meta-right"> </div> </div> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/3002906.html" title="101胶水用什么可以去除掉"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="101胶水用什么可以去除掉" src="http://pic.yunnanlong.com/230428/1F6421R3-0-lp.jpg"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="/c/3002906.html"> <b>101胶水用什么可以去除掉 </b></a></h4> <div class="item-meta"> <div class="item-meta-right"> </div> </div> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/1158499.html" title="黄瓜为什么叫黄瓜它明明是绿色的"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="黄瓜为什么叫黄瓜它明明是绿色的" src="http://pic.yunnanlong.com/221019/2013531G1-0-lp.png"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="/c/1158499.html"> <b>黄瓜为什么叫黄瓜它明明是绿色的 </b></a></h4> <div class="item-meta"> <div class="item-meta-right"> </div> </div> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/4647096.html" title="起泡胶怎么洗,起泡胶泥弄在衣服上怎么能去掉"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="起泡胶怎么洗,起泡胶泥弄在衣服上怎么能去掉" src="http://pic.yunnanlong.com/231213/020U94Q0-0-lp.jpg"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="/c/4647096.html"> <b>起泡胶怎么洗,起泡胶泥弄在衣服上怎么能去掉 </b></a></h4> <div class="item-meta"> <div class="item-meta-right"> </div> </div> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/429184.html" title="怎么用微波炉热馒头 怎么热不硬"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="怎么用微波炉热馒头 怎么热不硬" src="http://pic.yunnanlong.com/220804/05133WW2-0-lp.jpg"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="/c/429184.html"> <b>怎么用微波炉热馒头 怎么热不硬 </b></a></h4> <div class="item-meta"> <div class="item-meta-right"> </div> </div> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/322622.html" title="颖果"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="颖果" src="http://pic.yunnanlong.com/220726/0910354010-0-lp.jpg"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="/c/322622.html"> <b>颖果 </b></a></h4> <div class="item-meta"> <div class="item-meta-right"> </div> </div> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/2581164.html" title="支付宝挂失后就安全了吗 支付宝挂失后安全吗"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="支付宝挂失后就安全了吗 支付宝挂失后安全吗" src="http://pic.yunnanlong.com/230326/011K212X-0-lp.jpg"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="/c/2581164.html"> <b>支付宝挂失后就安全了吗 支付宝挂失后安全吗 </b></a></h4> <div class="item-meta"> <div class="item-meta-right"> </div> </div> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/4329458.html" title="花生麸有机肥的制作方法和用量 花生麸有机肥的制作方法"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="花生麸有机肥的制作方法和用量 花生麸有机肥的制作方法" src="http://pic.yunnanlong.com/231109/030023F26-0-lp.jpg"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="/c/4329458.html"> <b>花生麸有机肥的制作方法和用量 花生麸有机肥的制作方法 </b></a></h4> <div class="item-meta"> <div class="item-meta-right"> </div> </div> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/327423.html" title="哪些食物控糖 怎样挑选食物既好吃又控糖"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="哪些食物控糖 怎样挑选食物既好吃又控糖" src="http://pic.yunnanlong.com/220726/1S0302147-0-lp.jpg"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="/c/327423.html"> <b>哪些食物控糖 怎样挑选食物既好吃又控糖 </b></a></h4> <div class="item-meta"> <div class="item-meta-right"> </div> </div> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/3910832.html" title="电脑开机后进不了系统电脑开机后进不了系统怎么办"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="电脑开机后进不了系统电脑开机后进不了系统怎么办" src="/baike/tj/images/defaultpic.gif"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="/c/3910832.html"> <b>电脑开机后进不了系统电脑开机后进不了系统怎么办 </b></a></h4> <div class="item-meta"> <div class="item-meta-right"> </div> </div> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/0214259C092023.html" title="我来教你喜马拉雅收听偏好怎么设置"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="我来教你喜马拉雅收听偏好怎么设置" src="http://img.yunnanlong.com/230214/102GT2J-0-lp.png"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="/c/0214259C092023.html"> <b>我来教你喜马拉雅收听偏好怎么设置 </b></a></h4> <div class="item-meta"> <div class="item-meta-right"> </div> </div> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/091216096192022.html" title="伺服阀零部件怎么清洗,电液伺服阀的清洁"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="伺服阀零部件怎么清洗,电液伺服阀的清洁" src="/baike/sj/images/defaultpic.gif"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="/c/091216096192022.html"> <b>伺服阀零部件怎么清洗,电液伺服阀的清洁 </b></a></h4> <div class="item-meta"> <div class="item-meta-right"> </div> </div> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/110630RYH023.html" title="卧室和客厅连在一起怎么装修 小户型 卧室连接客厅怎么改造"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="卧室和客厅连在一起怎么装修 小户型 卧室连接客厅怎么改造" src="/baike/sj/images/defaultpic.gif"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="/c/110630RYH023.html"> <b>卧室和客厅连在一起怎么装修 小户型 卧室连接客厅怎么改造 </b></a></h4> <div class="item-meta"> <div class="item-meta-right"> </div> </div> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/0124254QV2023.html" title="什么原因导致了你的不孕?"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="什么原因导致了你的不孕?" src="http://img.yunnanlong.com/230124/0355045519-0-lp.jpg"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="/c/0124254QV2023.html"> <b>什么原因导致了你的不孕? </b></a></h4> <div class="item-meta"> <div class="item-meta-right"> </div> </div> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/09191G02C2022.html" title="广州到河南平顶山的高铁时刻表,广州东至平顶山火车当天几点发车到第二天时间到"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="广州到河南平顶山的高铁时刻表,广州东至平顶山火车当天几点发车到第二天时间到" src="http://img.yunnanlong.com/220919/01594a319-0-lp.png"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="/c/09191G02C2022.html"> <b>广州到河南平顶山的高铁时刻表,广州东至平顶山火车当天几点发车到第二天时间到 </b></a></h4> <div class="item-meta"> <div class="item-meta-right"> </div> </div> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/09291V11512022.html" title="武汉知行学院,湖北武汉汉口知行学院属于公办还是民办"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="武汉知行学院,湖北武汉汉口知行学院属于公办还是民办" src="http://img.yunnanlong.com/220929/04062M542-0-lp.png"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="/c/09291V11512022.html"> <b>武汉知行学院,湖北武汉汉口知行学院属于公办还是民办 </b></a></h4> <div class="item-meta"> <div class="item-meta-right"> </div> </div> </div> </li> </ul> <p><br /><ul class="post-loop post-loop-list cols-4"><li><a href="/c/2783290.html" title="新苹果手机如何激活" target="_blank">新苹果手机如何激活 </a></li> <li><a href="/c/2783287.html" title="没有证的土地被占用如何处理" target="_blank">没有证的土地被占用如何处理 </a></li> <li><a href="/c/2783286.html" title="大棚蓝莓如何授粉" target="_blank">大棚蓝莓如何授粉 </a></li> <li><a href="/c/2783269.html" title="如何查看合同有没有问题" target="_blank">如何查看合同有没有问题 </a></li> <li><a href="/c/2783218.html" title="荣耀v30pro如何设置时间24小时" target="_blank">荣耀v30pro如何设置时间24小时 </a></li> <li><a href="/c/2783208.html" title="李凭箜篌引与琵琶行对比 李凭箜篌引与琵琶行如何对比" target="_blank">李凭箜篌引与琵琶行对比 李凭箜篌引与琵琶行如何对比 </a></li> <li><a href="/c/2783157.html" title="獭兔螨病如何防治" target="_blank">獭兔螨病如何防治 </a></li> <li><a href="/c/2783154.html" title="如何让u盘悬浮在桌面" target="_blank">如何让u盘悬浮在桌面 </a></li> <li><a href="/c/2783145.html" title="如何装修淘宝店铺" target="_blank">如何装修淘宝店铺 </a></li> <li><a href="/c/2783108.html" title="12.5*8÷12.5*8简便计算 12.5*8÷12.5*8如何简便计算" target="_blank">12.5*8÷12.5*8简便计算 12.5*8÷12.5*8如何简便计算 </a></li> </ul></p> <div class=entry-copyright> <p></p> </div> </div> <div class="entry-footer"> <div class="prev-next sb br mb clearfix"> <p class="post-prev fl ellipsis">上一篇:<a href='/c/2783313.html'>上善若水的含义</a> </p> <p class="post-next fr ellipsis">下一篇:<a href='/c/2783315.html'>人类一共灭绝了几次</a> </p> </div> </div> </div> </article> </main> <aside class="sidebar"> <div class="widget widget_post_thumb"> <h3 class="widget-title"><span>更多...</span></h3> <ul> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/2783315.html" title="人类一共灭绝了几次"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="人类一共灭绝了几次" src="http://pic.yunnanlong.com/230409/19103TR9-0-lp.jpg"> </a></div> <div class="item-content"> <p class="item-title"><a href="/c/2783315.html" title="人类一共灭绝了几次">人类一共灭绝了几次</a></p> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/2783314.html" title="如何杜绝iframe挂马的方法"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="如何杜绝iframe挂马的方法" src="/images/defaultpic.gif"> </a></div> <div class="item-content"> <p class="item-title"><a href="/c/2783314.html" title="如何杜绝iframe挂马的方法">如何杜绝iframe挂马的方法</a></p> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/2783313.html" title="上善若水的含义"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="上善若水的含义" src="/images/defaultpic.gif"> </a></div> <div class="item-content"> <p class="item-title"><a href="/c/2783313.html" title="上善若水的含义">上善若水的含义</a></p> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/2783312.html" title="疫情手抄报"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="疫情手抄报" src="http://pic.yunnanlong.com/230409/1Z94G4c-0-lp.jpg"> </a></div> <div class="item-content"> <p class="item-title"><a href="/c/2783312.html" title="疫情手抄报">疫情手抄报</a></p> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/2783311.html" title="玉手镯怎么戴"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="玉手镯怎么戴" src="/images/defaultpic.gif"> </a></div> <div class="item-content"> <p class="item-title"><a href="/c/2783311.html" title="玉手镯怎么戴">玉手镯怎么戴</a></p> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/2783310.html" title="水库不泄洪会造成什么后果 水库不泄洪有什么后果"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="水库不泄洪会造成什么后果 水库不泄洪有什么后果" src="http://pic.yunnanlong.com/230409/1Z9151A7-0-lp.jpg"> </a></div> <div class="item-content"> <p class="item-title"><a href="/c/2783310.html" title="水库不泄洪会造成什么后果 水库不泄洪有什么后果">水库不泄洪会造成什么后果 水库不泄洪有什么后果</a></p> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/2783309.html" title="商业管理课程包括哪些"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="商业管理课程包括哪些" src="/images/defaultpic.gif"> </a></div> <div class="item-content"> <p class="item-title"><a href="/c/2783309.html" title="商业管理课程包括哪些">商业管理课程包括哪些</a></p> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/2783308.html" title="888.88红包是什么意思"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="888.88红包是什么意思" src="http://pic.yunnanlong.com/230409/1ZQ63E9-0-lp.jpg"> </a></div> <div class="item-content"> <p class="item-title"><a href="/c/2783308.html" title="888.88红包是什么意思">888.88红包是什么意思</a></p> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/2783307.html" title="京东e卡怎么解除绑定"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="京东e卡怎么解除绑定" src="/images/defaultpic.gif"> </a></div> <div class="item-content"> <p class="item-title"><a href="/c/2783307.html" title="京东e卡怎么解除绑定">京东e卡怎么解除绑定</a></p> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="/c/2783306.html" title="金缕衣的意思 金缕衣原文"> <img width="480" height="300" class="attachment-default size-default wp-post-image j-lazy" alt="金缕衣的意思 金缕衣原文" src="http://pic.yunnanlong.com/230409/1ZJ4Ib-0-lp.jpg"> </a></div> <div class="item-content"> <p class="item-title"><a href="/c/2783306.html" title="金缕衣的意思 金缕衣原文">金缕衣的意思 金缕衣原文</a></p> </div> </li> </ul> </div> </aside> </div> </div> <footer class="footer"> <div class="container"> <div class="clearfix"> <div class="footer-col footer-col-logo"> <!--<img src="/skin/images/logo-footer.png">--></div> <div class="footer-col footer-col-copy"> <ul class="footer-nav hidden-xs"> <li class="menu-item menu-item-706"><a href="http://www.yunnanlong.com/">知识经验</a></li> <li class="menu-item menu-item-706"><a href="/baike/">生活百科</a></li> <li class="menu-item menu-item-706"><a href="http://zhishi.yunnanlong.com/">知识大全</a></li> <li class="menu-item menu-item-706"><a href="http://meng.yunnanlong.com/">解梦</a></li> <li class="menu-item menu-item-706"><a href="http://tech.yunnanlong.com/">科技数码</a></li> </ul> <div class="copyright"> <p>Copyright &copy; 2017-2022 云南龙网 </p> </div> </div> <div class="footer-col footer-col-sns"> <div class="footer-sns"> </div> </div> </div> </div> </footer> <div class="action action-style-0 action-color-0 action-pos-1" style="bottom:15%;"> <div class="action-item gotop j-top"> <i class="web-icon wi action-item-icon"><svg aria-hidden="true"> <use xlink:href="#wi-arrow-up-2"></use> </svg></i></div> </div> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?7359a0d223a1dacd57b56fe97d84533b"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> </div> <script>var _web_js={};</script> <script src="/skin/js/index.js"></script> </body> </html>