国产高清一区二区在线_免费看肥胖女人做爰高清全过情_日韩少妇高潮抽搐_性生生活大片又黄又_粉嫩蜜臀av国产精品网站_搞黄视频免费_亚洲成a人一区二区三区_屁股翘起来趴好挨c_少妇一夜爽免费看_日本护士高潮大叫

在線客服:  

「南寧煙寒網(wǎng)絡(luò)」提供南寧網(wǎng)站建設(shè)、網(wǎng)站策劃、南寧網(wǎng)頁(yè)制作、網(wǎng)站設(shè)計(jì)、網(wǎng)站改版、南寧SEO優(yōu)化、網(wǎng)站維護(hù)、南寧網(wǎng)站優(yōu)化、南寧網(wǎng)站推廣、廣告設(shè)計(jì)等服務(wù)..

咨詢熱線

在線客服

24小時(shí)免費(fèi)咨詢電話:18978941786

客服時(shí)間:上午9:30~下午6點(diǎn)

當(dāng)前位置:首頁(yè)>>服務(wù)中心 >> 常見問題 >> 數(shù)據(jù)掛馬如何處理及處理方法

數(shù)據(jù)掛馬如何處理及處理方法

收藏 分享 發(fā)布日期:2012-2-12 16:32:53    編輯:admin  文章來(lái)源:煙寒網(wǎng)絡(luò)  點(diǎn)擊率:

數(shù)據(jù)庫(kù)被掛馬我相信很多人都碰到過。在這里,我講下我處理的方法。

第一步:為現(xiàn)有數(shù)據(jù)庫(kù)做好備份。

第二步

執(zhí)行如下ASP文件,這樣就可以去掉數(shù)據(jù)庫(kù)當(dāng)中的JS木馬:
注:conn.asp自己去寫了。

'這里放入JS木馬內(nèi)容:請(qǐng)記得改為自己數(shù)據(jù)庫(kù)中的JS木馬內(nèi)容。
<!--#include file="conn.asp"-->
<%
Server.ScriptTimeOut=180
Set rstSchema = conn.OpenSchema(20)
k=1
Do Until rstSchema.EOF '遍歷數(shù)據(jù)庫(kù)表
    If rstSchema("TABLE_TYPE")="TABLE" Then
        response.write K&".<font color=red><b>"&rstSchema("TABLE_NAME") & "</b></font>:" '顯示表名
        Set rs=Server.CreateObject("ADODB.Recordset")
        sql="select * from [" & rstSchema("TABLE_NAME")&"]"
        rs.open sql,conn,1,3
        For i=0 to rs.fields.count-1 '遍歷表中字段
           If int(rs(i).Type)=129 or int(rs(i).Type)=130 or int(rs(i).Type)=200 or int(rs(i).Type)=201 or int(rs(i).Type)=202 or int(rs(i).Type)=203 Then'只處理字段類型為字符型的字段
            conn.execute("update ["&rstSchema("TABLE_NAME")&"] set "&rs(i).name&" =replace(cast("&rs(i).name&" as varchar(8000)),'這里放入JS木馬內(nèi)容','')")
            response.write rs(i).name &" "&rs(i).Type &" "'顯示執(zhí)行過的字段名。
          End If
        Next
        response.write "<br>"
    End If
    rstSchema.MoveNext
    k=k+1
Loop
response.Write "執(zhí)行成功"
%>

如果數(shù)據(jù)庫(kù)表很多的話,上面的遍歷數(shù)據(jù)庫(kù)結(jié)構(gòu)未執(zhí)行完就被IIS給停止了。在這時(shí)候可以在

If rstSchema("TABLE_TYPE")="TABLE" Then

當(dāng)中適當(dāng)加入k值的范圍,如:

If rstSchema("TABLE_TYPE")="TABLE" k>10 and k<20 Then

這樣的話就一次只操作9個(gè)表。

第三步

根據(jù)數(shù)據(jù)庫(kù)JS注入的特性(會(huì)包括<script、</script>和http://這樣的字符),
在conn.asp里面放入如下代碼:

 

Function Cheack_Sqljs()'防止數(shù)據(jù)庫(kù)外鏈JS注入:true為發(fā)現(xiàn)外鏈JS注入。
    Dim F_Post,F_Get
    Cheack_Sqljs=False
    If Request.Form<>"" Then'表單提交時(shí)的檢測(cè)
        For Each F_Post In Request.Form
            If (Instr(LCase(Request.Form(F_Post)),"<script")<>0 or Instr(LCase(Request.Form(F_Post)),"</script>")<>0) and Instr(LCase(Request.Form(F_Post)),"http://")<>0 Then
                Cheack_Sqljs=True
                Exit For
            End If
        Next
    End If
    If Request.QueryString<>"" Then'QueryString提交時(shí)的檢測(cè)
        For Each F_Get In Request.QueryString
            If (Instr(LCase(Request.Form(F_Get)),"<script")<>0 or Instr(LCase(Request.Form(F_Get)),"</script>")<>0) and Instr(LCase(Request.Form(F_Get)),"http://")<>0 Then
                Cheack_Sqljs=True
                Exit For
            End If
        Next
    End If
End Function
Function CheckDataFrom()'檢查提交數(shù)據(jù)來(lái)源:True為數(shù)據(jù)從站外提交過來(lái)的
    CheckDataFrom=True
    server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
    server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
    if mid(server_v1,8,len(server_v2))<>server_v2 then
        CheckDataFrom=False
    end if
End Function
If Cheack_Sqljs or CheckDataFrom Then
   Response.Write "<Script Language=JavaScript>alert('禁止執(zhí)行,非法操作。');</Script>"
   Response.End()
End If

本文章由南寧網(wǎng)站建設(shè)、南寧網(wǎng)站優(yōu)化南寧網(wǎng)絡(luò)公司整理,轉(zhuǎn)載請(qǐng)注明出處:http://m.absorbed3d.com/

關(guān)于我們 | 域名主機(jī) | 建站套餐 | 企業(yè)動(dòng)態(tài) | 成功案例 | 網(wǎng)站推廣 | 建站知識(shí) | 常見問題 | 聯(lián)系我們

南寧煙寒網(wǎng)絡(luò)竭誠(chéng)為您免費(fèi)提供南寧網(wǎng)站建設(shè)南寧網(wǎng)站設(shè)計(jì)、南寧網(wǎng)站優(yōu)化、維護(hù)以及網(wǎng)站技術(shù)很方面的網(wǎng)絡(luò)服務(wù)!

南寧網(wǎng)站建設(shè)南寧網(wǎng)絡(luò)公司咨詢熱線電話:0771-5306126 18967841786(24小時(shí)全天電話)

煙寒網(wǎng)絡(luò) - 讓你進(jìn)一步走向成功