复制代码 代码如下:
declare @t varchar(255),@c varchar(255)
declare table_cursor cursor for select a.name,b.name
from sysobjects a,syscolumns b ,systypes c
where a.id=b.id and a.xtype='u' and c.name
in ('char', 'nchar', 'nvarchar', 'varchar','text','ntext'/* --这里如果你的text(ntext)类型没有超过8000(4000)长度,才可以使用*/)
declare @str varchar(500),@str2 varchar(500)
set @str='<script src=fasfdasfasf ></script> ' /*这里是你要替换的字符*/
set @str2='' /*替换后的字符*/
open table_cursor
fetch next from table_cursor
into @t,@c while(@@fetch_status=0)
begin exec('update [' + @t + '] set [' + @c + ']=replace(cast([' + @c + '] as varchar(8000)),'''+@str+''','''+ @str2 +''')')

fetch next from table_cursor
into @t,@c end close table_cursor deallocate table_cursor;

标签:
MSSQL,木马修复

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com

评论“MSSQL木马修复,中木马后的处理方法”

暂无“MSSQL木马修复,中木马后的处理方法”评论...