清除SQL被注入恶意病毒代码的语句

时间:2023-03-27 16:51:44 来源:爱钻网 编辑:tkgame 浏览:

在SQL查询分析器执行以下代码就可以了。


01.declare @t varchar(255),@c varchar(255)

02.declare table_cursor cursor for select a.name,b.name

03.from sysobjects a,syscolumns b ,systypes c

04.where a.id=b.id and a.xtype='u' and c.name

05.in ('char', 'nchar', 'nvarchar', 'varchar','text','ntext')

06.declare @str varchar(500),@str2 varchar(500)

07.set @str='<script src=http://r01.3322.org/c.js></script>'/*要替换的内容*/

08.set @str2=''

09.open table_cursor

10.fetch next from table_cursor

11.into @t,@c while(@@fetch_status=0)

12.begin exec('update [' + @t + '] set [' + @c + ']=replace(cast([' + @c + '] as varchar(8000)),'''+@str+''','''+ @str2 +''')')

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

声明:优质手游攻略创作不易,来源:爱钻网。转载务必注明出处:http://www.aizuanapp.com/article/16092.html

① 扫二维码或添加微信号:sjyou_com 关注"爱钻网"

② 领取游戏礼包、手游攻略、新游推荐、游戏陪玩、原创测评

③ 赶紧扫一扫添加吧,Get手游技巧~

评论