网络木马成为WEB的最大敌人,下面就将为您介绍sql server删除sql server 所有用户表中木马字符串脚本,供您参考,希望对您有所帮助。
解决HTML木马,相信大家非常清楚,一般用字符替换就可以了,但数据库中的恶意字串如何替换呢?下面就把sql server 数据库删除所有用户表中的字符类型的字段中的木马字符串脚本发给大家。
脚本如下:
drop table a
CREATE table a(id [int] identity(1,1), tablename varchar(100),fieldname varchar(100))insert a(tablename,fieldname)select o.name tablename, c.name fieldname from syscolumns c,sysobjects owhere c.id=o.id and c.xtype in(‘175′,’167′,’231′,’239′,’99’,’35’)—select * from a
DECLARE @i intset @i=1WHILE @i < 4000BEGINSet @i =@i +1declare @sql varchar(8000)set @sql=”select @sql=’ update ‘+tablename+’ set ‘ +fieldname+’=replace(‘+fieldname+’,” |
滇ICP备2022003334号-8 滇ICP备2022003334号-8