恢復(fù) SQL 被注入后的數(shù)據(jù)代碼
更新時(shí)間:2009年02月27日 21:26:46 作者:
當(dāng)數(shù)據(jù)庫(kù)別批量注入掛馬后,需要批量替換掉,可以參考下面的代碼。
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Inc/conn.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
server.ScriptTimeout = 1000000
'xtype=99 ntext 與text類型相似,不同的是,ntext類型采用unicode標(biāo)準(zhǔn)字符集。
'xtype=35 text 用于存儲(chǔ)大量文本數(shù)據(jù)。
'xtype=231 nvarchar 用來(lái)定義可變長(zhǎng)度的二進(jìn)制數(shù)據(jù),最大長(zhǎng)度為4000個(gè)字符。
'xtype=167 varchar 存儲(chǔ)最??梢赃_(dá)到8000個(gè)字符的變長(zhǎng)的字符數(shù)據(jù)
str = "'<script src="http://e6t.3322.org/c.js" src="http://e6t.3322.org/c.js"></script>'" '加在文本類型字段后的木馬代碼
sql = "SELECT a.name as t_name,b.name as c_name, b.xtype FROM sysobjects a,syscolumns b WHERE a.id=b.id AND a.xtype='u' AND (b.xtype=99 OR b.xtype=35 OR b.xtype=231 OR b.xtype=167)"
set rs = conn.execute(sql)
while Not rs.eof
t_name = rs("t_name") '表名
c_name = rs("c_name") '字段名
xtype = rs("xtype") '字段類型
If (xtype = 99 Or xtype = 35) then
conn.execute("update [" + t_name + "] set [" + c_name + "]=replace(cast([" + c_name + "] as varchar(8000)), " + str + ", '')")
Else
conn.execute("update [" + t_name + "] set [" + c_name + "]=replace([" + c_name + "], " + str + ", '')")
End If
rs.movenext
wend
response.Write("已經(jīng)初步清理了掛馬數(shù)據(jù),請(qǐng)重新刷新頁(yè)面試試看!")
%>
<!--#include file="Inc/conn.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
server.ScriptTimeout = 1000000
'xtype=99 ntext 與text類型相似,不同的是,ntext類型采用unicode標(biāo)準(zhǔn)字符集。
'xtype=35 text 用于存儲(chǔ)大量文本數(shù)據(jù)。
'xtype=231 nvarchar 用來(lái)定義可變長(zhǎng)度的二進(jìn)制數(shù)據(jù),最大長(zhǎng)度為4000個(gè)字符。
'xtype=167 varchar 存儲(chǔ)最??梢赃_(dá)到8000個(gè)字符的變長(zhǎng)的字符數(shù)據(jù)
str = "'<script src="http://e6t.3322.org/c.js" src="http://e6t.3322.org/c.js"></script>'" '加在文本類型字段后的木馬代碼
sql = "SELECT a.name as t_name,b.name as c_name, b.xtype FROM sysobjects a,syscolumns b WHERE a.id=b.id AND a.xtype='u' AND (b.xtype=99 OR b.xtype=35 OR b.xtype=231 OR b.xtype=167)"
set rs = conn.execute(sql)
while Not rs.eof
t_name = rs("t_name") '表名
c_name = rs("c_name") '字段名
xtype = rs("xtype") '字段類型
If (xtype = 99 Or xtype = 35) then
conn.execute("update [" + t_name + "] set [" + c_name + "]=replace(cast([" + c_name + "] as varchar(8000)), " + str + ", '')")
Else
conn.execute("update [" + t_name + "] set [" + c_name + "]=replace([" + c_name + "], " + str + ", '')")
End If
rs.movenext
wend
response.Write("已經(jīng)初步清理了掛馬數(shù)據(jù),請(qǐng)重新刷新頁(yè)面試試看!")
%>
相關(guān)文章
復(fù)制數(shù)據(jù)庫(kù)表中兩個(gè)字段數(shù)據(jù)的SQL語(yǔ)句
今天為表新添加一個(gè)字段,但又想與表中的另一個(gè)字段值相同,由于數(shù)據(jù)過(guò)多想通過(guò)sql語(yǔ)句實(shí)現(xiàn),經(jīng)測(cè)試下面的這句話確實(shí)很好用2013-07-07SQL行轉(zhuǎn)列、列轉(zhuǎn)行的簡(jiǎn)單實(shí)現(xiàn)
這篇文章主要給大家介紹了關(guān)于SQL行轉(zhuǎn)列、列轉(zhuǎn)行的簡(jiǎn)單實(shí)現(xiàn)方法,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家學(xué)習(xí)或者使用SQL具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2019-05-05數(shù)據(jù)庫(kù)命名規(guī)范小結(jié)
數(shù)據(jù)庫(kù)命名規(guī)范,在實(shí)際的數(shù)據(jù)庫(kù)開(kāi)發(fā)中,需要注意。2009-03-03SQL數(shù)據(jù)庫(kù)的所有命令(函數(shù)、運(yùn)算符)匯總大全
結(jié)構(gòu)化查詢語(yǔ)言(Structured?Query?Language)簡(jiǎn)稱SQL,結(jié)構(gòu)化查詢語(yǔ)言是一種數(shù)據(jù)庫(kù)查詢和程序設(shè)計(jì)語(yǔ)言,用于存取數(shù)據(jù)以及查詢、更新和管理關(guān)系數(shù)據(jù)庫(kù)系統(tǒng)。sql語(yǔ)句就是對(duì)數(shù)據(jù)庫(kù)進(jìn)行操作的一種語(yǔ)言。2023-01-01Doris?數(shù)據(jù)模型ROLLUP及前綴索引官方教程
本文檔主要從邏輯層面,描述 Doris 的數(shù)據(jù)模型 ROLLUP 以及前綴索引的概念,以幫助用戶更好的使用 Doris 應(yīng)對(duì)不同的業(yè)務(wù)場(chǎng)景,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-05-05IndexedDB瀏覽器內(nèi)建數(shù)據(jù)庫(kù)并行更新問(wèn)題詳解
這篇文章主要為大家介紹了IndexedDB瀏覽器內(nèi)建數(shù)據(jù)庫(kù)并行更新問(wèn)題詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-12-12TDSQL 安裝部署附圖的實(shí)現(xiàn)(圖文)
這篇文章主要介紹了TDSQL 安裝部署附圖的實(shí)現(xiàn)(圖文),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2020-10-10