MSSQL木馬修復,中木馬後的處置辦法。本站提示廣大學習愛好者:(MSSQL木馬修復,中木馬後的處置辦法)文章只能為提供參考,不一定能成為您想要的結果。以下是MSSQL木馬修復,中木馬後的處置辦法正文
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;