DVWA学习之SQL注入
环境工具
dvwa 1.9
phpstudy
firefox
burpsuite
实验步骤
一、设置安全级别为LOW
1. 登录DVWA,并将安全级别设置为LOW
2. 进入SQL注入模块,并输入1,返回结果如下
3. 下面判断注入类型是字符型注入还是整数型注入
字符型注入的SQL语句形如
select * from xx where id='$id'
整数型注入的SQL语句形如
select * from xx where id=$id
(1) 分别输入 1 and 1=1 和 1 and 1=2,都能返回正常结果
说明不是整数型注入,因为如果是整数型注入,执行select * from xx where id=1 and 1=2 时应报错。
(问:select * from xx where id='1 and 1=2' 这里应该不返回结果才对?)
(2) 输入 1’ or '1'='1 ,返回所有结果
4. 获取列数
(1) 1' or '1'='1' order by 3 #
(2) 1' or '1'='1' order by 2 #