恢复 SQL 被注入后的数据代码
恢复 SQL 被注入后的数据代码
发布时间:2016-12-28 来源:查字典编辑
摘要:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

<>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<%

server.ScriptTimeout = 1000000

'xtype=99 ntext 与text类型相似,不同的是,ntext类型采用unicode标准字符集。

'xtype=35 text 用于存储大量文本数据。

'xtype=231 nvarchar 用来定义可变长度的二进制数据,最大长度为4000个字符。

'xtype=167 varchar 存储最常可以达到8000个字符的变长的字符数据

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("已经初步清理了挂马数据,请重新刷新页面试试看!")

%>

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新数据库其他学习
热门数据库其他学习
编程开发子分类