关于order by注入利用rand(true)的一个疑问
2016-03-07 18:52
405 查看
order by的一个利用方式是使用
rand(true)
rand(false)
返回排序不同进行盲注,
rand((select char(substring(table_name,1,1)) from information_schema.tables limit 1)<=128))
order by rand()是随机排序返回,经过测试发现 select rand(true) 结果是0.40540353712197724
select rand(false); 结果是0.15522042769493574 疑问就是,这里order by rand(true)的含义是啥,根据什么标准进行排序?
会为每一条记录都生成一个随机值,然后排序
参考
https://www.warpconduit.net/2011/03/23/selecting-a-random-record-using-mysql-benchmark-results/
@小饼仔 感谢,知道了rand()随机排序的原理,不过order by rand(true) 是啥意思呢
@D&G
rand(N)里面的N是一个用来生产随机数的seed value,类型为常量整数。
至于rand(true),你执行下
参考
http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html#function_rand
感谢大神~懂了。true 和false 自动转换成整型,rand(1)和rand(0) 有固定种子,两种排序不一样,作为标准盲注~~~
rand(true)
rand(false)
返回排序不同进行盲注,
rand((select char(substring(table_name,1,1)) from information_schema.tables limit 1)<=128))
order by rand()是随机排序返回,经过测试发现 select rand(true) 结果是0.40540353712197724
select rand(false); 结果是0.15522042769493574 疑问就是,这里order by rand(true)的含义是啥,根据什么标准进行排序?
会为每一条记录都生成一个随机值,然后排序
Order by Rand() Method SELECT * FROM myTable ORDER BY RAND() LIMIT 1; This method works by generating a random value for each row of the table, sorting the table according to these random values, and then returning one row.
参考
https://www.warpconduit.net/2011/03/23/selecting-a-random-record-using-mysql-benchmark-results/
@小饼仔 感谢,知道了rand()随机排序的原理,不过order by rand(true) 是啥意思呢
@D&G
rand(N)里面的N是一个用来生产随机数的seed value,类型为常量整数。
至于rand(true),你执行下
select true, false ;就知道了,分别为1 和 0
参考
http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html#function_rand
RAND(), RAND(N) Returns a random floating-point value v in the range 0 <= v < 1.0. If a constant integer argument N is specified, it is used as the seed value, which produces a repeatable sequence of column values. In the following example, note that the sequences of values produced by RAND(3) is the same both places where it occurs.
感谢大神~懂了。true 和false 自动转换成整型,rand(1)和rand(0) 有固定种子,两种排序不一样,作为标准盲注~~~
相关文章推荐
- proxy-target-class="true" 与proxy-target-class="false"的区别
- 自定义导航栏按钮UIBarButtonItem 文字或图片(定制)
- UILabel的一些不常用属性,持续更新
- LeetCode 96. Unique Binary Search Trees
- 语言编程中返回false和true的易错点
- Java String、StringBuffer、StringBuilder比较
- UE4 学习笔记(一)--- TextBox 文本框用BluePrint做限制字符输入个数
- 1101. Quick Sort (25)
- Storyboard中的UIScrollView使用自动布局,使其能够滚动
- 使用GUI工具高效构建你自己的Nuget包
- 关于UISearchController的使用方法
- Java中break、continue、return语句的使用区别
- QuickFix/J (3):自定义字段
- 关于Webkit 控件dui化闪屏的解决
- 121.Which two statements are true regarding the USING clause in table joins? (Choose two .)
- android studio 导入其他项目一直build 问题
- android 6.0 SystemUI源码分析(3)-Recent Panel加载显示流程
- hbuilder的使用
- build.prop参数详解和部分修改
- 【hdu3732】Ahui Writes Word——多重背包