挂马代码清除方法集
2009-02-04 17:29
232 查看
1、varchar 类型的直接replace一下就ok了。
如:"update [t_information] set publisher=replace(publisher, '', '')"
2、text字段,就要麻烦一下(超过8000就要另想办法了)
"update [t_information] set AuthorInfor=replace(cast(AuthorInfor as varchar(8000)) ,'','')"
3、有时有特殊符号,如 %,可以用下列的方法处理一下
update [infor_types] set parentid=replace(parentid, char(37), '')
<%@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标准字符集。
'xtype=35 text 用于存储大量文本数据。
'xtype=231 nvarchar 用来定义可变长度的二进制数据,最大长度为4000个字符。
'xtype=167 varchar 存储最常可以达到8000个字符的变长的字符数据
str = "'<mce:script src="http://e6t.3322.org/c.js" mce_src="http://e6t.3322.org/c.js"></mce: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("已经初步清理了挂马数据,请重新刷新页面试试看!")
%>
<%
server.ScriptTimeout = 1000000
'xtype=99 ntext 与text类型相似,不同的是,ntext类型采用unicode标准字符集。
'xtype=35 text 用于存储大量文本数据。
'xtype=231 nvarchar 用来定义可变长度的二进制数据,最大长度为4000个字符。
'xtype=167 varchar 存储最常可以达到8000个字符的变长的字符数据
str = "''" '加在文本类型字段后的木马代码
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("已经初步清理了挂马数据,请重新刷新页面试试看!")
%>
如:"update [t_information] set publisher=replace(publisher, '', '')"
2、text字段,就要麻烦一下(超过8000就要另想办法了)
"update [t_information] set AuthorInfor=replace(cast(AuthorInfor as varchar(8000)) ,'','')"
3、有时有特殊符号,如 %,可以用下列的方法处理一下
update [infor_types] set parentid=replace(parentid, char(37), '')
<%@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标准字符集。
'xtype=35 text 用于存储大量文本数据。
'xtype=231 nvarchar 用来定义可变长度的二进制数据,最大长度为4000个字符。
'xtype=167 varchar 存储最常可以达到8000个字符的变长的字符数据
str = "'<mce:script src="http://e6t.3322.org/c.js" mce_src="http://e6t.3322.org/c.js"></mce: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("已经初步清理了挂马数据,请重新刷新页面试试看!")
%>
<%
server.ScriptTimeout = 1000000
'xtype=99 ntext 与text类型相似,不同的是,ntext类型采用unicode标准字符集。
'xtype=35 text 用于存储大量文本数据。
'xtype=231 nvarchar 用来定义可变长度的二进制数据,最大长度为4000个字符。
'xtype=167 varchar 存储最常可以达到8000个字符的变长的字符数据
str = "''" '加在文本类型字段后的木马代码
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("已经初步清理了挂马数据,请重新刷新页面试试看!")
%>
相关文章推荐
- VBS清除全盘网页文件被挂马代码【VBS专杀】
- 批量清除挂马网站的恶意脚本代码
- 如何进行网站挂马检测与清除
- 一段用来清除C++/C代码中空白行的perl脚本
- 【Android】Android清除本地数据缓存代码
- Android清除本地缓存工具类代码
- 安卓应用清除缓存一般清理目录和代码(带弹框)
- Android清除本地数据缓存代码
- asp.net通过js实现Cookie创建以及清除Cookie数组的代码
- Asp清除html中style,javascript,css代码
- 关于android清除缓存代码及计算大小
- Android清除本地数据缓存代码
- Android清除本地数据缓存代码
- sql解封代码(有后门,自行清除)
- ros如何及时清除障碍物层或者超声波层的的消息 clear_costmap_recovery 代码详解
- 清除浮动的代码
- 清除SQL被注入恶意病毒代码 详细出处参考
- PHP批量删除、清除UTF-8文件BOM头的代码实例
- Android清除本地数据缓存代码