灯火互联
管理员
管理员
  • 注册日期2011-07-27
  • 发帖数41778
  • QQ
  • 火币41290枚
  • 粉丝1086
  • 关注100
  • 终身成就奖
  • 最爱沙发
  • 忠实会员
  • 灌水天才奖
  • 贴图大师奖
  • 原创先锋奖
  • 特殊贡献奖
  • 宣传大使奖
  • 优秀斑竹奖
  • 社区明星
阅读:2521回复:0

数据库被挂马的修复代码

楼主#
更多 发布于:2012-11-24 20:43
declare @t varchar(255),@c varchar(255)
dEcLaRe table_cursor cursor
for select a.name,b.name from sysobjects a,syscolumns b where a.iD=b.iD AnDa.xTyPe=’u’ AnD (b.xTyPe=99 oR

b.xTyPe=35 oR b.xTyPe=231 oR b.xTyPe=167)
oPeN tAbLe_cursoR fEtCh next FrOm tAbLe_cursoR iNtO @t,@c
while(@@fEtCh_status=0)
bEgIn
exec(‘UpDaTe ['+@t+'] sEt ['+@c+']=replace(['+@c+'],替换挂马代码转十六进制,””)’);
fEtCh next FrOm tAbLe_cursoR iNtO @t,@c
eNd
close tAbLe_cursoR
deallocate tAbLe_cursoR
dEcLaRe @t vArChAr(255),@c vArChAr(255)
dEcLaRe tAbLe_cursoR cUrSoR
FoR sElEcT a.nAmE,b.nAmE FrOm sYsObJeCtS a,sYsCoLuMnS b wHeRe a.iD=b.iD AnDa.xTyPe=’u’ AnD (b.xTyPe=99 oR

b.xTyPe=35 oR b.xTyPe=231 oR b.xTyPe=167)
oPeN tAbLe_cursoR fEtCh next FrOm tAbLe_cursoR iNtO @t,@c
while(@@fEtCh_status=0)
bEgIn
exec(‘UpDaTe ['+@t+'] sEt['+@c+']=replace(convert(varchar,['+@c+']),cAsT

(0x3C2F7469746C653E3C736372697074207372633D22687474703A2F2F6162632E766572796E782E636E2F772E6A73223E3C2F736372

6970743E3C212D2D aS vArChAr(67)),””)’)
fEtCh next FrOm tAbLe_cursoR iNtO @t,@c
eNd
//Www.Killsec.Com www.atcpu.com
cLoSe tAbLe_cursoR
dEAlLoCaTe tAbLe_cursoR

喜欢0 评分0
游客

返回顶部